HLIBpro  2.0
Public Member Functions | Protected Member Functions | List of all members
TBlockVector Class Reference

Class for a blocked, scalar vector.

#include <TBlockVector.hh>

Inheritance diagram for TBlockVector:
TVector TTypeInfo

Public Member Functions

 TBlockVector (const uint nb=0)
 construct block vector with nb sub blocks
 
 TBlockVector (const TIndexSet &ais, const std::vector< TVector * > &ablocks)
 
virtual ~TBlockVector ()
 dtor
 
virtual size_t size () const
 return size of vector
 
virtual uint n_blocks () const
 return number of blocks
 
TVectorblock (const uint i)
 access single vector block
 
const TVectorblock (const uint i) const
 access single vector block
 
void set_block (const uint i, TVector *v)
 set single vector block
 
void set_block_struct (const uint i)
 setup block structure of vector
 
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
 
virtual void fill (const real f)
 fill with constant
 
virtual void fill_rand (const uint seed)
 fill with random numbers
 
virtual void axpy (const real alpha, const TVector *x)
 set this ≔ this + α · x
 
virtual void scale (const real alpha)
 set this ≔ α · this
 
virtual void assign (const real alpha, const TVector *x)
 set this ≔ α · x
 
virtual real norm2 () const
 compute ‖·‖₂
 
virtual real norm_inf () const
 compute ‖·‖∞
 
virtual void conjugate ()
 conjugate entries
 
virtual void cfill (const complex &f)
 fill with constant
 
virtual void cscale (const complex &alpha)
 set this ≔ α · this
 
virtual void cassign (const complex &alpha, const TVector *x)
 set this ≔ α · x
 
virtual void caxpy (const complex &f, const TVector *x)
 set this ≔ this + α · x
 
virtual complex dot (const TVector *x) const
 return dot-product, $<x,y> = x^H · y$, where $x$ = this
 
virtual typeid_t type () const
 return type of vector
 
virtual bool is_type (const typeid_t t) const
 return true if local object is of given type t
 
virtual size_t byte_size () const
 return size in bytes used by this object
 
virtual TVectorcopy () const
 return copy of vector
 
virtual TVectorcreate () const
 return object of same class
 
virtual void print (const uint ofs=0) const
 print vector to stdout
 
- Public Member Functions inherited from TVector
 TVector (const idx_t offset=0, const bool use_complex=false)
 construct real or complex valued vector with first index offset
 
 TVector (const TVector &v)
 copy constructor
 
virtual ~TVector ()
 dtor
 
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
 
bool is_complex () const
 return true if vector is complex valued
 
void set_complex (const bool b)
 change between real and complex valued representation
 
TVectoroperator= (const TVector &v)
 copy operator for all vectors
 
virtual size_t global_byte_size () const
 
virtual TVectorrestrict_re () const
 create vector restricted to real part of coefficients
 
virtual TVectorrestrict_im () const
 create vector restricted to imaginary part 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...
 
- Public Member Functions inherited from TTypeInfo
virtual std::string typestr () const
 return string representation of type
 

Protected Member Functions

virtual void to_real ()
 convert data to real valued representation
 
virtual void to_complex ()
 convert data to complex valued representation
 

Constructor & Destructor Documentation

TBlockVector ( const TIndexSet ais,
const std::vector< TVector * > &  ablocks 
)
inline

construct block vector over index set ais and with subblocks ablocks