HLIBpro
2.7
|
Represents low rank matrices as uniform matrix: \(M = V S W^H\), where \(V\) and \(W\) are cluster bases and \(S\) holds the corresponding coefficients.
#include <TUniformMatrix.hh>
Public Member Functions | |
TUniformMatrix () | |
default constructor | |
TUniformMatrix (const TBlockIndexSet &block_is, const TClusterBasis< real > *row_cb, const TClusterBasis< real > *col_cb, const BLAS::Matrix< real > &S) | |
TUniformMatrix (const TBlockIndexSet &block_is, const TClusterBasis< complex > *row_cb, const TClusterBasis< complex > *col_cb, const BLAS::Matrix< complex > &S) | |
TUniformMatrix (const TUniformMatrix &A) | |
copy constructor | |
~TUniformMatrix () | |
dtor | |
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 | |
size_t | row_rank () const |
return row rank of matrix | |
size_t | col_rank () const |
return column rank of matrix | |
const TClusterBasis< real > * | rrow_cb () const |
return row cluster basis | |
const TClusterBasis< real > * | rcol_cb () const |
return column cluster basis | |
const TClusterBasis< complex > * | crow_cb () const |
return row cluster basis | |
const TClusterBasis< complex > * | ccol_cb () const |
return column cluster basis | |
void | set_rank (const size_t row_rank, const size_t col_rank) |
void | assign_cb (const TClusterBasis< real > *row_cb, const TClusterBasis< real > *col_cb) |
real | entry (const idx_t i, const idx_t j) const |
return real valued coefficent (i, j) of matrix | |
const complex | centry (const idx_t i, const idx_t j) const |
return complex valued coefficent (i, j) of matrix | |
const BLAS::Matrix< real > & | rcoeff () const |
return basis coefficients | |
const BLAS::Matrix< complex > & | ccoeff () const |
return basis coefficients | |
virtual void | to_real () |
switch to real valued storage if possible, e.g. all imaginary components zero | |
virtual void | to_complex () |
switch to complex valued storage | |
virtual void | transpose () |
transpose matrix | |
virtual void | conjugate () |
conjugate matrix coefficients | |
virtual void | truncate (const TTruncAcc &acc) |
truncate matrix w.r.t. accuracy acc | |
virtual void | scale (const real f) |
scale matrix by constant factor | |
virtual void | mul_vec (const real alpha, const TVector *x, const real beta, TVector *y, const matop_t op=MATOP_NORM) const |
compute y ≔ α·M·x + β·y, where M is either this, this^T or this^H depending on op | |
virtual void | add (const real alpha, const TMatrix *A) |
compute this = this + α·A without truncation | |
virtual TMatrix * | mul_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 TMatrix * | mul_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) | |
virtual void | cscale (const complex f) |
scale matrix by constant factor | |
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 ≔ α·M·x + β·y, where M is either this, this^T or this^H depending on op | |
virtual void | cadd (const complex a, const TMatrix *matrix) |
compute this = this + α·A without truncation | |
virtual TMatrix * | cmul_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 TMatrix * | cmul_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) | |
virtual auto | create () const -> std::unique_ptr< TMatrix > |
return object of same type | |
virtual auto | copy () const -> std::unique_ptr< TMatrix > |
return copy of matrix | |
virtual auto | copy (const TTruncAcc &acc, const bool do_coarsen=false) const -> std::unique_ptr< TMatrix > |
return copy matrix wrt. given accuracy; if do_coarsen is set, perform coarsening | |
virtual auto | copy_struct () const -> std::unique_ptr< TMatrix > |
return structural copy of matrix | |
virtual void | copy_to (TMatrix *A) const |
copy matrix into matrix A | |
virtual void | copy_to (TMatrix *A, const TTruncAcc &acc, const bool do_coarsen=false) const |
copy matrix into matrix A with accuracy acc and optional coarsening | |
virtual size_t | byte_size () const |
return size in bytes used by this object | |
virtual void | read (TByteStream &s) |
read matrix from byte stream | |
virtual void | build (TByteStream &s) |
construct matrix from byte stream | |
virtual void | write (TByteStream &s) const |
write matrix into byte stream | |
virtual size_t | bs_size () const |
return size of object in a bytestream | |
Public Member Functions inherited from TMatrix | |
TMatrix (const value_type_t avalue_type=real_valued) | |
construct zero sized matrix | |
TMatrix (const TBlockCluster *bcl, const value_type_t avalue_type=real_valued) | |
construct matrix of size defined by block cluster bcl | |
TMatrix (const TBlockIndexSet &bis, const value_type_t avalue_type=real_valued) | |
construct matrix of size defined by block index set bis | |
TMatrix (const TMatrix &A) | |
copy constructor | |
virtual | ~TMatrix () |
dtor | |
int | id () const |
return ID | |
void | set_id (const int aid) |
set ID | |
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 void | set_form (const matform_t f) |
set matrix format | |
virtual bool | is_zero () const |
return true, if matrix is zero | |
virtual bool | is_blocked () const |
return true, if matrix is blocked | |
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 TProcSet & | procs () const |
return matrix processor set | |
uint | nprocs () const |
return number of processors in local set | |
virtual void | set_procs (const TProcSet &ps, const recursion_type_t rec_type=nonrecursive) |
set processor set of matrix | |
bool | is_distributed () const |
return true if matrix is distributed | |
virtual void | copy_struct_from (const TMatrix *M) |
value_type_t | value_type () const |
return value type of matrix | |
void | set_value_type (const value_type_t vt) |
set value type of matrix | |
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) |
TUpdateAccumulator & | accumulator () |
access accumulator object | |
void | add_update (const TMatrix *M, const TTruncAcc &acc) |
add update matrix | |
void | add_pending_direct (TDirectMatrixUpdate *U) |
add update U to set of recursive pending updates | |
void | add_pending_recursive (TRecursiveMatrixUpdate *U) |
add update U to set of recursive pending updates | |
virtual void | apply_updates (const TTruncAcc &acc, const recursion_type_t rec_type) |
virtual bool | has_updates (const recursion_type_t recursion) const |
return true, if matrix has updates not yet applied | |
virtual bool | has_parent_updates (const recursion_type_t recursion) const |
return true, if parent matrix has updates not yet applied | |
const TBlockCluster * | cluster () const |
return corresponding block cluster of matrix | |
virtual void | set_cluster (const TBlockCluster *c) |
set block cluster of matrix | |
virtual void | apply (const TVector *x, TVector *y, const matop_t op=apply_normal) const |
virtual void | apply_add (const real alpha, const TVector *x, TVector *y, const matop_t op=apply_normal) const |
virtual auto | domain_vector () const -> std::unique_ptr< TVector > |
return vector in domain space | |
virtual auto | range_vector () const -> std::unique_ptr< TVector > |
return vector in range space | |
virtual size_t | global_byte_size () const |
virtual void | copy_from (const TMatrix *A) |
copy data from matrix A | |
virtual auto | row_vector () const -> std::unique_ptr< TVector > |
return appropriate row vector object for matrix | |
virtual auto | col_vector () const -> std::unique_ptr< TVector > |
return appropriate column vector object for matrix | |
virtual void | sum (const TProcSet &p, const uint pid, const uint nparts, TByteStream *bs, const TTruncAcc &acc) |
virtual void | check_data () const |
test data for invalid values, e.g. INF and NAN | |
virtual void | print (const uint ofs=0) const |
print basic info about matrix to stdout | |
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 | |
TMutex & | mutex () |
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 | |
TUniformMatrix | ( | const TBlockIndexSet & | block_is, |
const TClusterBasis< real > * | row_cb, | ||
const TClusterBasis< real > * | col_cb, | ||
const BLAS::Matrix< real > & | S | ||
) |
construct uniform matrix over block_is with clusterbases row_cb and col_cb and coefficients stored in S
TUniformMatrix | ( | const TBlockIndexSet & | block_is, |
const TClusterBasis< complex > * | row_cb, | ||
const TClusterBasis< complex > * | col_cb, | ||
const BLAS::Matrix< complex > & | S | ||
) |
construct uniform matrix over block_is with clusterbases row_cb and col_cb and coefficients stored in S
void assign_cb | ( | const TClusterBasis< real > * | row_cb, |
const TClusterBasis< real > * | col_cb | ||
) |
assign cluster bases
void set_rank | ( | const size_t | row_rank, |
const size_t | col_rank | ||
) |
set ranks of matrix