HLIBpro  3.0
TScalarVector< T_value > Class Template Reference

Class for a scalar vector.

#include <TScalarVector.hh>

Inheritance diagram for TScalarVector< T_value >:
TVector< T_value > TTypeInfo

Public Member Functions

 TScalarVector ()
 construct zero sized vector
 
 TScalarVector (const size_t n, const idx_t offset=0)
 construct vector of size n with offset offset
 
 TScalarVector (const TIndexSet &ais)
 construct vector with size defined by indexset ais
 
 TScalarVector (const TIndexSet &ais, const BLAS::Vector< value_t > &bvec)
 
 TScalarVector (const TScalarVector< value_t > &v)
 standard copy constructor
 
 TScalarVector (TScalarVector< value_t > &&v)
 standard move constructor
 
 TScalarVector (const TIndexSet &ais, BLAS::Vector< value_t > &&bvec)
 
virtual ~TScalarVector ()
 destructor
 
virtual size_t size () const
 return size of vector
 
virtual value_t entry (const idx_t i) const
 access coefficent i (real valued)
 
virtual void set_entry (const idx_t i, const value_t f)
 set coefficient i to f (real valued)
 
virtual void add_entry (const idx_t i, const value_t f)
 add f to i'th entry
 
BLAS::Vector< value_t > & blas_vec ()
 return real valued data
 
const BLAS::Vector< value_t > & blas_vec () const
 return constant real valued data
 
virtual void set_size (const size_t n)
 set size of vector
 
virtual void set_cluster (const TCluster *c)
 define vector by cluster
 
virtual void set_is (const TIndexSet &ais)
 define vector by indexset
 
virtual void set_vector (const BLAS::Vector< value_t > &vec, const idx_t offset)
 set internal data directly (real valued)
 
virtual void copy_from (const TScalarVector< value_t > *v)
 copy from vector v
 
virtual void copy_to (TScalarVector< value_t > *v) const
 copy to vector v
 
virtual void copy_from (const value_t *v)
 copy from C array v
 
virtual void copy_to (value_t *v)
 copy to C array v
 
TScalarVector< value_t > & operator= (const TScalarVector< value_t > &v)
 standard copy operator
 
void permute (const TPermutation &perm)
 permute entries according to perm
 
virtual void conjugate ()
 conjugate coefficients
 
virtual void fill (const value_t alpha)
 fill vector with constant α
 
virtual void fill_rand (const uint seed)
 fill vector with random numbers
 
virtual void scale (const value_t alpha)
 set this ≔ α · this
 
virtual void assign (const value_t alpha, const TVector< value_t > *x)
 set this ≔ α · x
 
virtual value_t dot (const TVector< value_t > *x) const
 return inner product <this, x> = this^H · x
 
virtual value_t dotu (const TVector< value_t > *x) const
 return inner product <this, x> = this^T · x
 
virtual real_t norm2 () const
 compute ‖·‖₂
 
virtual real_t norm_inf () const
 compute ‖·‖∞
 
virtual void axpy (const value_t alpha, const TVector< value_t > *x)
 set this ≔ this + α · x
 
virtual void add_sub_mt (const TScalarVector< value_t > &x)
 set this ≔ this + x (thread safe, is(x) ⊆ is(this))
 
virtual size_t byte_size () const
 return size in bytes used by this object
 
virtual auto copy () const -> std::unique_ptr< TVector< value_t > >
 return copy of vector
 
virtual auto create () const -> std::unique_ptr< TVector< value_t > >
 return object of same class
 
virtual auto restrict_re () const -> std::unique_ptr< TVector< real_t > >
 return vector restricted to real part of coefficients
 
virtual auto restrict_im () const -> std::unique_ptr< TVector< real_t > >
 return vector restricted to imaginary part of coefficients
 
virtual auto restrict_abs () const -> std::unique_ptr< TVector< real_t > >
 return vector restricted to absolute value of coefficients
 
virtual void print (const uint ofs=0) const
 print vector information
 
virtual void read (TByteStream &s)
 read vector from stream
 
virtual void write (TByteStream &s) const
 write vector to stream
 
virtual size_t bs_size () const
 returns size of object in bytestream
 
virtual void sum (const TProcSet &ps)
 pointwise summation between all vectors in ps
 
- Public Member Functions inherited from TVector< T_value >
 TVector (const idx_t offset=0)
 construct real or complex valued vector with first index offset
 
 TVector (const TVector< value_t > &v)
 copy constructor
 
virtual ~TVector ()
 dtor
 
virtual bool is_complex () const
 return true, if field type is complex valued
 
virtual bool is_real () const
 return true, if field type is real valued
 
idx_t ofs () const
 return first index (offset)
 
virtual void set_ofs (const idx_t n)
 set first index (offset)
 
TIndexSet is () const
 return index set
 
TVector< value_t > & operator= (const TVector< value_t > &v)
 copy operator for all vectors
 
virtual size_t global_byte_size () const
 
virtual void copy_to (TVector< value_t > *x) const
 assign local values to vector x
 
virtual void sum (const TProcSet &p, const uint pid, const uint nparts, TByteStream *bs=NULL)
 
- Public Member Functions inherited from TTypeInfo
virtual typeid_t type () const =0
 return type ID of object
 
virtual bool is_type (const typeid_t t) const
 return true if local object is of given type ID t
 
virtual std::string typestr () const
 return string representation of type
 

Protected Member Functions

void init_chunk_mutices ()
 initialise mutices for vector chunks
 

Constructor & Destructor Documentation

◆ TScalarVector() [1/2]

TScalarVector ( const TIndexSet ais,
const BLAS::Vector< value_t > &  bvec 
)
inline

construct vector with size defined by indexset ais and data defined by bvec

◆ TScalarVector() [2/2]

TScalarVector ( const TIndexSet ais,
BLAS::Vector< value_t > &&  bvec 
)
inline

construct vector with size defined by indexset ais and data defined by bvec