Polymake Template Library (PTL)  3.5
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
pm::GenericVector< TVector, E > Class Template Reference

Generic type for vectors More...

Inherits pm::Generic< Top >.

Public Types

using element_type = E
 element type
 
using persistent_type = std::conditional_t< is_sparse, SparseVector< E >, Vector< E > >
 persistent type
 
using generic_type = GenericVector
 generic type
 

Public Member Functions

top_type & negate ()
 negate elements in place
 
top_type & dehomogenize ()
 divide by the first element
 
top_type & dehomogenize_trop ()
 subtracts first element
 
void remove0s ()
 remove all zero elements which might have been overseen in some previous operation
 
template<typename IndexSetRef >
IndexedSlice< const typename Unwary< TVector >::type &, typename final_index_set< IndexSetRef >::type > slice (IndexSetRef &&indices, std::enable_if_t< isomorphic_to_container_of< pure_type_t< IndexSetRef >, int >::value, void ** >=nullptr) const &
 

Static Public Attributes

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

Friends

template<typename Op >
lazy_op< Op, void, BuildUnary< operations::neg > >::v_type operator- (Op &&m)
 negate
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::add > >::v_v_type operator+ (Left &&l, Right &&r)
 add a vector
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::sub > >::v_v_type operator- (Left &&l, Right &&r)
 subtract a vector
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::mul > >::v_s_type operator* (Left &&l, Right &&r)
 multiply with a scalar
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::mul > >::v_v_type operator* (Left &&l, Right &&r)
 scalar (dot) product
 
sqr (const GenericVector &v)
 multiply a vector with itself
 
template<typename Left , typename Right >
lazy_tensor< Left, Right, BuildBinary< operations::mul > >::v_v_type tensor_product (Left &&l, Right &&r)
 tensor product of two vectors
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::div > >::v_s_type operator/ (Left &&l, Right &&r)
 divide by a scalar
 
template<typename Left , typename Right >
lazy_op< Left, Right, BuildBinary< operations::divexact > >::v_s_type div_exact (Left &&l, Right &&r)
 divide without residue by a scalar
 

Detailed Description

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

Generic type for vectors

Member Function Documentation

◆ slice()

template<typename TVector, typename E>
template<typename IndexSetRef >
IndexedSlice<const typename Unwary<TVector>::type&, typename final_index_set<IndexSetRef>::type> pm::GenericVector< TVector, E >::slice ( IndexSetRef &&  indices,
std::enable_if_t< isomorphic_to_container_of< pure_type_t< IndexSetRef >, int >::value, void ** >  = nullptr 
) const &
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: