Polymake Template Library (PTL): pm::GenericVector< TVector, E > Class Template Reference
pm::GenericVector< TVector, E > Class Template Reference

Generic type for vectors More...

Inherits pm::Generic< Top >, and pm::operators::base.

Public Types

typedef E element_type
 element type
 
typedef std::conditional< is_sparse, SparseVector< E >, Vector< E > >::type persistent_type
 persistent type
 
typedef Generic< TVector >::top_type top_type
 top type
 
typedef GenericVector generic_type
 generic type
 

Public Member Functions

template<typename TVector2 >
top_typeoperator+= (const GenericVector< TVector2 > &v)
 
template<typename TVector2 >
top_typeoperator-= (const GenericVector< TVector2 > &v)
 
template<typename Right >
top_typeoperator*= (const Right &r)
 multiply with an element
 
template<typename Right >
top_typeoperator/= (const Right &r)
 appending an element
 
template<typename Right >
top_typediv_exact (const Right &r)
 divide by an element
 
top_typedehomogenize ()
 divides by the first element
 
top_typedehomogenize_trop ()
 subtracts first element
 
void remove0s ()
 remove all zero elements which might have been overseen in some previous operation
 
template<typename IndexSet >
std::enable_if< isomorphic_to_container_of< IndexSet, int >::value, IndexedSlice< unwary_t< TVector > &, const typename Concrete< IndexSet >::type & > >::type slice (const IndexSet &indices)
 

Static Public Attributes

static const bool is_sparse =check_container_feature<TVector, sparse>::value
 determine if the persistent type is sparse
 

Detailed Description

template<typename TVector, typename E = typename TVector::element_type>
class pm::GenericVector< TVector, E >

Generic type for vectors

Member Function Documentation

template<typename TVector, typename E = typename TVector::element_type>
template<typename TVector2 >
top_type& pm::GenericVector< TVector, E >::operator+= ( const GenericVector< TVector2 > &  v)
inline

adding a vector TODO: check whether addition is defined for both element types

template<typename TVector, typename E = typename TVector::element_type>
template<typename TVector2 >
top_type& pm::GenericVector< TVector, E >::operator-= ( const GenericVector< TVector2 > &  v)
inline

subtracting a vector TODO: check whether subtraction is defined for both element types

template<typename TVector, typename E = typename TVector::element_type>
template<typename IndexSet >
std::enable_if<isomorphic_to_container_of<IndexSet, int>::value, IndexedSlice<unwary_t<TVector>&, const typename Concrete<IndexSet>::type&> >::type pm::GenericVector< TVector, E >::slice ( const IndexSet &  indices)
inline

Select a vector slice consisting of elements with given indices. The last variant selects a contiguous range of indices beginning with start. size==-1 means up to the end of the vector. The const variants of these methods create immutable slice objects. The indices must lie in the valid range.


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