HLIBpro  3.0
TPermutation Class Reference

Describes permutation of index sets.

#include <TPermutation.hh>

Inheritance diagram for TPermutation:

Public Member Functions

 TPermutation (const size_t asize=0)
 construct permutation of size asize
 
 TPermutation (const std::vector< idx_t > &perm)
 construct permutation with data defined by array perm
 
 TPermutation (const TPermutation &perm)
 copy ctor
 
virtual ~TPermutation ()
 dtor
 
idx_t permute (const idx_t idx) const
 permute given index
 
template<typename value_t >
void permute (const TVector< value_t > *x, TVector< value_t > *y) const
 reorder given vector x and write result to y
 
template<typename value_t >
void permute_inv (const TVector< value_t > *x, TVector< value_t > *y) const
 use inverse permutation to reorder given vector x and write result to y
 
template<typename value_t >
void permute (TVector< value_t > *x) const
 permute given vector \x inplace
 
template<typename value_t >
void permute_inv (TVector< value_t > *x) const
 apply inverse permutation to given vector \x
 
void invert ()
 invert permutation
 
TPermutation inverse ()
 return inverse permutation
 
virtual void read (TByteStream &s)
 read object data from bytestream s
 
virtual void write (TByteStream &s) const
 write object data to bytestream s
 
virtual size_t bs_size () const
 returns size of object in bytestream
 
TPermutationoperator= (const TPermutation &perm)
 copy operator
 
TPermutationoperator= (const std::vector< idx_t > &perm)
 copy operator for vector
 
virtual size_t byte_size () const
 return size in bytes used by this object