HLIBpro 3.1
Loading...
Searching...
No Matches
THMatrix< T_value > Class Template Reference

Class for an H-matrix, which extends block matrices with additional functionality, e.g. permutations.

#include <THMatrix.hh>

Inheritance diagram for THMatrix< T_value >:
TBlockMatrix< T_value > TMatrix< T_value > TLinearOperator< T_value > TLockable TTypeInfo

Public Member Functions

virtual value_t entry (const idx_t i, const idx_t j) const
 return matrix coefficient (i, j)
 
virtual void mul_vec (const value_t alpha, const TVector< value_t > *x, const value_t beta, TVector< value_t > *y, const matop_t op=MATOP_NORM) const
 compute y ≔ β·y + α·op(M)·x, with M = this
 
virtual void transpose ()
 transpose matrix
 
virtual auto create () const -> std::unique_ptr< TMatrix< value_t > >
 return matrix of same class (but no content)
 
virtual auto copy () const -> std::unique_ptr< TMatrix< value_t > >
 return copy of matrix
 
virtual auto copy (const TTruncAcc &acc, const bool coarsen=false) const -> std::unique_ptr< TMatrix< value_t > >
 copy matrix wrt. accuracy acc and optional coarsening
 
virtual auto copy_struct () const -> std::unique_ptr< TMatrix< value_t > >
 return structural copy of matrix
 
virtual void copy_to (TMatrix< value_t > *A) const
 copy matrix into A
 
virtual void copy_to (TMatrix< value_t > *A, const TTruncAcc &acc, const bool coarsen=false) const
 copy matrix into A with accuracy acc and optional coarsening
 
virtual void copy_struct_from (const TMatrix< value_t > *M)
 copy complete structural information from given matrix
 
template<typename T_value_M >
void copy_struct_from_all (const THMatrix< T_value_M > *M)
 copy complete structural information from given matrix with different type
 
virtual auto row_vector () const -> std::unique_ptr< TVector< value_t > >
 return appropriate row vector object for matrix
 
virtual auto col_vector () const -> std::unique_ptr< TVector< value_t > >
 return appropriate column vector object for matrix
 
virtual size_t byte_size () const
 return size in bytes used by this object
 
virtual void read (TByteStream &s)
 read data from stream s and copy to matrix
 
virtual void build (TByteStream &s)
 use data from stream s to build matrix
 
virtual void write (TByteStream &s) const
 write data to stream s
 
virtual size_t bs_size () const
 returns size of object in bytestream
 
- Public Member Functions inherited from TBlockMatrix< T_value >
 TBlockMatrix (const TBlockCluster *bct=nullptr)
 construct block matrix with size and block structure defined by bct
 
 TBlockMatrix (const TIndexSet &row_is, const TIndexSet &col_is)
 construct block matrix with over block index set row_is × col_is
 
 TBlockMatrix (const TBlockIndexSet &bis)
 construct block matrix with over block index set bis
 
virtual ~TBlockMatrix ()
 dtor
 
virtual void set_cluster (const TBlockCluster *c)
 set cluster of matrix
 
virtual size_t rows () const
 return number of rows
 
virtual size_t cols () const
 return number of columns
 
void set_size (const size_t r, const size_t c)
 set size of matrix
 
uint block_rows () const
 return number of block-rows
 
uint block_cols () const
 return number of block-columns
 
uint no_of_blocks () const
 return number of sub blocks of matrix
 
void set_block_struct (const uint n, const uint m)
 set block structure
 
virtual void set_form (const matform_t f)
 set matrix format
 
virtual void set_form (const matform_t f, const recursion_type_t rec_type)
 set matrix format
 
TMatrix< value_t > * block (const uint i, const uint j)
 return block at block index (i, j)
 
const TMatrix< value_t > * block (const uint i, const uint j) const
 return block at block index (i, j)
 
TMatrix< value_t > * block (const uint i, const uint j, const matop_t op)
 return block at block index (i, j)
 
const TMatrix< value_t > * block (const uint i, const uint j, const matop_t op) const
 return block at block index (i, j)
 
void set_block (const uint i, const uint j, TMatrix< value_t > *A)
 set matrix block at block index (i,j) to matrix A
 
void replace_block (TMatrix< value_t > *A, TMatrix< value_t > *B)
 replace matrix block A by matrix B (don't delete A !)
 
void delete_block (const uint i, const uint j)
 delete block (i,j)
 
TMatrix< value_t > * bc_block (const TBlockCluster *t) const
 return subblock of matrix corresponding to block cluster t
 
TMatrix< value_t > * bc_block (const TCluster *tau, const TCluster *sigma) const
 return subblock of matrix corresponding to block cluster (tau, sigma)
 
void clear_blocks ()
 clear pointers to all sub blocks
 
virtual bool is_blocked () const
 return true, if matrix is blocked
 
virtual void set_procs (const TProcSet &ps, const recursion_type_t rec_type=nonrecursive)
 set processor set of matrix
 
virtual void apply_updates (const TTruncAcc &acc, const recursion_type_t recursion)
 
virtual bool has_updates (const recursion_type_t recursion) const
 return true, if matrix has updates not yet applied
 
virtual void conjugate ()
 conjugate matrix coefficients
 
virtual void scale (const value_t alpha)
 compute this ≔ α·this
 
virtual void add (const value_t alpha, const TMatrix< value_t > *matrix)
 compute this ≔ this + α · matrix
 
virtual void apply_add (const value_t alpha, const BLAS::Vector< value_t > &x, BLAS::Vector< value_t > &y, const matop_t op=apply_normal) const
 
template<typename T_list >
void collect_leaves (T_list &leaf_list) const
 collect matrix blocks corresponding to leaves in list leaf_list
 
virtual void truncate (const TTruncAcc &acc)
 truncate all rank-blocks in matrix to accuracy acc
 
virtual void print (const uint ofs=0) const
 print matrix to stdout
 
template<typename T_value_M >
void copy_struct_from_all (const TBlockMatrix< T_value_M > *M)
 copy complete structural information from given matrix with different type
 
virtual void check_data () const
 test data for invalid values, e.g. INF and NAN
 
- Public Member Functions inherited from TMatrix< T_value >
 TMatrix ()
 construct zero sized matrix
 
 TMatrix (const TBlockCluster *bcl)
 construct matrix of size defined by block cluster bcl
 
 TMatrix (const TBlockIndexSet &bis)
 construct matrix of size defined by block index set bis
 
 TMatrix (const TMatrix< value_t > &A)
 copy constructor
 
virtual ~TMatrix ()
 dtor
 
int id () const
 return ID
 
void set_id (const int aid)
 set ID
 
virtual size_t nrows (const matop_t op) const
 return number of rows of op(M)
 
virtual size_t ncols (const matop_t op) const
 return number of columns of op(M)
 
TIndexSet row_is () const
 return row index set
 
TIndexSet col_is () const
 return column index set
 
TBlockIndexSet block_is () const
 return block index set
 
TIndexSet row_is (const matop_t op) const
 return row index set w.r.t. given matrix operation
 
TIndexSet col_is (const matop_t op) const
 return row index set w.r.t. given matrix operation
 
TBlockIndexSet block_is (const matop_t op) const
 return row index set w.r.t. given matrix operation
 
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 bool is_zero () const
 return true, if matrix is zero
 
virtual bool is_dense () const
 return true, if matrix is dense
 
virtual bool is_self_adjoint () const
 return true, if operator is self adjoint
 
const TProcSetprocs () const
 return matrix processor set
 
uint nprocs () const
 return number of processors in local set
 
bool is_distributed () const
 return true if matrix is distributed
 
template<typename T_value_M >
void copy_struct_from_all (const TMatrix< T_value_M > *M)
 
TUpdateAccumulator< value_t > & accumulator ()
 access accumulator object
 
void add_update (const TMatrix< value_t > *M, const TTruncAcc &acc)
 add update matrix
 
void add_pending_direct (TDirectMatrixUpdate< value_t > *U)
 add update U to set of recursive pending updates
 
void add_pending_recursive (TRecursiveMatrixUpdate< value_t > *U)
 add update U to set of recursive pending updates
 
virtual bool has_parent_updates (const recursion_type_t recursion) const
 return true, if parent matrix has updates not yet applied
 
const TBlockClustercluster () const
 return corresponding block cluster of matrix
 
virtual void set_cluster_force (const TBlockCluster *c)
 set block cluster of matrix (with forced setting of cluster variable)
 
virtual void apply (const TVector< value_t > *x, TVector< value_t > *y, const matop_t op=apply_normal) const
 
virtual void apply_add (const value_t alpha, const TVector< value_t > *x, TVector< value_t > *y, const matop_t op=apply_normal) const
 
virtual size_t domain_dim () const
 return dimension of domain
 
virtual size_t range_dim () const
 return dimension of range
 
virtual auto domain_vector () const -> std::unique_ptr< TVector< value_t > >
 return vector in domain space
 
virtual auto range_vector () const -> std::unique_ptr< TVector< value_t > >
 return vector in range space
 
virtual TMatrix< value_t > * mul_right (const value_t alpha, const TMatrix< value_t > *B, const matop_t op_A, const matop_t op_B) const
 compute α·op(A)·op(B), with A = this
 
virtual TMatrix< value_t > * mul_left (const value_t alpha, const TMatrix< value_t > *A, const matop_t op_A, const matop_t op_B) const
 compute α·op(A)·op(B), with B = this
 
virtual size_t global_byte_size () const
 
virtual void copy_from (const TMatrix< value_t > *A)
 copy data from matrix A
 
virtual void sum (const TProcSet &p, const uint pid, const uint nparts, TByteStream *bs, const TTruncAcc &acc)
 
- Public Member Functions inherited from TLinearOperator< T_value >
virtual bool is_complex () const
 return true, if field type is complex valued
 
virtual bool is_real () const
 return true, if field type is real valued
 
- Public Member Functions inherited from TTypeInfo
virtual typeid_t type () const =0
 return type ID of object
 
virtual bool is_type (const typeid_t t) const
 return true if local object is of given type ID t
 
virtual std::string typestr () const
 return string representation of type
 
- Public Member Functions inherited from TLockable
TMutexmutex ()
 give access to internal mutex
 
void lock ()
 lock local mutex
 
void unlock ()
 unlock local mutex
 
size_t byte_size () const
 return size in bytes used by this object