Class xlifepp::HMatrixNode#
-
template<typename T, typename I>
class HMatrixNode#
-
Inheritence diagram for xlifepp::HMatrixNode:
Collaboration diagram for xlifepp::HMatrixNode:
describes a node of hierarchical representation of matrix
Public Functions
-
inline HMatrixNode()#
-
default constructor
-
inline HMatrixNode(ApproximateMatrix<T> *am, HMatrixNode<T, I> *pa, number_t d)#
-
ApproximateMatrix leaf constructor.
-
HMatrixNode(const HMatrixNode<T, I>&)#
-
copy constructor (full copy except ClusterNode pointers)
-
inline HMatrixNode(HMatrixNode<T, I> *pa, HMatrixNode<T, I> *ch, HMatrixNode<T, I> *ne, number_t d, ClusterNode<I> *rcn, ClusterNode<I> *ccn, number_t rs, number_t cs, LargeMatrix<T> *m, ApproximateMatrix<T> *am)#
-
full constructor
-
inline HMatrixNode(HMatrixNode<T, I> *pa, number_t d)#
-
node constructor
-
inline HMatrixNode(LargeMatrix<T> *m, HMatrixNode<T, I> *pa, number_t d)#
-
LargeMatrix leaf constructor.
-
HMatrixNode<T, I> *child(number_t d = 1)#
-
access to child at depth d
-
std::vector<HMatrixNode<T, I>*> childsMatrix(number_t&, number_t&) const#
-
all child pointers as a matrix of HMatrixNode pointers, row access storage
-
void clear()#
-
clear all except ClusterNode pointers
-
void clearMatrices()#
-
clear (deallocate) only matrices
-
void copy(const HMatrixNode<T, I>&)#
-
copy all (full copy), do not clear
-
void divide(number_t rmin, number_t cmin, number_t maxdepth = 0, HMAdmissibilityRule admRule = _boxesRule, bool sym = false)#
-
split node according to a splitting rule
-
void getLeaves(std::list<HMatrixNode<T, I>*>&, bool = true) const#
-
get leaves as a list
-
void lowerLeftSolve(HMatrixNode<T, I> &B) const#
-
solve X*L=B, L the lower triangular part of current part
solve X*L = B where L is the lower triangular part of the current node, assuming it is factorized as LU in B: right hand side node out B: solution node same as Lt*X = Bt (upper algorithm)
-
void lowerSolve(HMatrixNode<T, I> &B) const#
-
solve L*X=B, L the lower triangular part of current part
solve L*X = B where L is the lower triangular part of the current node, assuming it is factorized as LU in B: right hand side node out B: solution node
-
void lu()#
-
LU factorization.
perform LU factorization of the current Hmatrix node as follows if the node is a LargeMatrix leaf perform LU standard LU factorization if the node is an ApproximateMatrix leaf perform LU factorization on the decompressed matrix, leading to a LU LargeMatrix (should not be handled!) | A11 A12 … A1n| if the node is the block HMatrix, say H= | A21 A22 … A2n|, row access HMatrix | … … … …| | An1 An2 … Ann| perform the block LU factorization for k=1,n LU factorization of Akk for i = k+1,n upper solve Lik*Ukk=Aik for j = k+1,n lower solve Lkk*Ukj = Akj for i = k+1,n for j = k+1,n Aij-=Lik*Ukj
when bisection clustering is used, n=2, so the algorithm does k=1 : A11=L11*U11, L21*U11=A21 -> L21, L11*U12=A12 -> U12, A22-=L21*U12 k=2 : A22 = L22*U22
Note
at the end the node contains the virtual LU factorization
-
void multMatrixAdd(HMatrixNode<T, I>&, HMatrixNode<T, I>&, T c = T(1.))#
-
perform += c*A*B with a complex algorithm regarding the structure of current HMatrixNode and HMatrixNode A, B current, A and B nodes must be consistent, not checked here! indeed HMatrixNode’s may be a hierarchical node, an ApproximateMatrix (LowRankMatrix) or a dense LargeMatrix
current node is a hierarchical matrix . A or B is not a hierarchical matrix, create hierarchical representation of A or B (A.toHierarchical(…)) . A,B nodes are hierarchical matrix -> do a block product going down
current node is a LargeMatrix (dense) . if A and B are not hierarchical do the operation L+=c*LA*LB or L+=c*LA*ApB or L+=c*ApA*LB or L+=c*ApA*ApB . if A or B is a hierarchical matrix, move A and B to LargeMatrix and do L+=c*LA*LB
current node is an ApproximateMatrix (LowRankMatrix) . if A and B are LargeMatrix, move current to LargeMatrix and do operation, then return to ApproximateMatrix . if A or B is a ApproximateMatrix, compute A*B as an approximate matrix then combine +=c*Ab using ApproximateMatrix summation . if A or B is a Hierarchical matrix, move all matrices to hierarchical representation, then return to ApproximateMatrix
-
std::vector<T> &multMatrixVector(const std::vector<T>&, std::vector<T>&, SymType symt = _noSymmetry) const#
-
matrix vector product (recursive)
-
std::vector<T> &multMatrixVectorNode(const std::vector<T>&, std::vector<T>&, SymType symt = _noSymmetry) const#
-
matrix vector product for a leaf
-
real_t norm2() const#
-
Frobenius norm.
-
real_t norminfty() const#
-
infinite norm
-
HMatrixNode<T, I> &operator=(const HMatrixNode<T, I>&)#
-
assign operator (full copy except ClusterNode pointers)
-
void print(std::ostream&) const#
-
print tree from current node
-
void printNode(std::ostream&, bool = true) const#
-
print current node contents
-
void printStructure(std::ostream&, number_t, number_t, bool all = false, bool shift = false) const#
-
print matrix node structure
-
void setClusterCol(ClusterNode<I>*)#
-
update col cluster node pointers (recursive)
-
void setClusterRow(ClusterNode<I>*)#
-
update row cluster node pointers (recursive)
-
void toApproximateMatrix(MatrixApproximationType = _lowRankApproximation, number_t rank = 0, real_t eps = theTolerance)#
-
move to ApproximateMatrix
-
void toHierarchical(number_t depth = 1)#
-
move to hierarchical representation up to the given depth
move to hierarchical representation down to the given depth d go down to depth d, splitting any HMatrixNode that are either a Largematrix or an ApproximateMatrix if current node is a hierarchic matrix nothing is done if current node is a LargeMatrix, then split in LargeMatrix if current node is an ApproximateMatrix, then split in ApproximateMatrix
-
void toLargeMatrix(StorageType st = _dense, AccessType at = _row)#
-
move to LargeMatrix using the given storage
move to LargeMatrix representation
-
void upperLeftSolve(HMatrixNode<T, I> &B) const#
-
solve X*U=B, U the upper triangular part of current part
solve X*U = B where U is the upper triangular part of the current node, assuming it factorized as LU in B: right hand side node out B: solution node
-
void upperSolve(HMatrixNode<T, I> &B) const#
-
solve U*X=B, U the upper triangular part of current part
solve U*X = B where U is the upper triangular part of the current node, assuming it is factorized as LU in B: right hand side node out B: solution node
Public Members
-
bool admissible_#
-
block can be approximated
-
ApproximateMatrix<T> *appmat_#
-
pointer to an ApproximateMatrix
-
HMatrixNode<T, I> *child_#
-
pointer to its first child, if 0 no child
-
ClusterNode<I> *colNode_#
-
column cluster node to access to col numbering
-
FactorizationType factorization_#
-
one of _noFactorization, _lu, _ldlt, _ldlstar
-
bool isDiag_#
-
boolean flag telling if matrix node is located on the diagonal
-
LargeMatrix<T> *mat_#
-
pointer to a LargeMatrix
-
HMatrixNode<T, I> *next_#
-
pointer to its brother, if 0 no brother
-
HMatrixNode<T, I> *parent_#
-
pointer to its parent, if 0 root node
-
ClusterNode<I> *rowNode_#
-
row cluster node to access to row numbering
Public Static Functions
-
static inline void stopCounter()#
-
disable counter
-
inline HMatrixNode()#