HLIBpro  2.0
Public Member Functions | Friends | List of all members
Vector< value_t > Class Template Reference

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

#include <Vector.hh>

Inheritance diagram for Vector< value_t >:
MemBlockRef< value_t >

Public Member Functions

 Vector ()
 create zero sized vector
 
 Vector (const size_t n)
 create vector of size n and stride 1
 
 Vector (const Vector &v)
 copy operator (copy reference)
 
 Vector (const MemBlockRef< value_t > &ref, const Range &r)
 create vector based on memory block ref and range r
 
 Vector (const Vector< value_t > &v, const Range &r, const copy_policy_t p=copy_reference)
 create copy/reference to sub vector of v defined by r
 
 Vector (const Matrix< value_t > &M, const Range &r, const idx_t col, const copy_policy_t p=copy_reference)
 create copy/reference to column of matrix M defined by r and col
 
 Vector (const Matrix< value_t > &M, const idx_t row, const Range &r, 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 for vectors
 
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_t & operator() (const idx_t i)
 return reference to coefficient at position i
 
value_t entry (const idx_t i) const
 explicitly return coefficient and no reference at position i
 
Vector operator() (const Range &r) const
 return reference to sub vector defined by r
 
value_t * data () const
 give access to internal data
 
- Public Member Functions inherited from MemBlockRef< value_t >
 MemBlockRef ()
 ctor for zero sized block but reference to NULL block
 
 MemBlockRef (const MemBlockRef< value_t > &ref)
 ctor: store memory block ref and add a reference
 
 MemBlockRef (const size_t n)
 ctor: create memory block of size n and one reference
 
 ~MemBlockRef ()
 dtor: delete reference, but not necessarily the data
 
void set_block (MemBlock< value_t > *b=&_null_block)
 set internal memory block to b (default = NULL)
 
void set_block (const MemBlockRef< value_t > &ref)
 

Friends

std::ostream & operator<< (std::ostream &os, const Vector &v)
 stream output
 

Additional Inherited Members

- Protected Attributes inherited from MemBlockRef< value_t >
value_t * _data