H2Lib  3.0
Data Structures | Typedefs | Functions
h2compression

Functions for turning an amatrix, hmatrix or h2matrix into an h2matrix. More...

Data Structures

struct  _truncblock
 Description of basis and weights for one submatrix in the unification algorithm. More...
 

Typedefs

typedef struct _truncblock truncblock
 Cluster basis and weights for use in the unification algorithm.
 
typedef truncblockptruncblock
 Pointer to truncblock object.
 

Functions

ph2matrix compress_amatrix_h2matrix (pcamatrix G, pcblock b, pctruncmode tm, real eps)
 Approximate a matrix, represented by an amatrix object, by an $\mathcal{H}^2$-matrix. More...
 
ph2matrix compress_hmatrix_h2matrix (pchmatrix G, pctruncmode tm, real eps)
 Approximate a hierarchical matrix, represented by an hmatrix object, by an $\mathcal{H}^2$-matrix. More...
 
ph2matrix compress_h2matrix_h2matrix (pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps)
 Approximate an $\mathcal{H}^2$-matrix, represented by an h2matrix object, by a recompressed $\mathcal{H}^2$-matrix. More...
 
ph2matrix compress_symmetric_h2matrix_h2matrix (pch2matrix G, bool rbortho, pctruncmode tm, real eps)
 Approximate a symmetric $\mathcal{H}^2$-matrix, represented by an h2matrix object, by a recompressed $\mathcal{H}^2$-matrix. More...
 
void rowweights_h2matrix (pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator rlw)
 Prepare local row weights for a given $\mathcal{H}^2$-matrix. More...
 
void colweights_h2matrix (pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator clw)
 Prepare local column weights for a given $\mathcal{H}^2$-matrix. More...
 
void localweights_h2matrix (pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator rlw, pclusteroperator clw)
 Prepare local weights for a given $\mathcal{H}^2$-matrix. More...
 
void accumulate_clusteroperator (pcclusterbasis cb, pctruncmode tm, pclusteroperator lw)
 Merge the local weights of clusters with the weights inherited from their ancestors in order to obtain total weights. More...
 
void totalweights_h2matrix (pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, pclusteroperator rw, pclusteroperator cw)
 Construct total weights for a given $\mathcal{H}^2$-matrix. More...
 
void truncate_clusterbasis (pcclusterbasis cb, pcclusteroperator cw, pcclusteroperator clw, pctruncmode tm, real eps, pclusterbasis cbnew, pclusteroperator old2new)
 Compute a truncated cluster basis. More...
 
pclusterbasis buildrowbasis_h2matrix (pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusteroperator old2new)
 Construct an improved row basis for an $\mathcal{H}^2$-matrix. More...
 
pclusterbasis buildcolbasis_h2matrix (pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusteroperator old2new)
 Construct an improved row basis for an $\mathcal{H}^2$-matrix. More...
 
void truncrowbasis_h2matrix (ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusterbasis rbnew, pclusteroperator old2new)
 Construct an improved row basis for an $\mathcal{H}^2$-matrix. More...
 
void trunccolbasis_h2matrix (ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusterbasis cbnew, pclusteroperator old2new)
 Construct an improved column basis for an $\mathcal{H}^2$-matrix. More...
 
ph2matrix build_projected_h2matrix (pch2matrix G, pclusterbasis rb, pcclusteroperator ro, pclusterbasis cb, pcclusteroperator co)
 Construct an $\mathcal{H}^2$-matrix approximation of a given $\mathcal{H}^2$-matrix in new cluster bases by blockwise projection. More...
 
void project_inplace_h2matrix (ph2matrix G, pclusterbasis rb, pcclusteroperator ro, pclusterbasis cb, pcclusteroperator co)
 Switch the cluster bases of an $\mathcal{H}^2$-matrix by applying blockwise projections. More...
 
void orthoweight_clusterbasis (pclusterbasis cb)
 Compute cluster weights and store them in the cluster basis. More...
 
void totalweight_row_clusteroperator (pclusterbasis rb, pclusteroperator rw, pctruncmode tm)
 Compute total row weights of a matrix. More...
 
void totalweight_col_clusteroperator (pclusterbasis cb, pclusteroperator cw, pctruncmode tm)
 Compute total column weights of a matrix. More...
 
void truncate_inplace_clusterbasis (pclusterbasis cb, pclusteroperator cw, pctruncmode tm, real eps)
 Replace a cluster basis with a truncated basis. More...
 
void recompress_inplace_h2matrix (ph2matrix G, pctruncmode tm, real eps)
 Recompress an $\mathcal{H}^2$-matrix. More...
 
ptruncblock new_truncblock (pcclusterbasis cb, pcclusteroperator cw, ptruncblock next)
 Create a new truncblock object. More...
 
void del_truncblock (ptruncblock tb)
 Delete a list of truncblock objects. More...
 
ptruncblock reverse_truncblock (ptruncblock tb)
 Reverse the order of a list of truncblock objects. More...
 
pclusterbasis unify_clusterbasis (pccluster t, ptruncblock tb, pctruncmode tm, real eps, pclusteroperator*cw)
 Construct a unified cluster basis. More...
 
void unify_h2matrix (ph2matrix G, pclusteroperator*rw1, pclusteroperator*cw1, pctruncmode tm, real eps, pclusteroperator*rw, pclusteroperator*cw)
 Unify $\mathcal{H}^2$-submatrices into a large $\mathcal{H}^2$-matrix. More...
 
void unify_parallel_h2matrix (ph2matrix G, uint pardepth, pclusteroperator*rw1, pclusteroperator*cw1, pctruncmode tm, real eps, pclusteroperator*rw, pclusteroperator*cw)
 Unify $\mathcal{H}^2$-submatrices into a large $\mathcal{H}^2$-matrix, experimental parallel implementation. More...
 
void convert_rkmatrix_uniform (pcrkmatrix r, puniform u, pctruncmode tm, pclusteroperator*rw, pclusteroperator*cw)
 Converts an rkmatrix into a uniform matrix. More...
 
pclusterbasis buildrowbasis_hmatrix (pchmatrix G, pctruncmode tm, real eps)
 Construct a row basis for a hierarchical matrix. More...
 
pclusterbasis buildcolbasis_hmatrix (pchmatrix G, pctruncmode tm, real eps)
 Construct a column basis for a hierarchical matrix. More...
 
ph2matrix build_projected_hmatrix_h2matrix (pchmatrix G, pclusterbasis rb, pclusterbasis cb)
 Construct an $\mathcal{H}^2$-matrix approximation of a given hierarchical matrix in given cluster bases by blockwise projection. More...
 
pclusterbasis buildrowbasis_amatrix (pcamatrix G, pcblock b, pctruncmode tm, real eps)
 Construct a row basis for an array matrix. More...
 
pclusterbasis buildcolbasis_amatrix (pcamatrix G, pcblock b, pctruncmode tm, real eps)
 Construct a column basis for an array matrix. More...
 
ph2matrix build_projected_amatrix_h2matrix (pcamatrix G, pcblock b, pclusterbasis rb, pclusterbasis cb)
 Construct an $\mathcal{H}^2$-matrix approximation of a given array matrix in given cluster bases by blockwise projection. More...
 

Detailed Description

Functions for turning an amatrix, hmatrix or h2matrix into an h2matrix.

The functions in this module can be used to convert array matrices and hierarchical matrices into $\mathcal{H}^2$-matrices and to recompress $\mathcal{H}^2$-matrices. The module also provides a unification algorithm that takes a block matrix consisting of independent $\mathcal{H}^2$-matrices and turns it into an $\mathcal{H}^2$-matrix with unified row and column bases.

Function Documentation

void accumulate_clusteroperator ( pcclusterbasis  cb,
pctruncmode  tm,
pclusteroperator  lw 
)

Merge the local weights of clusters with the weights inherited from their ancestors in order to obtain total weights.

Finds matrices $Z_t$ with $P_t Z_t = \begin{pmatrix} Z^+_t\\ \zeta_{\rm age} Z_{t^+} E_t^* \end{pmatrix}$, where $t^+$ is the father of the cluster $t$ and $P_t$ is orthogonal.

Parameters
cbCluster basis.
tmTruncation mode, supplies $\zeta_{\rm age}$.
lwCluster operator, contains $Z^+_t$ and is overwritten by $Z_t$.
ph2matrix build_projected_amatrix_h2matrix ( pcamatrix  G,
pcblock  b,
pclusterbasis  rb,
pclusterbasis  cb 
)

Construct an $\mathcal{H}^2$-matrix approximation of a given array matrix in given cluster bases by blockwise projection.

Parameters
GOriginal matrix.
bBlock tree.
rbNew row basis.
cbNew column basis.
Returns
Approximating $\mathcal{H}^2$-matrix.
ph2matrix build_projected_h2matrix ( pch2matrix  G,
pclusterbasis  rb,
pcclusteroperator  ro,
pclusterbasis  cb,
pcclusteroperator  co 
)

Construct an $\mathcal{H}^2$-matrix approximation of a given $\mathcal{H}^2$-matrix in new cluster bases by blockwise projection.

Parameters
GOriginal matrix.
rbNew row basis.
roBasis change from old row basis G->rb to new basis rb.
cbNew column basis.
coBasis change from old column basis G->cb to new basis cb.
Returns
Approximating $\mathcal{H}^2$-matrix.
ph2matrix build_projected_hmatrix_h2matrix ( pchmatrix  G,
pclusterbasis  rb,
pclusterbasis  cb 
)

Construct an $\mathcal{H}^2$-matrix approximation of a given hierarchical matrix in given cluster bases by blockwise projection.

Parameters
GOriginal matrix.
rbNew row basis.
cbNew column basis.
Returns
Approximating $\mathcal{H}^2$-matrix.
pclusterbasis buildcolbasis_amatrix ( pcamatrix  G,
pcblock  b,
pctruncmode  tm,
real  eps 
)

Construct a column basis for an array matrix.

Parameters
GOriginal matrix $G$.
bBlock tree.
tmTruncation mode.
epsTruncation accuracy.
Returns
New column cluster basis.
pclusterbasis buildcolbasis_h2matrix ( pch2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
real  eps,
pclusteroperator  old2new 
)

Construct an improved row basis for an $\mathcal{H}^2$-matrix.

Parameters
GOriginal matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
epsTruncation accuracy.
old2newCluster operator describing the change of basis from G->cb to the new basis.
Returns
New column cluster basis.
pclusterbasis buildcolbasis_hmatrix ( pchmatrix  G,
pctruncmode  tm,
real  eps 
)

Construct a column basis for a hierarchical matrix.

Parameters
GOriginal matrix $G$.
tmTruncation mode.
epsTruncation accuracy.
Returns
New column cluster basis.
pclusterbasis buildrowbasis_amatrix ( pcamatrix  G,
pcblock  b,
pctruncmode  tm,
real  eps 
)

Construct a row basis for an array matrix.

Parameters
GOriginal matrix $G$.
bBlock tree.
tmTruncation mode.
epsTruncation accuracy.
Returns
New row cluster basis.
pclusterbasis buildrowbasis_h2matrix ( pch2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
real  eps,
pclusteroperator  old2new 
)

Construct an improved row basis for an $\mathcal{H}^2$-matrix.

Parameters
GOriginal matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
epsTruncation accuracy.
old2newCluster operator describing the change of basis from G->rb to the new basis.
Returns
New row cluster basis.
pclusterbasis buildrowbasis_hmatrix ( pchmatrix  G,
pctruncmode  tm,
real  eps 
)

Construct a row basis for a hierarchical matrix.

Parameters
GOriginal matrix $G$.
tmTruncation mode.
epsTruncation accuracy.
Returns
New row cluster basis.
void colweights_h2matrix ( pch2matrix  G,
pcclusteroperator  rbw,
pcclusteroperator  cbw,
pctruncmode  tm,
pclusteroperator  clw 
)

Prepare local column weights for a given $\mathcal{H}^2$-matrix.

Finds matrices $Z^+_s$ with $\begin{pmatrix} G_{t_1,s}\\ \vdots\\ G_{t_\tau,s} \end{pmatrix} = P_s Z^+_s W_s^*$, where $(t_1,s),\ldots,(t_\tau,s)$ are the admissible blocks connected to the column cluster $s$ and $P_s$ is orthogonal.

Remarks
If row and column weights have to be computed, consider using localweights_h2matrix.
Parameters
GSource matrix $G$.
rbwBasis weights for the row basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the row basis is assumed to be orthogonal, so no weights are required.
cbwBasis weights for the column basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the column basis is assumed to be orthogonal, so no weights are required.
tmTruncation mode.
clwWill be filled with the local column weights, can be initialized by build_from_clusterbasis_clusteroperator. If the cluster operator already contains something, the local weights will be merged with the original contents.
ph2matrix compress_amatrix_h2matrix ( pcamatrix  G,
pcblock  b,
pctruncmode  tm,
real  eps 
)

Approximate a matrix, represented by an amatrix object, by an $\mathcal{H}^2$-matrix.

Parameters
GSource matrix $G$.
bBlock tree, rows and columns have to match $G$.
tmTruncation mode.
epsTruncation accuracy.
Returns
$\mathcal{H}^2$-matrix approximation of $G$.
ph2matrix compress_h2matrix_h2matrix ( pch2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
real  eps 
)

Approximate an $\mathcal{H}^2$-matrix, represented by an h2matrix object, by a recompressed $\mathcal{H}^2$-matrix.

Parameters
GSource matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
epsTruncation accuracy.
Returns
$\mathcal{H}^2$-matrix approximation of $G$.
ph2matrix compress_hmatrix_h2matrix ( pchmatrix  G,
pctruncmode  tm,
real  eps 
)

Approximate a hierarchical matrix, represented by an hmatrix object, by an $\mathcal{H}^2$-matrix.

Parameters
GSource matrix $G$.
tmTruncation mode.
epsTruncation accuracy.
Returns
$\mathcal{H}^2$-matrix approximation of $G$.
ph2matrix compress_symmetric_h2matrix_h2matrix ( pch2matrix  G,
bool  rbortho,
pctruncmode  tm,
real  eps 
)

Approximate a symmetric $\mathcal{H}^2$-matrix, represented by an h2matrix object, by a recompressed $\mathcal{H}^2$-matrix.

Since the matrix is symmetric, we assume the row and column cluster basis are identical, i.e., G->rb==G->cb.

Parameters
GSource matrix $G$.
rborthoSet if the original row and column basis is orthogonal, this allows the algorithm to avoid computing row weights.
tmTruncation mode.
epsTruncation accuracy.
Returns
$\mathcal{H}^2$-matrix approximation of $G$.
void convert_rkmatrix_uniform ( pcrkmatrix  r,
puniform  u,
pctruncmode  tm,
pclusteroperator rw,
pclusteroperator cw 
)

Converts an rkmatrix into a uniform matrix.

Returns an exact representation of an rkmatrix by a new uniform matrix with new orthogonal row and column cluster bases and also computes corresponding total weight matrices. This function is intended for use with unify_h2matrix in order to convert rkmatrix approximations of leaves into h2matrix objects.

Parameters
rOriginal matrix.
uUniform matrix, will be overwritten.
tmTruncation mode, used to set of weight matrices correctly.
rwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total row weights of the new uniform matrix.
cwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total column weights of the new uniform matrix.
void del_truncblock ( ptruncblock  tb)

Delete a list of truncblock objects.

Parameters
tbHead of list.
void localweights_h2matrix ( pch2matrix  G,
pcclusteroperator  rbw,
pcclusteroperator  cbw,
pctruncmode  tm,
pclusteroperator  rlw,
pclusteroperator  clw 
)

Prepare local weights for a given $\mathcal{H}^2$-matrix.

Finds matrices $Z^+_t$ with $\begin{pmatrix} G_{t,s_1} & \cdots & G_{t,s_\sigma} \end{pmatrix} = V_t (Z^+_t)^* P_t$, where $(t,s_1),\ldots,(t,s_\sigma)$ are the admissible blocks connected to the row cluster $t$ and $P_t$ is orthogonal and matrices $Z^+_s$ with $\begin{pmatrix} G_{t_1,s}\\ \vdots\\ G_{t_\tau,s} \end{pmatrix} = Z^+_s W_s^* P_s$, where $(t_1,s),\ldots,(t_\tau,s)$ are the admissible blocks connected to the column cluster $s$ and $P_s$ is orthogonal.

This algorithm is more efficient than calling rowweights_h2matrix and colweights_h2matrix individually, since it passes only once through the matrix.

Parameters
GSource matrix $G$.
rbwBasis weights for the row basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the row basis is assumed to be orthogonal, so no weights are required.
cbwBasis weights for the column basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the column basis is assumed to be orthogonal, so no weights are required.
tmTruncation mode.
rlwWill be filled with the local row weights, can be initialized by build_from_clusterbasis_clusteroperator. If the cluster operator already contains something, the local weights will be merged with the original contents.
clwWill be filled with the local column weights, can be initialized by build_from_clusterbasis_clusteroperator. If the cluster operator already contains something, the local weights will be merged with the original contents.
ptruncblock new_truncblock ( pcclusterbasis  cb,
pcclusteroperator  cw,
ptruncblock  next 
)

Create a new truncblock object.

Parameters
cbCluster basis of the corresponding submatrix.
cwTotal weights for cb.
nextNext truncblock in list.
Returns
Returns the newly created truncblock object.
void orthoweight_clusterbasis ( pclusterbasis  cb)

Compute cluster weights and store them in the cluster basis.

The weights are the factors $R_t$ of the skinny QR decomposition $V_t = Q_t R_t$.

This function is similar to weight_clusterbasis_clusteroperator, but stores the basis weights in cb->Z instead of in a separate clusteroperator.

Parameters
cbTarget cluster basis, its field Z will be overwritten.
void project_inplace_h2matrix ( ph2matrix  G,
pclusterbasis  rb,
pcclusteroperator  ro,
pclusterbasis  cb,
pcclusteroperator  co 
)

Switch the cluster bases of an $\mathcal{H}^2$-matrix by applying blockwise projections.

Parameters
GOriginal matrix, will be overwritten by projected matrix.
rbNew row basis.
roBasis change from old row basis G->rb to new basis rb.
cbNew column basis.
coBasis change from old column basis G->cb to new basis cb
void recompress_inplace_h2matrix ( ph2matrix  G,
pctruncmode  tm,
real  eps 
)

Recompress an $\mathcal{H}^2$-matrix.

Replace an $\mathcal{H}^2$-matrix by a recompressed matrix.

Parameters
GOriginal matrix, will be overwritten by the recompressed matrix.
tmTruncation mode.
epsTruncation accuracy.
ptruncblock reverse_truncblock ( ptruncblock  tb)

Reverse the order of a list of truncblock objects.

Since new blocks are added at the head of a list, reversing the list restores the original order.

Parameters
tbHead of original list, will be changed.
Returns
Head of reversed list.
void rowweights_h2matrix ( pch2matrix  G,
pcclusteroperator  rbw,
pcclusteroperator  cbw,
pctruncmode  tm,
pclusteroperator  rlw 
)

Prepare local row weights for a given $\mathcal{H}^2$-matrix.

Finds matrices $Z^+_t$ with $\begin{pmatrix} G_{t,s_1} & \cdots & G_{t,s_\sigma} \end{pmatrix} = V_t (Z^+_t)^* P_t^*$, where $(t,s_1),\ldots,(t,s_\sigma)$ are the admissible blocks connected to the row cluster $t$ and $P_t$ is orthogonal.

Remarks
If row and column weights have to be computed, consider using localweights_h2matrix.
Parameters
GSource matrix $G$.
rbwBasis weights for the row basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the row basis is assumed to be orthogonal, so no weights are required.
cbwBasis weights for the column basis, can be obtained by weight_clusterbasis_clusteroperator. If this is a null pointer, the column basis is assumed to be orthogonal, so no weights are required.
tmTruncation mode.
rlwWill be filled with the local row weights, can be initialized by build_from_clusterbasis_clusteroperator. If the cluster operator already contains something, the local weights will be merged with the original contents.
void totalweight_col_clusteroperator ( pclusterbasis  cb,
pclusteroperator  cw,
pctruncmode  tm 
)

Compute total column weights of a matrix.

The column weights are the factor $R_t$ of the skinny QR decomposition $X_t = Q_t R_t$, where $X_t$ is the total column cluster basis of an $\mathcal{H}^2$-matrix $X$.

The matrix $X_t$ is obtained implicitly from the list starting with the pointer clist contained in the cluster basis.

Parameters
cbColumn basis.
cwTotal column weight.
tmTruncation mode.
void totalweight_row_clusteroperator ( pclusterbasis  rb,
pclusteroperator  rw,
pctruncmode  tm 
)

Compute total row weights of a matrix.

The row weights are the factor $R_t$ of the skinny QR decomposition $X_t = Q_t R_t$, where $X_t$ is the total row cluster basis of an $\mathcal{H}^2$-matrix $X$.

The matrix $X_t$ is obtained implicitly from the list starting with the pointer rlist contained in the cluster basis.

Parameters
rbRow basis.
rwTotal row weight.
tmTruncation mode.
void totalweights_h2matrix ( pch2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
pclusteroperator  rw,
pclusteroperator  cw 
)

Construct total weights for a given $\mathcal{H}^2$-matrix.

Finds matrices $Z_t$ with $G_t = V_t Z_t^* P_t^*$, where $G_t$ is the total cluster basis and $P_t$ is orthogonal. These are called total row weights. The total column weights are computed by applying the same procedure to $G^*$ instead of $G$.

Parameters
GSource matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
rwTotal row weights, can be initialized by calling build_from_clusterbasis_clusteroperator for the row basis.
cwTotal column weights, can be initialized by build_from_clusterbasis_clusteroperator for the column basis.
void truncate_clusterbasis ( pcclusterbasis  cb,
pcclusteroperator  cw,
pcclusteroperator  clw,
pctruncmode  tm,
real  eps,
pclusterbasis  cbnew,
pclusteroperator  old2new 
)

Compute a truncated cluster basis.

Reduces the rank of a cluster basis by computing singular value decompositions and choosing the most important left singular vectors to construct a new basis. Both total and local weights can be taken into account, and the local weights will be accumulated on the fly, making a call to accumulate_clusteroperator unnecessary.

Parameters
cbOriginal cluster basis.
cwTotal weights, ignored if null pointer.
clwLocal weights, will be accumulated, but not overwritten during the course of the algorithm, ignored if null pointer.
tmTruncation mode.
epsTruncation accuracy.
cbnewNew cluster basis, can be initialized with clonestructure_clusterbasis.
old2newCluster operator describing the change of basis from cb to cbnew.
void truncate_inplace_clusterbasis ( pclusterbasis  cb,
pclusteroperator  cw,
pctruncmode  tm,
real  eps 
)

Replace a cluster basis with a truncated basis.

This function is similar to truncate_clusterbasis, but replaces the old cluster basis by the new one.

Parameters
cbOld clusterbasis, will be overwritten by truncated cluster basis.
cwCluster weights.
tmTruncation mode.
epsTruncation accuracy.
void trunccolbasis_h2matrix ( ph2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
real  eps,
pclusterbasis  cbnew,
pclusteroperator  old2new 
)

Construct an improved column basis for an $\mathcal{H}^2$-matrix.

Remarks
Compare to buildcolbasis_h2matrix, this function constructs local weights by only one QR decomposition per cluster instead of one per block. It also handles block weights in a slightly different manner.
Parameters
GOriginal matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
epsTruncation accuracy.
cbnewNew cluster basis, can be initialized with clonestructure_clusterbasis.
old2newCluster operator describing the change of basis from G->cb to cbnew.
void truncrowbasis_h2matrix ( ph2matrix  G,
bool  rbortho,
bool  cbortho,
pctruncmode  tm,
real  eps,
pclusterbasis  rbnew,
pclusteroperator  old2new 
)

Construct an improved row basis for an $\mathcal{H}^2$-matrix.

Remarks
Compare to buildrowbasis_h2matrix, this function constructs local weights by only one QR decomposition per cluster instead of one per block. It also handles block weights in a slightly different manner.
Parameters
GOriginal matrix $G$.
rborthoSet if the original row basis is orthogonal, this allows the algorithm to avoid computing row weights.
cborthoSet if the original column basis is orthogonal, this allows the algorithm to avoid computing column weights.
tmTruncation mode.
epsTruncation accuracy.
rbnewNew cluster basis, can be initialized with clonestructure_clusterbasis.
old2newCluster operator describing the change of basis from G->rb to cbnew.
pclusterbasis unify_clusterbasis ( pccluster  t,
ptruncblock  tb,
pctruncmode  tm,
real  eps,
pclusteroperator cw 
)

Construct a unified cluster basis.

Constructs a cluster basis that can approximate multiple $\mathcal{H}^2$-matrices simultaneously, e.g., multiple independent sub- $\mathcal{H}^2$-matrices that have to be merged into a large $\mathcal{H}^2$-matrix.

Parameters
tRoot of the corresponding cluster tree.
tbList of truncblock objects describing cluster bases and weights. After the function has completed, the fields old2new will contain the basis change operators.
tmTruncation mode.
epsTruncation accuracy.
cwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total weights for the new basis. This is useful for recursive unification.
Returns
Unified cluster basis.
void unify_h2matrix ( ph2matrix  G,
pclusteroperator rw1,
pclusteroperator cw1,
pctruncmode  tm,
real  eps,
pclusteroperator rw,
pclusteroperator cw 
)

Unify $\mathcal{H}^2$-submatrices into a large $\mathcal{H}^2$-matrix.

Takes a block matrix containing $\mathcal{H}^2$-matrices and approximates it by a global $\mathcal{H}^2$-matrix.

Remarks
Differently from everywhere else in the library, G is not a proper $\mathcal{H}^2$-matrix, since the cluster bases of its immediate submatrices are allowed to differ from each other.
Parameters
GBlock matrix, will be overwritten by a proper $\mathcal{H}^2$-matrix approximation.
rw1Total row weights for all submatrices, enumerated in column-major ordering, i.e., rw1[i+j*G->rsons] corresponds to the block in row i and column j.
cw1Total column weights for all submatrices, enumerated in column-major ordering, i.e., rw1[i+j*G->rsons] corresponds to the block in row i and column j.
tmTruncation mode.
epsTruncation accuracy.
rwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total row weights of the new $\mathcal{H}^2$-matrix.
cwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total column weights of the new $\mathcal{H}^2$-matrix.
void unify_parallel_h2matrix ( ph2matrix  G,
uint  pardepth,
pclusteroperator rw1,
pclusteroperator cw1,
pctruncmode  tm,
real  eps,
pclusteroperator rw,
pclusteroperator cw 
)

Unify $\mathcal{H}^2$-submatrices into a large $\mathcal{H}^2$-matrix, experimental parallel implementation.

Takes a block matrix containing $\mathcal{H}^2$-matrices and approximates it by a global $\mathcal{H}^2$-matrix.

Remarks
Differently from everywhere else in the library, G is not a proper $\mathcal{H}^2$-matrix, since the cluster bases of its immediate submatrices are allowed to differ from each other.
Parameters
GBlock matrix, will be overwritten by a proper $\mathcal{H}^2$-matrix approximation.
pardepthParallization depth. Parallel threads are spawned only on the next pardepth levels of the recursion.
rw1Total row weights for all submatrices, enumerated in column-major ordering, i.e., rw1[i+j*G->rsons] corresponds to the block in row i and column j.
cw1Total column weights for all submatrices, enumerated in column-major ordering, i.e., rw1[i+j*G->rsons] corresponds to the block in row i and column j.
tmTruncation mode.
epsTruncation accuracy.
rwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total row weights of the new $\mathcal{H}^2$-matrix.
cwIf not a null pointer, will be set to point to a new clusteroperator tree containing the total column weights of the new $\mathcal{H}^2$-matrix.