HLIBpro  2.8.1
TVector Class Referenceabstract

Base class for all vectors defining basic interface.

#include <TVector.hh>

Inheritance diagram for TVector:
TTypeInfo TBlockVector TScalarVector TUniformVector TVirtualVector TUniformBlockVector

Public Member Functions

 TVector (const idx_t offset=0, const value_type_t avalue_type=real_valued)
 construct real or complex valued vector with first index offset
 TVector (const TVector &v)
 copy constructor
virtual ~TVector ()
index set functionality
idx_t ofs () const
 return first index (offset)
virtual void set_ofs (const idx_t n)
 set first index (offset)
virtual size_t size () const =0
 return size of vector
TIndexSet is () const
 return index set
management of field type
value_type_t value_type () const
 return value type of vector
bool is_complex () const
 return true if vector is complex valued
void set_complex (const bool b)
 change between real and complex valued representation
access entries
virtual real entry (const idx_t i) const
 return i'th entry
virtual const complex centry (const idx_t i) const
 return i'th entry
virtual void set_entry (const idx_t i, const real f)
 set i'th entry
virtual void set_centry (const idx_t i, const complex f)
 set i'th entry
BLAS functionality (real valued)
virtual void fill (const real)
 fill with constant
virtual void fill_rand (const uint)
 fill with random numbers
virtual void scale (const real)
 scale vector by constant factor
virtual void assign (const real, const TVector *)
 this ≔ f · vector
TVectoroperator= (const TVector &v)
 copy operator for all vectors
virtual real norm2 () const
 return euclidean norm
virtual real norm_inf () const
 return infimum norm
virtual void axpy (const real, const TVector *)
 this ≔ this + α·x
BLAS functionality (complex valued)
virtual void conjugate ()
 conjugate entries
virtual void cfill (const complex &)
 fill with constant
virtual void cscale (const complex &)
 scale vector by constant factor
virtual void cassign (const complex &, const TVector *)
 this ≔ f · vector
virtual complex dot (const TVector *) const
 return dot-product, \(<x,y> = x^H · y\), where \(x\) = this
virtual complex dotu (const TVector *) const
 return dot-product, \(<x,y> = x^T · y\), where \(x\) = this
virtual void caxpy (const complex &, const TVector *)
 this ≔ this + α·x
virtual size_t byte_size () const
 return size in bytes used by this object
virtual size_t global_byte_size () const
virtual auto copy () const -> std::unique_ptr< TVector >=0
 return copy of vector
virtual void copy_to (TVector *x) const
 assign local values to vector x
virtual auto create () const -> std::unique_ptr< TVector >=0
 return object of same class
virtual auto restrict_re () const -> std::unique_ptr< TVector >
 create vector restricted to real part of coefficients
virtual auto restrict_im () const -> std::unique_ptr< TVector >
 create vector restricted to imaginary part of coefficients
virtual auto restrict_abs () const -> std::unique_ptr< TVector >
 create vector restricted to absolute value of coefficients
virtual void read (TByteStream &s)
 read vector data from byte stream
virtual void write (TByteStream &s) const
 write vector data to byte stream
virtual size_t bs_size () const
 returns size of object in bytestream
virtual void sum (const TProcSet &p, const uint pid, const uint nparts, TByteStream *bs=NULL)
virtual void sum (const TProcSet &p)
 same as More...
virtual void print (const uint ofs=0) const
 print vector to stdout
- 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

Member Function Documentation

◆ global_byte_size()

virtual size_t global_byte_size ( ) const

return size in bytes used by this distributed object, i.e. of all distributed sub vectors

◆ sum() [1/2]

virtual void sum ( const TProcSet p)
See also
sum but sum up between all processors in p

Reimplemented in TUniformVector, TUniformBlockVector, and TScalarVector.

◆ sum() [2/2]

virtual void sum ( const TProcSet p,
const uint  pid,
const uint  nparts,
TByteStream bs = NULL 

sum up nparts parallel copies (if bs != NULL it will be used)