Polymake Template Library (PTL): lib/core/include/GenericMatrix.h File Reference
Polymake Template Library (PTL)  4.2
GenericMatrix.h File Reference

Classes

class  pm::GenericMatrix
 Generic type for matrices More...
 
class  pm::Matrix
 Matrix type class which holds the elements in a contiguous array
Additional arithmetic operations for matrices and useful constructions (unit_matrix, diag, ...) are listed at operations. More...
 
class  pm::SparseMatrix
 A two-dimensional associative array with row and column indices as keys.
More...
 
class  pm::GenericMatrix
 Generic type for matrices More...
 

Namespaces

 pm
 global namespace for all classes from the polymake project
 
 polymake
 namespace to be used for client code
 

Functions

template<typename TargetType , typename TMatrix >
const TMatrix & pm::convert_to (const GenericMatrix< TMatrix, TargetType > &m)
 explicit conversion of matrix elements to another type
 
template<typename TVector , typename = std::enable_if_t<is_generic_vector<TVector>::value>>
auto pm::repeat_row (TVector &&v, Int n=0) -> RepeatedRow< diligent_ref_t< unwary_t< TVector >>>
 Create a matrix with n rows, each equal to v.
 
template<typename TVector , typename = std::enable_if_t<is_generic_vector<TVector>::value>>
auto pm::repeat_col (TVector &&v, Int n=0) -> RepeatedCol< diligent_ref_t< unwary_t< TVector >>>
 Create a matrix with n columns, each equal to v.
 
template<typename E >
auto pm::same_element_matrix (E &&x, Int m, Int n)
 
template<typename E >
auto pm::ones_matrix (Int m, Int n)
 
template<typename E >
auto pm::zero_matrix (Int m, Int n)
 
template<typename TVector >
auto pm::vector2row (GenericVector< TVector > &v)
 disguise a GenericVector as a matrix with 1 row
 
template<typename TVector >
auto pm::vector2col (GenericVector< TVector > &v)
 disguise a GenericVector as a matrix with 1 column
 
template<typename TVector >
auto pm::diag (const GenericVector< TVector > &v)
 Create a square diagonal matrix from a GenericVector.
 
template<typename TVector >
auto pm::anti_diag (const GenericVector< TVector > &v)
 Create a anti-diagonal matrix.
 
template<typename E >
auto pm::unit_matrix (Int dim)
 Create a unit_matrix of dimension dim.
 
template<typename E , typename Matrix1 , typename Matrix2 >
auto pm::diag (const GenericMatrix< Matrix1, E > &m1, const GenericMatrix< Matrix2, E > &m2)
 Create a block-diagonal matrix.
 
template<typename E , typename Vector1 , typename Matrix2 >
auto pm::diag (const GenericVector< Vector1, E > &v1, const GenericMatrix< Matrix2, E > &m2)
 
template<typename E , typename Matrix1 , typename Vector2 >
auto pm::diag (const GenericMatrix< Matrix1, E > &m1, const GenericVector< Vector2, E > &v2)
 
template<typename E , typename Matrix1 , typename Matrix2 >
auto pm::anti_diag (const GenericMatrix< Matrix1, E > &m1, const GenericMatrix< Matrix2, E > &m2)
 Create a block-anti-diagonal matrix.
 
template<typename E , typename Vector1 , typename Matrix2 >
auto pm::anti_diag (const GenericVector< Vector1, E > &v1, const GenericMatrix< Matrix2, E > &m2)
 
template<typename E , typename Matrix1 , typename Vector2 >
auto pm::anti_diag (const GenericMatrix< Matrix1, E > &m1, const GenericVector< Vector2, E > &v2)