HLIBpro  1.2
Public Member Functions | List of all members
TDenseMatrix Class Reference

Represent a dense matrix.

#include <TDenseMatrix.hh>

Inheritance diagram for TDenseMatrix:
TMatrix TLockable TTypeInfo

Public Member Functions

 TDenseMatrix ()
 construct zero sized matrix
 TDenseMatrix (const size_t n, const size_t m)
 construct matrix of size n × m
 TDenseMatrix (const TIndexSet &arow_is, const TIndexSet &acol_is, const bool acomplex=false)
 construct matrix with size defined by arow_is × acol_is
 TDenseMatrix (const TIndexSet &arow_is, const TIndexSet &acol_is, const BLAS::Matrix< real > &M)
 TDenseMatrix (const TIndexSet &arow_is, const TIndexSet &acol_is, const BLAS::Matrix< complex > &M)
 TDenseMatrix (const TDenseMatrix &mat)
 copy constructor
 TDenseMatrix (const TBlockCluster *bct)
 construct matrix with size defined by block cluster
virtual ~TDenseMatrix ()
 destructor
virtual size_t rows () const
 return number of rows
virtual size_t cols () const
 return number of columns
void set_size (const size_t n, const size_t m)
 set size of matrix to n × m
virtual void set_cluster (const TBlockCluster *c)
 set size as defined by block cluster c
real * matrix ()
 return pointer to internal data (real valued)
const real * matrix () const
 return constant pointer to internal data (real valued)
complex * cmatrix ()
 return pointer to internal data (complex valued)
const complex * cmatrix () const
 return constant pointer to internal data (complex valued)
BLAS::Matrix< real > & blas_rmat ()
 return real valued matrix
const BLAS::Matrix< real > & blas_rmat () const
 return constant real valued matrix
BLAS::Matrix< complex > & blas_cmat ()
 return complex valued matrix
const BLAS::Matrix< complex > & blas_cmat () const
 return constant complex valued matrix
const TVirtualVector row (const idx_t i) const
 return row i as vector object
const TVirtualVector column (const idx_t i) const
 return column i as vector object
const BLAS::Vector< real > blas_rrow (const idx_t i) const
 return row i as BLAS vector (real value)
const BLAS::Vector< real > blas_rcol (const idx_t i) const
 return column i as BLAS vector (real value)
const BLAS::Vector< complex > blas_crow (const idx_t i) const
 return row i as BLAS vector (complex value)
const BLAS::Vector< complex > blas_ccol (const idx_t i) const
 return column i as BLAS vector (complex value)
real * entry_ptr (const idx_t i, const idx_t j)
 return pointer to data starting at coefficient (i, j) (real valued)
complex * centry_ptr (const idx_t i, const idx_t j)
 return pointer to data starting at coefficient (i, j) (real valued)
virtual void to_real ()
 convert to real valued representation if possible
virtual void to_complex ()
 convert to complex valued representation if possible
real entry (const idx_t i, const idx_t j) const
 return coefficient (i, j) (real valued)
const complex centry (const idx_t i, const idx_t j) const
 return coefficient (i, j) (complex valued)
void set_entry (const idx_t i, const idx_t j, const real f)
 set coefficient (i, j) to f (real valued)
void set_centry (const idx_t i, const idx_t j, const complex f)
 set coefficient (i, j) to f (complex valued)
void add_entry (const idx_t i, const idx_t j, const real f)
 add f to coefficient (i, j) (real valued)
void add_centry (const idx_t i, const idx_t j, const complex f)
 add f to coefficient (i, j) (complex valued)
virtual void scale (const real f)
 compute this ≔ α·this
virtual void mul_vec (const real alpha, const TVector *x, const real beta, TVector *y, const matop_t op=MATOP_NORM) const
 compute y ≔ α·op(this)·x + β·y
virtual void add (const real alpha, const TMatrix *A)
 compute this = this + α·A without truncation
virtual TMatrixmul_right (const real alpha, const TMatrix *B, const matop_t op_A, const matop_t op_B) const
 compute matrix product α·op_A(this)·op_B(B)
virtual TMatrixmul_left (const real alpha, const TMatrix *A, const matop_t op_A, const matop_t op_B) const
 compute matrix product α·op_A(A)·op_B(this)
void add_block (const real alpha, const real beta, const TDenseMatrix *M, const matop_t op=MATOP_NORM)
 compute α·this + β·op(M), where op(M) is subblock of this or this a subblock of op(M))
virtual void cscale (const complex f)
 compute this ≔ α·this
virtual void cmul_vec (const complex alpha, const TVector *x, const complex beta, TVector *y, const matop_t op_A=MATOP_NORM) const
 compute y ≔ α·op(this)·x + β·y
virtual void cadd (const complex alpha, const TMatrix *A)
 compute this = this + α·A without truncation
virtual TMatrixcmul_right (const complex alpha, const TMatrix *B, const matop_t op_A, const matop_t op_B) const
 compute matrix product α·op_A(this)·op_B(B)
virtual TMatrixcmul_left (const complex alpha, const TMatrix *A, const matop_t op_A, const matop_t op_B) const
 compute matrix product α·op_A(A)·op_B(this)
void cadd_block (const complex alpha, const complex beta, const TDenseMatrix *M, const matop_t op=MATOP_NORM)
 compute α·this + β·op(M), where op(M) is subblock of this or this a subblock of op(M))
virtual void transpose ()
 transpose matrix
virtual void conjugate ()
 conjugate matrix coefficients
virtual void truncate (const TTruncAcc &)
 truncate matrix to given accuracy: nothing to be done
TDenseMatrixoperator= (const TDenseMatrix &mat)
 copy operator
virtual TMatrixcreate () const
 return matrix object of same class as this
virtual TMatrixcopy () const
 return copy of matrix
virtual void copy_to (TMatrix *A) const
 copy matrix into A
void permute (const TPermutation &row_perm, const TPermutation &col_perm)
 permute rows/columns in matrix according to row_pern and col_perm
virtual void print (const uint ofs=0) const
 print information about matrix
virtual size_t byte_size () const
 return size in bytes used by this object
virtual typeid_t type () const
 return type of object
virtual bool is_type (const typeid_t t) const
 return true if object is of type t
virtual void read (TByteStream &s)
 read matrix from byte stream
virtual void build (TByteStream &s)
 construct matrix based on data in byte stream
virtual void write (TByteStream &s) const
 write matrix to byte stream
virtual size_t bs_size () const
 returns size of object in bytestream
virtual void check_data () const
 test data for invalid values, e.g. INF and NAN
- Public Member Functions inherited from TMatrix
 TMatrix (const bool acomplex=false)
 construct zero sized matrix
 TMatrix (const TBlockCluster *c)
 construct matrix of size defined by block cluster c
 TMatrix (const TBlockIndexSet &bis)
 construct matrix of size defined by block cluster c
 TMatrix (const TMatrix &A)
 copy constructor
virtual ~TMatrix ()
 dtor
TIndexSet row_is () const
 return row index set
TIndexSet col_is () const
 return column index set
TBlockIndexSet block_is () const
 return block index set
virtual idx_t row_ofs () const
 return first index (number) in row
virtual idx_t col_ofs () const
 return first index (number) in column
virtual void set_ofs (const idx_t r, const idx_t c)
 set index set offsets
virtual void set_block_is (const TBlockIndexSet &is)
 set block index set of matrix
bool is_nonsym () const
 return true if matrix is unsymmetric
bool is_symmetric () const
 return true if matrix is symmetric
bool is_hermitian () const
 return true if matrix is hermitian
matform_t form () const
 return matrix format
void set_nonsym ()
 set matrix to be unsymmetric
void set_symmetric ()
 set matrix to be symmetric
void set_hermitian ()
 set matrix to be hermitian
virtual void set_form (const matform_t f)
 set matrix format
const TProcSetprocs () const
 return matrix processor set
uint nprocs () const
 return number of processors in local set
void set_procs (const TProcSet &ps)
 set processor set of matrix
virtual void copy_struct (const TMatrix *M)
bool is_real () const
 return true if matrix is real valued
bool is_complex () const
 return true if matrix is complex valued
void set_complex (const bool b, const bool force=false)
const TBlockClustercluster () const
 return corresponding block cluster of matrix
virtual size_t global_byte_size () const
virtual TMatrixcopy (const TTruncAcc &acc, const bool coarsen=false) const
 return copy of matrix with accuracy acc and optional coarsening
virtual void copy_to (TMatrix *A, const TTruncAcc &acc, const bool coarsen=false) const
 copy matrix into matrix A with accuracy acc and optional coarsening
virtual TVectorrow_vector () const
 return appropriate row vector object for matrix
virtual TVectorcol_vector () const
 return appropriate column vector object for matrix
virtual void sum (const TProcSet &p, const uint pid, const uint nparts, TByteStream *bs, const TTruncAcc &acc)
- Public Member Functions inherited from TLockable
TMutexmutex ()
 give access to internal mutex
void lock ()
 lock local mutex of matrix
void unlock ()
 unlock local mutex of matrix
- Public Member Functions inherited from TTypeInfo
virtual String typestr () const
 return string representation of type

Constructor & Destructor Documentation

TDenseMatrix ( const TIndexSet arow_is,
const TIndexSet acol_is,
const BLAS::Matrix< real > &  M 
)
inline

construct matrix with size defined by arow_is × acol_is and data given by M (real valued)

TDenseMatrix ( const TIndexSet arow_is,
const TIndexSet acol_is,
const BLAS::Matrix< complex > &  M 
)
inline

construct matrix with size defined by arow_is × acol_is and data given by M (real valued)