H2Lib  3.0
Functions
hcoarsen

Coarsening of hierarchical matrices. More...

Functions

void coarsen_hmatrix (phmatrix G, ptruncmode tm, real eps, bool recursive)
 Coarsen the block structure of a hmatrix. More...
 

Detailed Description

Coarsening of hierarchical matrices.

Function Documentation

void coarsen_hmatrix ( phmatrix  G,
ptruncmode  tm,
real  eps,
bool  recursive 
)

Coarsen the block structure of a hmatrix.

For a hmatrix consisting only of admissible or inadmissible leafs it can be advantageous to store the hmatrix as a single low rank matrix with a slightly higher rank.

If we consider a 2x2 block matrix

\[ G = \begin{pmatrix} A_{1} B_{1}^* & A_{2} B_{2}^* \\ A_{3} B_{3}^* & A_{4} B_{4}^* \end{pmatrix} \]

with a low rank representation $ A_{i} B_{i}^*, i \in \{ 1,\ldots,4 \}$ with each having a rank of at most $ k $. (Inadmissible blocks can be written as low rank matrices with $ G_{i} = G_{i} I = A_{i} B_{i}^*$ or $ G_{i} = I G_{i} = A_{i} B_{i}^*$.)

We can rewrite this as a rank $ 4 k $ low rank matrix

\[ \widehat G = \begin{pmatrix} A_{1} & A_{2} \\ & & A_{3} & A_{4} \end{pmatrix} \begin{pmatrix} B_{1}^* & \\ & B_{2}^* \\ B_{3}^* & \\ & B_{4}^* \end{pmatrix} \]

Now an approximation of $ \widehat G$ via SVD using trunc_rkmatrix is computed:

\[ \widetilde G = \operatorname{trunc}(\widehat G) = \widetilde A \widetilde B^*\]

.

If the size of $ \widetilde G$ is smaller than the size of $ G $, then $ G $ will be replaced by $ \widetilde G $. Otherwise $ \widetilde G$ is rejected.

If recursive == true holds, this process is repeated for father blocks as long as they only consist of leaf blocks aswell.

Parameters
GInput hmatrix. Will be changed during the coarsening process.
tmTruncation mode.
epsAccuracy for low rank truncation.
recursiveFlag to indicate whether the coarsening algorithm should be applied to the son blocks aswell or not.