Polymake Template Library (PTL): pm::ListMatrix< TVector > Class Template Reference
Polymake Template Library (PTL)  4.2
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 , typename = std::enable_if_t<fits_as_input_iterator<Iterator>::value>>
 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, E > &m)
 
void fill (const E2 &x)
 
top_type & negate ()
 negate elements in place
 
std::enable_if< is_expandable_by< TMatrix2 >), top_type & >::type operator/= (const GenericMatrix< TMatrix2 > &m)
 append rows of another matrix
 
std::enable_if< is_expandable_by< TVector >), top_type & >::type operator/= (const GenericVector< TVector > &v)
 append a vector as a row
 
std::enable_if_t< is_expandable_by< TMatrix2 >), top_type & > operator|= (const GenericMatrix< TMatrix2 > &m)
 append columns of another matrix
 
std::enable_if_t< is_expandable_by< TVector >), top_type & > operator|= (const GenericVector< TVector > &v)
 append a vector as a column
 
IndexedSlice< masquerade< ConcatRows, const typename Unwary< TMatrix >::type & >, const series > diagonal (Int i=0) const &
 
IndexedSlice< masquerade< ConcatRows, const typename Unwary< TMatrix >::type & >, const series > anti_diagonal (Int i=0) const &
 

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

◆ ListMatrix()

template<typename TVector >
template<typename Iterator , typename = std::enable_if_t<fits_as_input_iterator<Iterator>::value>>
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

◆ anti_diagonal()

IndexedSlice<masquerade<ConcatRows, const typename Unwary<TMatrix>::type&>, const series> pm::GenericMatrix::anti_diagonal ( Int  i = 0) const &
inlineinherited
Parameters
i==0main anti-diagonal; i>0: i-th diagonal below the main; i<0: (-i)-th above the main

◆ diagonal()

IndexedSlice<masquerade<ConcatRows, const typename Unwary<TMatrix>::type&>, const series> pm::GenericMatrix::diagonal ( Int  i = 0) const &
inlineinherited
Parameters
i==0main diagonal; i>0: i-th diagonal below the main; i<0: (-i)-th above the main

◆ fill()

void pm::GenericMatrix::fill ( const E2 &  x)
inlineinherited

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

◆ operator=()

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.

◆ swap() [1/2]

void pm::GenericMatrix::swap ( GenericMatrix< TMatrix2, E > &  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.

◆ swap() [2/2]

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.


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