Class xlifepp::HMatrix#

template<typename T, typename I>
class HMatrix#

Inheritence diagram for xlifepp::HMatrix:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="xlifepp::HMatrix< complex_t, I >" tooltip="xlifepp::HMatrix< complex_t, I >"] "7" [label="xlifepp::HMatrix< complex_t, xlifepp::FeDof >" tooltip="xlifepp::HMatrix< complex_t, xlifepp::FeDof >"] "2" [label="xlifepp::HMatrix< real_t, I >" tooltip="xlifepp::HMatrix< real_t, I >"] "6" [label="xlifepp::HMatrix< real_t, xlifepp::FeDof >" tooltip="xlifepp::HMatrix< real_t, xlifepp::FeDof >"] "5" [label="xlifepp::HMatrix< xlifepp::Matrix< complex_t >, I >" tooltip="xlifepp::HMatrix< xlifepp::Matrix< complex_t >, I >"] "9" [label="xlifepp::HMatrix< xlifepp::Matrix< complex_t >, xlifepp::FeDof >" tooltip="xlifepp::HMatrix< xlifepp::Matrix< complex_t >, xlifepp::FeDof >"] "4" [label="xlifepp::HMatrix< xlifepp::Matrix< real_t >, I >" tooltip="xlifepp::HMatrix< xlifepp::Matrix< real_t >, I >"] "8" [label="xlifepp::HMatrix< xlifepp::Matrix< real_t >, xlifepp::FeDof >" tooltip="xlifepp::HMatrix< xlifepp::Matrix< real_t >, xlifepp::FeDof >"] "1" [label="xlifepp::HMatrix< T, I >" tooltip="xlifepp::HMatrix< T, I >" fillcolor="#BFBFBF"] "3" -> "1" [dir=forward tooltip="template-instance"] "7" -> "1" [dir=forward tooltip="template-instance"] "2" -> "1" [dir=forward tooltip="template-instance"] "6" -> "1" [dir=forward tooltip="template-instance"] "5" -> "1" [dir=forward tooltip="template-instance"] "9" -> "1" [dir=forward tooltip="template-instance"] "4" -> "1" [dir=forward tooltip="template-instance"] "8" -> "1" [dir=forward tooltip="template-instance"] }

Collaboration diagram for xlifepp::HMatrix:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "16" [label="xlifepp::ClusterNode< FeDof >" tooltip="xlifepp::ClusterNode< FeDof >"] "5" [label="xlifepp::ClusterNode< I >" tooltip="xlifepp::ClusterNode< I >"] "2" [label="xlifepp::ClusterTree< I >" tooltip="xlifepp::ClusterTree< I >"] "17" [label="std::list< xlifepp::ClusterNode< FeDof > * >" tooltip="std::list< xlifepp::ClusterNode< FeDof > * >"] "13" [label="std::list< xlifepp::ClusterNode< I > * >" tooltip="std::list< xlifepp::ClusterNode< I > * >"] "10" [label="std::list< xlifepp::ClusterNode< T > * >" tooltip="std::list< xlifepp::ClusterNode< T > * >"] "11" [label="std::list< T >" tooltip="std::list< T >"] "4" [label="std::vector< T >" tooltip="std::vector< T >"] "15" [label="std::vector< FeDof >" tooltip="std::vector< FeDof >"] "3" [label="std::vector< I >" tooltip="std::vector< I >"] "9" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "7" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "12" [label="std::vector< xlifepp::Element * >" tooltip="std::vector< xlifepp::Element * >"] "8" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox"] "6" [label="xlifepp::ClusterNode< T >" tooltip="xlifepp::ClusterNode< T >"] "14" [label="xlifepp::ClusterTree< T >" tooltip="xlifepp::ClusterTree< T >"] "1" [label="xlifepp::HMatrix< T, I >" tooltip="xlifepp::HMatrix< T, I >" fillcolor="#BFBFBF"] "16" -> "15" [dir=forward tooltip="usage"] "16" -> "6" [dir=forward tooltip="usage"] "16" -> "7" [dir=forward tooltip="usage"] "16" -> "8" [dir=forward tooltip="usage"] "16" -> "17" [dir=forward tooltip="usage"] "16" -> "12" [dir=forward tooltip="usage"] "16" -> "6" [dir=forward tooltip="template-instance"] "5" -> "3" [dir=forward tooltip="usage"] "5" -> "6" [dir=forward tooltip="usage"] "5" -> "7" [dir=forward tooltip="usage"] "5" -> "8" [dir=forward tooltip="usage"] "5" -> "13" [dir=forward tooltip="usage"] "5" -> "12" [dir=forward tooltip="usage"] "5" -> "6" [dir=forward tooltip="template-instance"] "2" -> "3" [dir=forward tooltip="usage"] "2" -> "5" [dir=forward tooltip="usage"] "2" -> "14" [dir=forward tooltip="template-instance"] "17" -> "11" [dir=forward tooltip="template-instance"] "13" -> "11" [dir=forward tooltip="template-instance"] "10" -> "11" [dir=forward tooltip="template-instance"] "15" -> "4" [dir=forward tooltip="template-instance"] "3" -> "4" [dir=forward tooltip="template-instance"] "9" -> "4" [dir=forward tooltip="template-instance"] "7" -> "4" [dir=forward tooltip="template-instance"] "12" -> "4" [dir=forward tooltip="template-instance"] "8" -> "9" [dir=forward tooltip="usage"] "6" -> "6" [dir=forward tooltip="usage"] "6" -> "7" [dir=forward tooltip="usage"] "6" -> "8" [dir=forward tooltip="usage"] "6" -> "10" [dir=forward tooltip="usage"] "6" -> "12" [dir=forward tooltip="usage"] "14" -> "15" [dir=forward tooltip="usage"] "14" -> "16" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="usage"] }

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)