HLIBpro
1.2
|
Classes | |
struct | tri_eval_option_t |
determines characteristics of triangular system More... | |
struct | fac_options_t |
options for matrix factorisations More... | |
class | TLU |
Computes LU factorisation ![]() | |
class | TLDU |
Computes LDU factorisation ![]() | |
class | TLL |
computes Cholesky factorisation ![]() ![]() | |
class | TLDL |
computes LDL factorisation ![]() ![]() | |
struct | inv_options_t |
options for matrix inversion More... | |
struct | solve_option_t |
determines characteristics of triangular system More... | |
class | TLowRankApx |
base class for all low rank approximation techniques More... | |
class | TZeroLRApx |
Approximate all low-rank blocks by zero, e.g. for nearfield only. More... | |
class | TSVDLRApx< T > |
Uses exact SVD to compute low rank approximation (WARNING: O(n³) complexity) More... | |
class | TACA< T > |
Defines interface for all ACA algorithms and implements classical ACA. More... | |
class | TACAPlus< T > |
Implements ACA+, which corrects some of the deficits of the original ACA algorithm. More... | |
class | TACAFull< T > |
ACA with full pivot search (complexity: O(n²)) More... | |
class | THCA< T > |
uses hybrid cross approximation (HCA) for computing low rank approximation More... | |
class | TPermHCAGeneratorFn< T_val > |
base class for HCA generator functions using row/column permutations More... |
Functions | |
void | eval_diag (const TMatrix *A, TVector *v, const matop_t op, const tri_eval_option_t &options) |
evaluate D·x=y with (block) diagonal D | |
void | eval (const TMatrix *A, TVector *v, const matop_t op, const tri_eval_option_t &options) |
evaluate L·U·x=y with lower triangular L and upper triangular U | |
void | eval_lower (const TMatrix *A, TVector *v, const matop_t op, const tri_eval_option_t &options) |
evaluate A·x=y with lower triangular A | |
void | eval_upper (const TMatrix *A, TVector *v, const matop_t op, const tri_eval_option_t &options) |
evaluate A·x = y with upper triangular A | |
void | invert (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const inv_options_t opts=inv_options_t()) |
compute ![]() | |
void | invert (TMatrix *A, const TTruncAcc &acc, const inv_options_t opts=inv_options_t()) |
compute ![]() | |
TVector * | inverse_diag (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const inv_options_t opts=inv_options_t()) |
Compute diagonal of ![]() | |
void | multiply_diag (const uint nthreads, const real alpha, const matop_t op_A, const TMatrix *A, const matop_t op_D, const TMatrix *D, const matop_t op_B, const TMatrix *B, const real beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C ≔ β·C + α·op(A)·op(D)·op(B) where D is a block diagonal matrix | |
size_t | multiply_diag_steps (const matop_t op_A, const TMatrix *A, const matop_t op_D, const TMatrix *D, const matop_t op_B, const TMatrix *B, const TMatrix *C) |
return number of steps for computing C ≔ C + op(A)·op(D)·op(B) | |
void | mul_diag_left (const TScalarVector &v, TMatrix *A) |
compute B = diag(v)·A and overwrite A | |
void | mul_diag_right (TMatrix *A, const TScalarVector &v) |
compute B = A·diag(v) and overwrite A |
Fourier Transformation | |
Functions for the forward and backward Fourier transformation of vectors. | |
void | fft (TVector *v) |
perform FFT for vector v (inplace) | |
void | ifft (TVector *v) |
perform inverse FFT for vector v (inplace) |
Matrix Addition | |
void | add (const uint nthreads, const real alpha, const TMatrix *A, const real beta, TMatrix *C, const TTruncAcc &acc) |
C ≔ α·A + β·C. | |
void | cadd (const uint nthreads, const complex &alpha, const TMatrix *A, const complex &beta, TMatrix *C, const TTruncAcc &acc) |
C = α·A + β·C. | |
void | add_identity (TMatrix *A, const real lambda) |
compute A ≔ A + λ·I | |
void | cadd_identity (TMatrix *A, const complex lambda) |
compute A ≔ A + λ·I |
Matrix Factorisation | |
Functions related to matrix factorisation, e.g. LU or Cholesky factorisation. | |
TMatrix * | factorise (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute factorisation of A | |
TMatrix * | factorise_inv (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute factorisation of A and return inverse operator | |
void | lu (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute LU factorisation using TLU | |
void | ldu (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute LDU factorisation using TLDU | |
void | ll (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute LL^H factorisation using TLL | |
void | ldl (const uint nthreads, TMatrix *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t()) |
compute LDL^H factorisation using TLDL |
Matrix Multiplication | |
void | multiply (const uint nthreads, const real alpha, const matop_t op_A, const TMatrix *A, const matop_t op_B, const TMatrix *B, const real beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C ≔ β·C + α·op(A)·op(B) | |
void | cmultiply (const uint nthreads, const complex alpha, const matop_t op_A, const TMatrix *A, const matop_t op_B, const TMatrix *B, const complex beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C ≔ β·C + α·op(A)·op(B) using nthreads | |
void | multiply (const uint nthreads, const real alpha, const TMatrix *A, const TMatrix *B, const real beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C = β·C + α·A·B using nthreads | |
void | multiply (const real alpha, const TMatrix *A, const TMatrix *B, const real beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C = β·C + α·A·B sequentially | |
void | cmultiply (const uint nthreads, const complex alpha, const TMatrix *A, const TMatrix *B, const complex beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C = β·C + α·A·B using nthreads | |
void | cmultiply (const complex alpha, const TMatrix *A, const TMatrix *B, const complex beta, TMatrix *C, const TTruncAcc &acc, TProgressBar *progress=NULL) |
compute C = β·C + α·A·B sequentially | |
size_t | multiply_steps (const matop_t op_A, const TMatrix *A, const matop_t op_B, const TMatrix *B, const TMatrix *C) |
return number of steps for computation of C ≔ C + op(A)·op(B) for progress meter initialisation |
Matrix-Vector Multiplication | |
void | mul_vec (const TProcSet &ps, const real alpha, const TMatrix *A, const TVector *x, const real beta, TVector *y, const matop_t op) |
compute y ≔ α·A·x + β·y on (possibly) distributed matrix A on all processors in ps | |
void | cmul_vec (const TProcSet &ps, const complex alpha, const TMatrix *A, const TVector *x, const complex beta, TVector *y, const matop_t op) |
same as mul_vec but with complex valued scalars ( |
This module provides most higher level algebra functions, e.g. matrix multiplication, inversion and factorisation. See also Basic Matrix Algebra and Matrix Factorisation for an introduction into 𝓗-arithmetic.
To include all algebra functions and classes add
to your source files.
void HLIB::add | ( | const uint | nthreads, |
const real | alpha, | ||
const TMatrix * | A, | ||
const real | beta, | ||
TMatrix * | C, | ||
const TTruncAcc & | acc | ||
) |
The function computes the sum \form#0 with a predefined accuracy \a acc. Thread parallel execution is supported, whereby \a nthreads defines the maximal number of threads to use.
nthreads | maximal number of threads to use |
alpha | scaling factor for A |
A | update matrix for C |
beta | scaling factor for C |
C | matrix to update |
acc | accuracy of summation |
void HLIB::cadd | ( | const uint | nthreads, |
const complex & | alpha, | ||
const TMatrix * | A, | ||
const complex & | beta, | ||
TMatrix * | C, | ||
const TTruncAcc & | acc | ||
) |
Version of HLIB::add with complex valued scaling factors.
void HLIB::cmul_vec | ( | const TProcSet & | ps, |
const complex | alpha, | ||
const TMatrix * | A, | ||
const TVector * | x, | ||
const complex | beta, | ||
TVector * | y, | ||
const matop_t | op | ||
) |
void HLIB::cmultiply | ( | const uint | nthreads, |
const complex | alpha, | ||
const matop_t | op_A, | ||
const TMatrix * | A, | ||
const matop_t | op_B, | ||
const TMatrix * | B, | ||
const complex | beta, | ||
TMatrix * | C, | ||
const TTruncAcc & | acc, | ||
TProgressBar * | progress = NULL |
||
) |
This is the complex valued version of HLIB::multiply, e.g. with complex scaling factors.
void HLIB::eval | ( | const TMatrix * | A, |
TVector * | v, | ||
const matop_t | op, | ||
const tri_eval_option_t & | options | ||
) |
void HLIB::eval_diag | ( | const TMatrix * | A, |
TVector * | v, | ||
const matop_t | op, | ||
const tri_eval_option_t & | options | ||
) |
void HLIB::eval_lower | ( | const TMatrix * | A, |
TVector * | v, | ||
const matop_t | op, | ||
const tri_eval_option_t & | options | ||
) |
void HLIB::eval_upper | ( | const TMatrix * | A, |
TVector * | v, | ||
const matop_t | op, | ||
const tri_eval_option_t & | options | ||
) |
TMatrix* HLIB::factorise | ( | const uint | nthreads, |
TMatrix * | A, | ||
const TTruncAcc & | acc, | ||
const fac_options_t & | options = fac_options_t() |
||
) |
Compute triangular factorisation of A while choosing appropriate factorisation method depending on the format of A, e.g. if unsymmetric, symmetric or hermitian.
The return value is a matrix object representing the factorised form and suitable for evaluation, e.g. matrix-vector multiplication (see TFacMatrix). A will be overwritten with the actual factorisation data.
TMatrix* HLIB::factorise_inv | ( | const uint | nthreads, |
TMatrix * | A, | ||
const TTruncAcc & | acc, | ||
const fac_options_t & | options = fac_options_t() |
||
) |
Compute triangular factorisation of A as in factorise but instead of a matrix for evaluation of the factorised A, a matrix for evaluation of the inverse of A is returned (see TFacInvMatrix).
TVector* HLIB::inverse_diag | ( | const uint | nthreads, |
TMatrix * | A, | ||
const TTruncAcc & | acc, | ||
const inv_options_t | opts = inv_options_t() |
||
) |
Compute only the diagonal of A and return the resulting vector. A is modified during computation.
void HLIB::invert | ( | const uint | nthreads, |
TMatrix * | A, | ||
const TTruncAcc & | acc, | ||
const inv_options_t | opts = inv_options_t() |
||
) |
Compute inverse of with block-wise accuracy acc and by using up to nthreads threads. A is overwritten by
during inversion.
void HLIB::mul_vec | ( | const TProcSet & | ps, |
const real | alpha, | ||
const TMatrix * | A, | ||
const TVector * | x, | ||
const real | beta, | ||
TVector * | y, | ||
const matop_t | op | ||
) |
ps | processor set defining processors involved in computation |
alpha | scaling factor for multiplication |
A | matrix to multiply with |
x | vector to multiply with |
beta | scaling factor of updated vector |
y | vector to update with multiplication result |
op | defines transformation of matrix, e.g. transposed, adjoint ( |
void HLIB::multiply | ( | const uint | nthreads, |
const real | alpha, | ||
const matop_t | op_A, | ||
const TMatrix * | A, | ||
const matop_t | op_B, | ||
const TMatrix * | B, | ||
const real | beta, | ||
TMatrix * | C, | ||
const TTruncAcc & | acc, | ||
TProgressBar * | progress = NULL |
||
) |
The function computes to matrix product \form#19 where \form#20 and \form#21 may be the non-modified, transposed or adjoint matrices \form#3 and \form#22 respectively. The result of the multiplication is written to \form#23, whereby the block structure of \a C is not changed, e.g. the resulting block structure of the product is defined by \a C. Thread-parallel execution is supported by the matrix multiplication. This function is available in various versions without corresponding parameters, e.g. without \a op_A, \a op_B or without \a nthreads.
nthreads | set number of threads to use |
alpha | scaling factor of product |
op_A | matrix modifier for A |
A | first matrix factor |
op_B | matrix modifier for B |
B | second matrix factor |
beta | scaling factor for C |
C | matrix to update |
acc | accuracy of multiplication |
progress | optional progress bar |