Polymake Template Library (PTL): pm::ListMatrix< TVector > Class Template Reference
pm::ListMatrix< TVector > Class Template Reference

List of row vectors. More...

Inheritance diagram for pm::ListMatrix< TVector >:
Collaboration diagram for pm::ListMatrix< TVector >:

Public Member Functions

 ListMatrix ()
 create as empty
 
 ListMatrix (int r, int c)
 create matrix with r rows and c columns, initialize all elements to 0
 
template<typename Iterator >
 ListMatrix (int r, int c, Iterator src)
 
ListMatrixoperator= (const ListMatrix &other)
 
void swap (ListMatrix &M)
 
void resize (int r, int c)
 Resize to new dimensions, added elements initialized with default constructor.
 
void clear ()
 Truncate to 0x0 matrix.
 
int rows () const
 the number of rows of the matrix
 
int cols () const
 the number of columns of the matrix
 
template<typename TVector2 >
row_list::iterator insert_row (const typename row_list::iterator &where, const GenericVector< TVector2 > &v)
 Insert a new row at the given position: before the row pointed to by where.
 
void delete_row (const typename row_list::iterator &where)
 Delete the row pointed to by where. Be aware that the iterator becomes void after the removal unless rescued in good time (with postincrement or postdecrement).
 
void swap (GenericMatrix< TMatrix2, TVector::element_type > &m)
 
void fill (const E2 &x)
 
std::enable_if< compatible_symmetry_types< TMatrix2 >), top_type & >::type operator+= (const GenericMatrix< TMatrix2 > &m)
 adding a GenericMatrix
 
std::enable_if< compatible_symmetry_types< TMatrix2 >), top_type & >::type operator-= (const GenericMatrix< TMatrix2, TVector::element_type > &m)
 subtracting a GenericMatrix
 
top_type & operator*= (const Right &r)
 multiply with an element
 
std::enable_if< is_expandable_by< TMatrix2 >), top_type & >::type operator/= (const GenericMatrix< TMatrix2 > &m)
 append the rows of a GenericMatrix
 
std::enable_if< is_expandable_by< TVector >), top_type & >::type operator/= (const GenericVector< TVector > &v)
 append a GenericVector as a row
 
std::enable_if< isomorphic_types< TVector::element_type, Right >::value, top_type & >::type div_exact (const Right &r)
 divide by an element
 
std::enable_if< is_expandable_by< TMatrix2 >), top_type & >::type operator|= (const GenericMatrix< TMatrix2 > &m)
 append the columns of a GenericMatrix
 
std::enable_if< is_expandable_by< TVector >), top_type & >::type operator|= (const GenericVector< TVector > &v)
 append a GenericVector as a column
 
IndexedSlice< ConcatRows< unwary_t< ListMatrix< TVector > > > &, series > diagonal (int i=0)
 
IndexedSlice< ConcatRows< unwary_t< ListMatrix< TVector > > > &, series > anti_diagonal (int i=0)
 

Detailed Description

template<typename TVector>
class pm::ListMatrix< TVector >

List of row vectors.

A list of row vectors. The implementation is based on std::list. It can be parameterized with any persistent vector type.

Constructor & Destructor Documentation

template<typename TVector >
template<typename Iterator >
pm::ListMatrix< TVector >::ListMatrix ( int  r,
int  c,
Iterator  src 
)
inline

Create a matrix with given dimensions. Elements are initialized from an input sequence. Elements are assumed to come in the row order.

Member Function Documentation

IndexedSlice<ConcatRows<unwary_t<ListMatrix< TVector > > >&, series> pm::GenericMatrix< ListMatrix< TVector > , TVector::element_type >::anti_diagonal ( int  i = 0)
inlineinherited
Parameters
i==0main anti-diagonal; i>0: i-th diagonal below the main; i<0: (-i)-th above the main
IndexedSlice<ConcatRows<unwary_t<ListMatrix< TVector > > >&, series> pm::GenericMatrix< ListMatrix< TVector > , TVector::element_type >::diagonal ( int  i = 0)
inlineinherited
Parameters
i==0main diagonal; i>0: i-th diagonal below the main; i<0: (-i)-th above the main
void pm::GenericMatrix< ListMatrix< TVector > , TVector::element_type >::fill ( const E2 &  x)
inlineinherited

Fill with given value without changing the dimensions. x can be of arbitrary type assignable to the type E2.

template<typename TVector >
ListMatrix& pm::ListMatrix< TVector >::operator= ( const ListMatrix< TVector > &  other)
inline

Persistent matrix objects have after the assignment the same dimensions as the right hand side operand. Alias objects, such as matrix minor or block matrix, cannot be resized, thus must have the same dimensions as on the right hand side.

template<typename TVector >
void pm::ListMatrix< TVector >::swap ( ListMatrix< TVector > &  M)
inline

Exchange the contents of two matrices in a most efficient way. If at least one non-persistent object is involved, the operands must have equal dimensions.

void pm::GenericMatrix< ListMatrix< TVector > , TVector::element_type >::swap ( GenericMatrix< TMatrix2, TVector::element_type > &  m)
inlineinherited

Exchange the contents of two matrices in a most efficient way. If at least one non-persistent object is involved, the operands must have equal dimensions.


The documentation for this class was generated from the following file: