HLIBpro  1.2
Public Types | Public Member Functions | Friends | List of all members
Matrix< T_value > Class Template Reference

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

#include <Matrix.hh>

Inheritance diagram for Matrix< T_value >:
MatrixBase< Matrix< T_value > > MemBlockRef< T_value >

Public Types

typedef T_value value_t
 internal value type
typedef MemBlockRef< value_tsuper_t
 super class type

Public Member Functions

 Matrix ()
 creates zero sized matrix
 Matrix (const size_t anrows, const size_t ancols)
 creates matrix of size anrows × ancols
 Matrix (const Matrix &M)
 copy operator (copy reference)
 Matrix (const Matrix &M, const Range &r1, const Range &r2, const copy_policy_t p=copy_reference)
Matrixoperator= (const Matrix &M)
 copy operator for matrices: data is not copied but referenced!
size_t nrows () const
 return number of rows of matrix
size_t ncols () const
 return number of columns of matrix
blasview_t blas_view () const
 return BLAS matrix view of matrix object
size_t blas_nrows () const
 return number of rows of actual BLAS matrix
size_t blas_ncols () const
 return number of columns of actual BLAS matrix
value_t operator() (const idx_t i, const idx_t j) const
 return coefficient (i,j)
value_toperator() (const idx_t i, const idx_t j)
 return reference to coefficient (i,j)
value_tdata () const
 return pointer to internal data
size_t row_stride () const
 return stride w.r.t. row index set
size_t col_stride () const
 return stride w.r.t. column index set
void resize (const size_t n, const size_t m)
 optimised resize: only change if (n,m) != (nrows,ncols)
Matrix< value_toperator() (const Range &r1, const Range &r2) const
 return matrix referencing sub matrix defined by r1 × r2
Vector< value_toperator() (const Range &r, const idx_t j) const
 return vector referencing part of column j defined by r
Vector< value_toperator() (const idx_t i, const Range &r) const
 return vector referencing part of row i defined by r
Vector< value_tcolumn (const idx_t j) const
 return vector referencing column j
Vector< value_trow (const idx_t i) const
 return vector referencing row i
void check_data () const
 test data for invalid values, e.g. INF and NAN
- Public Member Functions inherited from MemBlockRef< T_value >
 MemBlockRef ()
 ctor for zero sized block but reference to NULL block
 MemBlockRef (const MemBlockRef< T_value > &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< T_value > *b=&_null_block)
 set internal memory block to b (default = NULL)
void set_block (const MemBlockRef< T_value > &ref)

Friends

class Vector< value_t >
 allow direct access for vectors
template<typename T >
std::ostream & operator<< (std::ostream &os, const Matrix< T > &M)
 stream output for matrices

Additional Inherited Members

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

Constructor & Destructor Documentation

Matrix ( const Matrix< T_value > &  M,
const Range r1,
const Range r2,
const copy_policy_t  p = copy_reference 
)
inline

creates matrix using part of M defined by r1 × r2 p defines whether data is copied or referenced