HLIBpro  2.2
Public Types | Public Member Functions | List of all members
Vector< T_value > Class Template Reference

Standard vector in basic linear algebra, i.e. BLAS/LAPACK. More...

#include <VectorBase.hh>

Inheritance diagram for Vector< T_value >:
MemBlock< T_value >

Public Types

typedef T_value value_t
 internal value type
 
typedef MemBlock< value_tsuper_t
 super class type
 
- Public Types inherited from MemBlock< T_value >
typedef T_value value_t
 internal value type
 

Public Member Functions

 Vector ()
 create zero sized vector
 
 Vector (const size_t n)
 create vector of size n
 
 Vector (const Vector &v, const copy_policy_t p=copy_reference)
 copy ctor
 
 Vector (Vector &&v)
 move ctor
 
 Vector (const Matrix< value_t > &M, const Range &ar, const idx_t col, const copy_policy_t p=copy_reference)
 create copy of column of matrix M defined by r and col
 
 Vector (const Matrix< value_t > &M, const idx_t row, const Range &ar, const copy_policy_t p=copy_reference)
 create copy/reference to row of matrix M defined by r and row
 
Vectoroperator= (const Vector &v)
 copy operator (always copy reference! for data copy, use BLAS::copy!)
 
Vectoroperator= (Vector &&v)
 move operator (move ownership of data)
 
size_t length () const
 return length of vector
 
size_t stride () const
 return stride of index set
 
value_t operator() (const idx_t i) const
 return coefficient at position i
 
value_toperator() (const idx_t i)
 return reference to coefficient at position i
 
Vector operator() (const Range &r) const
 return reference to sub vector defined by r
 
value_tdata () const
 give access to internal data
 
- Public Member Functions inherited from MemBlock< T_value >
 MemBlock ()
 ctor with nullptr data and 0 references
 
 MemBlock (const size_t n)
 ctor for n elements of value_t and 0 references
 
 MemBlock (const MemBlock &b)
 copy ctor (copy reference!)
 
 MemBlock (MemBlock &&b)
 move ctor (move ownership)
 
 ~MemBlock ()
 dtor removing all data even if references exist !
 
MemBlockoperator= (const MemBlock &b)
 copy operator (copy reference!)
 
MemBlockoperator= (MemBlock &&b)
 move ctor (move ownership)
 
value_tdata ()
 return pointer to internal array
 
const value_tdata () const
 return const pointer to internal array
 

Detailed Description

template<typename T_value>
class HLIB::BLAS::Vector< T_value >

defines basic interface for vectors

Standard vector class in linear algebra routines. It holds a reference to a memory block, which is controlled by this vector, e.g. if the vector is gone or resized, the memory block is also gone.