Abstract base class for Hierarchically Semi-Separable (HSS) matrices. More...
#include <HSSMatrixBase.hpp>
Public Member Functions | |
HSSMatrixBase (std::size_t m, std::size_t n, bool active) | |
virtual | ~HSSMatrixBase ()=default |
HSSMatrixBase (const HSSMatrixBase< scalar_t > &other) | |
HSSMatrixBase< scalar_t > & | operator= (const HSSMatrixBase< scalar_t > &other) |
HSSMatrixBase (HSSMatrixBase &&h)=default | |
HSSMatrixBase & | operator= (HSSMatrixBase &&h)=default |
virtual std::unique_ptr< HSSMatrixBase< scalar_t > > | clone () const =0 |
std::pair< std::size_t, std::size_t > | dims () const |
std::size_t | rows () const override |
std::size_t | cols () const override |
bool | leaf () const |
virtual std::size_t | factor_nonzeros () const |
const HSSMatrixBase< scalar_t > & | child (int c) const |
HSSMatrixBase< scalar_t > & | child (int c) |
bool | is_compressed () const |
bool | is_untouched () const |
bool | active () const |
virtual std::size_t | levels () const =0 |
virtual void | print_info (std::ostream &out=std::cout, std::size_t roff=0, std::size_t coff=0) const =0 |
void | set_openmp_task_depth (int depth) |
virtual void | shift (scalar_t sigma) override=0 |
virtual void | draw (std::ostream &of, std::size_t rlo, std::size_t clo) const |
virtual void | forward_solve (WorkSolveMPI< scalar_t > &w, const DistM_t &b, bool partial) const |
virtual void | backward_solve (WorkSolveMPI< scalar_t > &w, DistM_t &x) const |
virtual const BLACSGrid * | grid () const |
virtual const BLACSGrid * | grid (const BLACSGrid *local_grid) const |
virtual const BLACSGrid * | grid_local () const |
virtual int | Ptotal () const |
virtual int | Pactive () const |
virtual void | to_block_row (const DistM_t &A, DenseM_t &sub_A, DistM_t &leaf_A) const |
virtual void | allocate_block_row (int d, DenseM_t &sub_A, DistM_t &leaf_A) const |
virtual void | from_block_row (DistM_t &A, const DenseM_t &sub_A, const DistM_t &leaf_A, const BLACSGrid *lg) const |
![]() | |
virtual | ~StructuredMatrix ()=default |
virtual std::size_t | memory () const =0 |
virtual std::size_t | nonzeros () const =0 |
virtual std::size_t | rank () const =0 |
virtual std::size_t | local_rows () const |
virtual std::size_t | begin_row () const |
virtual std::size_t | end_row () const |
virtual const std::vector< int > & | dist () const |
virtual const std::vector< int > & | rdist () const |
virtual const std::vector< int > & | cdist () const |
virtual void | mult (Trans op, const DenseMatrix< scalar_t > &x, DenseMatrix< scalar_t > &y) const |
void | mult (Trans op, int m, const scalar_t *x, int ldx, scalar_t *y, int ldy) const |
virtual void | mult (Trans op, const DistributedMatrix< scalar_t > &x, DistributedMatrix< scalar_t > &y) const |
virtual void | factor () |
virtual void | solve (DenseMatrix< scalar_t > &b) const |
virtual void | solve (int nrhs, scalar_t *b, int ldb) const |
virtual void | solve (DistributedMatrix< scalar_t > &b) const |
Friends | |
class | HSSMatrix< scalar_t > |
class | HSSMatrixMPI< scalar_t > |
Abstract base class for Hierarchically Semi-Separable (HSS) matrices.
This is for non-symmetric HSS matrices, but can be used with symmetric matrices as well.
scalar_t | Can be float, double, std:complex<float> or std::complex<double>. |
strumpack::HSS::HSSMatrixBase< scalar_t >::HSSMatrixBase | ( | std::size_t | m, |
std::size_t | n, | ||
bool | active | ||
) |
Construct an m x n HSS matrix, not initialized.
m | number of rows |
n | number of columns |
active | Denote if this matrix (node) is active on this process. |
|
virtualdefault |
Default virtual destructor.
strumpack::HSS::HSSMatrixBase< scalar_t >::HSSMatrixBase | ( | const HSSMatrixBase< scalar_t > & | other | ) |
Copy constructor.
other | HSS matrix to copy. |
|
default |
Move constructor.
h | HSS matrix to move from, h will be emptied. |
|
inline |
|
inline |
Return a reference to the child (0, or 1) of this HSS matrix. This is only valid when !this->leaf(). It is assumed that a non-leaf node always has exactly 2 children.
c | Number of the child, should be 0 or 1, for the left or the right child. |
|
inline |
Return a const reference to the child (0, or 1) of this HSS matrix. This is only valid when !this->leaf(). It is assumed that a non-leaf node always has exactly 2 children.
c | Number of the child, should be 0 or 1, for the left or the right child. |
|
pure virtual |
Clone this HSS matrix. TODO delete this??
Implemented in strumpack::HSS::HSSMatrixMPI< scalar_t >, and strumpack::HSS::HSSMatrix< scalar_t >.
|
inlineoverridevirtual |
Return the number of columns in this HSS matrix.
Implements strumpack::structured::StructuredMatrix< scalar_t >.
|
inline |
|
inlinevirtual |
Internal routine to draw this HSS matrix. Do not use this directly. Use HSS::draw.
Reimplemented in strumpack::HSS::HSSMatrix< scalar_t >.
|
inline |
Check whether the HSS matrix was compressed.
|
inline |
Check whether the HSS compression was started for this matrix.
|
inline |
Check whether this node of the HSS tree is a leaf.
|
pure virtual |
Return the number of levels in the HSS matrix.
Implemented in strumpack::HSS::HSSMatrixMPI< scalar_t >, and strumpack::HSS::HSSMatrix< scalar_t >.
HSSMatrixBase<scalar_t>& strumpack::HSS::HSSMatrixBase< scalar_t >::operator= | ( | const HSSMatrixBase< scalar_t > & | other | ) |
|
default |
|
pure virtual |
Print info about this HSS matrix, such as tree info, ranks, etc.
out | Stream to print to, defaults to std::cout |
roff | Row offset of top left corner, defaults to 0. This is used to recursively print the tree, you can leave this at the default. |
coff | Column offset of top left corner, defaults to 0. This is used to recursively print the tree, you can leave this at the default. |
Implemented in strumpack::HSS::HSSMatrixMPI< scalar_t >, and strumpack::HSS::HSSMatrix< scalar_t >.
|
inlineoverridevirtual |
Return the number of rows in this HSS matrix.
Implements strumpack::structured::StructuredMatrix< scalar_t >.
|
inline |
Set the depth of openmp nested tasks. This can be used to limit the number of tasks to spawn in the HSS routines, which is can reduce task creation overhead. This is used in the sparse solver when multiple HSS matrices are created from within multiple openmp tasks. The HSS routines all use openmp tasking to traverse the HSS tree and for parallelism within the HSS nodes as well.
|
overridepure virtual |
Apply a shift to the diagonal of this matrix. Ie, this += sigma * I, with I the identity matrix. Call this after compression.
sigma | Shift to be applied to the diagonal. |
Reimplemented from strumpack::structured::StructuredMatrix< scalar_t >.
Implemented in strumpack::HSS::HSSMatrixMPI< scalar_t >, and strumpack::HSS::HSSMatrix< scalar_t >.