H2Lib  3.0
Typedefs | Functions
aca

This modules provides different kind of adaptive cross approximation techniques. More...

Typedefs

typedef void(* matrixentry_t) (const uint *ridx, const uint *cidx, void *data, const bool ntrans, pamatrix N)
 Matrix entry callback. More...
 

Functions

void decomp_fullaca_rkmatrix (pamatrix A, const real accur, uint **ridx, uint **cidx, prkmatrix R)
 This routine computes the adaptive cross approximation using full pivoting of a given matrix $ A $. More...
 
void decomp_partialaca_rkmatrix (matrixentry_t entry, void *data, const uint *ridx, const uint rows, const uint *cidx, const uint cols, real accur, uint **rpivot, uint **cpivot, prkmatrix R)
 This routine computes the adaptive cross approximation using partial pivoting of an implicitly given matrix $ A $. More...
 
void copy_lower_aca_amatrix (bool unit, pcamatrix A, uint *xi, pamatrix B)
 Copies the lower triangular part of a matrix A to a matrix B after applying the row pivoting denoted by xi. More...
 
void copy_upper_aca_amatrix (bool unit, pcamatrix A, uint *xi, pamatrix B)
 Copies the upper triangular part of a matrix A to a matrix B after applying the row pivoting denoted by xi. More...
 

Detailed Description

This modules provides different kind of adaptive cross approximation techniques.

Typedef Documentation

typedef void(* matrixentry_t) (const uint *ridx, const uint *cidx, void *data, const bool ntrans, pamatrix N)

Matrix entry callback.

Used to evaluate submatrices of an implicitly given matrix.

A typical application would be the computation of entries of a boundary element matrix by appropriate quadrature rules.

Parameters
ridxArray of row indices. Should have at least N->rows elements if ntrans is not set and N->cols elements if it is set.
cidxArray of column indices. Should have at least N->cols elements if ntrans is not set and N->rows elemenrs if it is set.
dataArbitrary data the callback function might require to complete its task, e.g., geometry data.
ntransSet if the transposed matrix is to be filled.
NTarget matrix.

Function Documentation

void copy_lower_aca_amatrix ( bool  unit,
pcamatrix  A,
uint xi,
pamatrix  B 
)

Copies the lower triangular part of a matrix A to a matrix B after applying the row pivoting denoted by xi.

for $ A \in \mathbb R^{\ell \times m}$ and $ B \in \mathbb R^{n \times m}$ with $ \ell \geq n$ it holds

\[ B_{i,j} = A_{\xi(i),j} \quad \text{for all } i \in \{1,\ldots,n \}, \ j \in \{ 1,\ldots,i \}. \]

Parameters
unitIf set to true the diagonal will be set to 1.0 instead of the corresponding entry of A.
ASource matrix.
xiArray denoting the row permutation.
BTarget matrix containing the lower triangular part of A with respect to xi.
Attention
The rows of B has to match the length of the array xi.
void copy_upper_aca_amatrix ( bool  unit,
pcamatrix  A,
uint xi,
pamatrix  B 
)

Copies the upper triangular part of a matrix A to a matrix B after applying the row pivoting denoted by xi.

for $ A \in \mathbb R^{\ell \times m}$ and $ B \in \mathbb R^{n \times m}$ with $ \ell \geq n$ it holds

\[ B_{i,j} = A_{\xi(i),j} \quad \text{for all } i \in \{1,\ldots,n \}, \ j \in \{ i,\ldots,m \}. \]

Parameters
unitIf set to true the diagonal will be set to 1.0 instead of the corresponding entry of A.
ASource matrix.
xiArray denoting the row permutation.
BTarget matrix containing the upper triangular part of A with respect to xi.
Attention
The rows of B has to match the length of the array xi.
void decomp_fullaca_rkmatrix ( pamatrix  A,
const real  accur,
uint **  ridx,
uint **  cidx,
prkmatrix  R 
)

This routine computes the adaptive cross approximation using full pivoting of a given matrix $ A $.

The matrix $A$ will be overwritten in part by the Schur complement, while the matrix $R$ will be filled with the low-rank approximation $R=C D^*$ of the original $R$. After completion, we have

\[ A \approx C \, D^* \]

with a guaranteed error of

\[ \lVert A - C \, D^* \rVert \leq \epsilon \, \lVert A \rVert \, . \]

Parameters
AInput matrix for which the ACA has to be applied to.
accurAccuracy defining how good the approximation has to be relative to the input matrix.
ridxReturns an array of row pivot indices, if ridx != NULL.
cidxReturns an array of column pivot indices, if cidx != NULL.
RThe resulting low rank matrix is returned via R .
void decomp_partialaca_rkmatrix ( matrixentry_t  entry,
void *  data,
const uint ridx,
const uint  rows,
const uint cidx,
const uint  cols,
real  accur,
uint **  rpivot,
uint **  cpivot,
prkmatrix  R 
)

This routine computes the adaptive cross approximation using partial pivoting of an implicitly given matrix $ A $.

After applying the ACA-algorithm we have

\[ A \approx C \, D^* \]

with an estimated error of

\[ \lVert A - C \, D^* \rVert \leq \epsilon \, \lVert A \rVert \, . \]

Parameters
entryThis callback function implicitly defines the matrix $ A $. It take two arrays of row and column indices, a void-pointer to some data-object needed for computing matrix entries and a flag determined whether we want entries of the original or of the transposed matrix $ A $. Length of ridx and cidx is determined by the rows and columns of matrix A.
dataAn additional void-pointer to some data-object that will be needed by entry to compute the matrix entries.
ridxAn array of all row indices defining the complete matrix $ A $ as in decomp_fullaca_rkmatrix.
rowsNumber of rows for the implicit matrix and therefore the length of ridx.
cidxAn array of all column indices defining the complete matrix $ A $ as in decomp_fullaca_rkmatrix.
colsNumber of columns for the implicit matrix and therefore the length of cidx.
accurAccuracy defining how good the approximation has to be relative to the input matrix.
rpivotReturns an array of row pivot indices.
cpivotReturns an array of column pivot indices.
RThe resulting low rank matrix is returned via R .