Class xlifepp::HMatrix#

template<typename T, typename I>
class HMatrix#

describes a matrix represented by a hierarchical structure (tree), each node being a block matrix a leaf is either a standard matrix or an approximate matrix

Public Functions

HMatrix(ClusterTree<I>&, ClusterTree<I>&, number_t, number_t, number_t = 0, const string_t& = "", SymType = _noSymmetry, HMatrixMethod = _standardHM, HMAdmissibilityRule = _boxesRule, real_t = 1)#

main constructor

HMatrix(const HMatrix<T, I>&)#

copy constructor

void addFELargeMatrix(const LargeMatrix<T>&)#

add FE LargeMatrix to current HMatrix

number_t averageRank() const#

average rank of admissible leaves

std::pair<number_t, number_t> averageSize() const#

average size of leaves

void buildTree()#

build the tree

inline HMatrixNode<T, I> *child(number_t d = 1)#

access to child at depth d

void clear()#

clear all and deallocate matrix pointers

inline void clearMatrices()#

clear matrices

inline const ClusterTree<I> *colTree() const#

access to col cluster tree pointer

void copy(const HMatrix<T, I>&)#

copy all (full copy), do not clear

dimPair dimValues() const#

return dimensions of values, (1,1) when scalar

std::list<HMatrixNode<T, I>*> getLeaves(AccessType, number_t, number_t&, bool = true) const#

get all leaves ordered by row/col to avoid data races

std::list<HMatrixNode<T, I>*> getLeaves(bool = true) const#

get all leaves

void initCounter(number_t n = 0)#

initialize internal counter of HMatrixNode<T,I> for counting some operations

void load(const LargeMatrix<T>&, HMApproximationMethod = _noHMApproximation)#

load Hmatrix<T> from LargeMatrix<T>

void lu()#

LU Factorization.

std::vector<T> &multMatrixVector(const std::vector<T>&, std::vector<T>&) const#

matrix vector product (recursive)

Hmatrix * Vector.

std::vector<T> &multMatrixVectorOmp(const std::vector<T>&, std::vector<T>&) const#

matrix vector product (non recursive-omp)

inline number_t nbNonZero() const#

number of T coefficients used to represent the matrix

real_t norm2() const#

Frobenius norm.

real_t norminfty() const#

infinite norm

number_t numberOfCols() const#

return number of cols counted in T

number_t numberOfRows() const#

return number of rows counted in T

HMatrix<T, I> &operator=(const HMatrix<T, I>&)#

assign operator

void printStructure(std::ostream&, bool all = false, bool shift = false) const#

print matrix structure

inline HMatrixNode<T, I> *root()#

access to root node

inline const ClusterTree<I> *rowTree() const#

access to row cluster tree pointer

void saveStructureToFile(const string_t&) const#

save matrix structure to file

void setClusterCol(ClusterTree<I>*)#

change the col ClusterTree pointer

void setClusterRow(ClusterTree<I>*)#

change the row ClusterTree pointer

void stopCounter()#

stop internal counter of HMatrixNode<T,I>

LargeMatrix<T> toLargeMatrix(StorageType st = _dense, AccessType at = _row) const#

convert HMatrix to LargeMatrix

void updateInfo()#

update tree info (depth, number of nodes, …)

Public Members

HMAdmissibilityRule admRule_#

block admissible rule

number_t colmin_#

minimum size of block matrix -> not split if nbrow < rowmin and nbcol < colmin

number_t depth#

maximal depth (info)

real_t eta_#

ratio in the criteria diam(Br) < 2*eta*dist(Br,Bc) (default eta = 1)

FactorizationType factorization_#

one of _noFactorization, _lu, _ldlt, _ldlstar; default is _noFactorization

HMatrixMethod method_#

method to define admissible block

string_t name#

optional name, useful for documentation

number_t nbAdmissibles#

number of admissible blocks (info)

number_t nbAppMatrices#

number of approximate matrices (info)

number_t nbLeaves#

number of leaves (info)

number_t nbNodes#

number of nodes (info)

StrucType strucType_#

structure of values (scalar, vector, matrix)

SymType sym#

type of symmetry (if has symmetry, only lower part is stored)

ValueType valueType_#

type of values (real, complex)