HLIBpro  3.0
Algebra

Classes

struct  fac_options_t
 options for matrix factorisations More...
 
class  TLU
 Computes LU factorisation \( A = LU \). More...
 
class  TLDU
 Computes LDU factorisation \( A = LDU \). More...
 
class  TLL
 computes Cholesky factorisation \( A = LL^T \) or \( A=LL^H \) More...
 
class  TLDL
 computes LDL factorisation \( A = LDL^T \) or \( A = LDL^H \) More...
 
struct  inv_options_t
 options for matrix inversion More...
 
struct  solve_option_t
 options for how to solve with given matrix More...
 
struct  eval_option_t
 options for how to evaluate given matrix More...
 
class  TLowRankApx< T_value >
 base class for all low rank approximation techniques More...
 
class  TZeroLRApx< T_value >
 Approximate all low-rank blocks by zero, e.g. for nearfield only. More...
 
class  TDenseLRApx< T_value >
 Computes dense matrix block without approximation. More...
 
class  TSVDLRApx< T_value >
 Uses exact SVD to compute low rank approximation (WARNING: O(n³) complexity) More...
 
class  TRandSVDLRApx< T_value >
 Uses randomized SVD to compute low rank approximation (WARNING: O(n²) complexity) More...
 
class  TRRQRLRApx< T_value >
 Uses rank-revealing QR to compute low rank approximation. More...
 
class  TACA< T_value >
 Defines interface for all ACA algorithms and implements classical ACA. More...
 
class  TACAPlus< T_value >
 Implements ACA+, which corrects some of the deficits of the original ACA algorithm. More...
 
class  TACAFull< T_value >
 ACA with full pivot search (complexity: O(n²)) More...
 
class  THCA< T_value >
 uses hybrid cross approximation (HCA) for computing low rank approximation More...
 
class  TPermHCAGeneratorFn< T_value >
 base class for HCA generator functions using row/column permutations More...
 

Functions

template<typename value_t >
void eval_diag (const TMatrix< value_t > *A, TVector< value_t > *v, const matop_t op, const eval_option_t &options)
 evaluate D·x=y with (block) diagonal D More...
 
template<typename value_t >
void eval (const TMatrix< value_t > *A, TVector< value_t > *v, const matop_t op, const eval_option_t &options)
 evaluate L·U·x = y with lower triangular L and upper triangular U More...
 
template<typename value_t >
void eval_lower (const TMatrix< value_t > *A, TVector< value_t > *v, const matop_t op, const eval_option_t &options)
 evaluate A·x = y with lower triangular A More...
 
template<typename value_t >
void eval_upper (const TMatrix< value_t > *A, TVector< value_t > *v, const matop_t op, const eval_option_t &options)
 evaluate A·x = y with upper triangular A More...
 
template<typename value_t >
void invert (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 compute \( A^{-1} \) More...
 
template<typename value_t >
DAG::Graph gen_dag_invert (TMatrix< value_t > *A, const inv_options_t &opts=inv_options_t())
 generate DAG for computing \( A^{-1} \)
 
template<typename value_t >
void invert_ll (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 compute \( A^{-1} \) More...
 
template<typename value_t >
DAG::Graph gen_dag_invert_ll (TMatrix< value_t > *A, const inv_options_t &opts=inv_options_t())
 generate DAG for computing \( A^{-1} \) for lower-left part of \(A\)
 
template<typename value_t >
void invert_ll (TMatrix< value_t > *L, TMatrix< value_t > *X, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 compute \( X = L^{-1} \) More...
 
template<typename value_t >
void invert_ur (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 compute \( A^{-1} \) More...
 
template<typename value_t >
DAG::Graph gen_dag_invert_ur (TMatrix< value_t > *A, const inv_options_t &opts=inv_options_t())
 generate DAG for computing \( A^{-1} \) for upper-right part of \(A\)
 
template<typename value_t >
void invert_diag (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 compute \( A^{-1} \) More...
 
template<typename value_t >
std::unique_ptr< TVector< value_t > > inverse_diag (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 Compute diagonal of \( A^{-1} \). More...
 
template<typename value_t >
void gauss_elim (TMatrix< value_t > *A, TMatrix< value_t > *C, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 Compute \(A^{-1} \) via Gaussian elimination. More...
 
template<typename value_t >
void gauss_elim (TMatrix< value_t > *A, const TTruncAcc &acc, const inv_options_t &opts=inv_options_t())
 Compute \(A^{-1} \) via Gaussian elimination. More...
 
template<typename value_t >
void invert (TDenseMatrix< value_t > *A)
 compute \( A^{-1} \) More...
 
template<typename value_t >
std::unique_ptr< TDenseMatrix< value_t > > inverse (const TDenseMatrix< value_t > *A)
 compute and return \( A^{-1} \) More...
 
template<typename value_t >
void multiply_diag (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_D, const TMatrix< value_t > *D, const matop_t op_B, const TMatrix< value_t > *B, const value_t beta, TMatrix< value_t > *C, const TTruncAcc &acc, TProgressBar *progress=NULL)
 compute C ≔ β·C + α·op(A)·op(D)·op(B) with (block) diagonal matrix D
 
template<typename value_t >
void multiply_diag_accu (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_D, const TMatrix< value_t > *D, const matop_t op_B, const TMatrix< value_t > *B, TMatrix< value_t > *C, const TTruncAcc &acc)
 compute C ≔ C + α·op(A)·op(D)·op(B) with (block) diagonal matrix D using accumulators
 
template<typename value_t >
std::unique_ptr< TMatrix< value_t > > multiply_diag (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_D, const TMatrix< value_t > *D, const matop_t op_B, const TMatrix< value_t > *B)
 compute C ≔ α·op(A)·op(D)·op(B) with (block) diagonal matrix D More...
 
template<typename value_t >
size_t multiply_diag_steps (const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_D, const TMatrix< value_t > *D, const matop_t op_B, const TMatrix< value_t > *B, const TMatrix< value_t > *C)
 return number of steps for computing C ≔ C + op(A)·op(D)·op(B)
 
template<typename value_t >
void mul_diag_left (const TScalarVector< value_t > &v, TMatrix< value_t > *A)
 compute B = diag(v)·A and overwrite A
 
template<typename value_t >
void mul_diag_right (TMatrix< value_t > *A, const TScalarVector< value_t > &v)
 compute B = A·diag(v) and overwrite A
 

Fourier Transformation

Functions for the forward and backward Fourier transformation of vectors.

template<typename real_t >
void fft (TVector< std::complex< real_t > > *v)
 perform FFT for vector v (inplace)
 
template<typename real_t >
void ifft (TVector< std::complex< real_t > > *v)
 perform inverse FFT for vector v (inplace)
 

Matrix Addition

Functions for matrix addition

template<typename value_t >
void add (const value_t alpha, const TMatrix< value_t > *A, const value_t beta, TMatrix< value_t > *C, const TTruncAcc &acc)
 C ≔ α·A + β·C. More...
 
template<typename value_t >
void add_identity (TMatrix< value_t > *A, const value_t lambda)
 compute A ≔ A + λ·I
 
template<typename value_t >
std::unique_ptr< TMatrix< value_t > > add (std::list< const TMatrix< value_t > * > &matrices, const TTruncAcc &acc)
 compute and return Σ_i A_i
 
template<typename value_t , typename alpha_t , typename beta_t >
void add (const alpha_t alpha, const TMatrix< value_t > &A, const beta_t beta, TMatrix< value_t > &C, const TTruncAcc &acc)
 
template<typename value_t , typename lambda_t >
void add_identity (TMatrix< value_t > &A, const lambda_t lambda)
 
template<typename value_t >
std::unique_ptr< TMatrix< value_t > > add (std::list< std::unique_ptr< TMatrix< value_t > > > &matrices, const TTruncAcc &acc)
 

Matrix Factorisation

Functions related to matrix factorisation, e.g. LU or Cholesky factorisation.

template<typename value_t >
std::unique_ptr< TFacMatrix< value_t > > factorise (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute factorisation of A More...
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > factorise_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute factorisation of A and return inverse operator More...
 
template<typename value_t >
void lu (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LU factorisation
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > lu_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LU factorisation and return inverse operator
 
template<typename value_t >
void ldu (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LDU factorisation
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ldu_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LDU factorisation and return inverse operator
 
template<typename value_t >
void ll (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute Cholesky factorisation
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ll_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute Cholesky factorisation and return inverse operator
 
template<typename value_t >
void ldl (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LDL^H factorisation
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ldl_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 compute LDL factorisation and return inverse operator
 
template<typename value_t >
void test_convert_dense (TBlockMatrix< value_t > *B, const uint i, const uint j)
 test, if given matrix B_ij is lowrank with too large rank and convert to dense
 
template<typename value_t >
std::unique_ptr< TFacMatrix< value_t > > factorise (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > factorise_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void lu (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > lu_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void ldu (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ldu_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void ll (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void chol (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void chol (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ll_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > chol_inv (TMatrix< value_t > *A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > chol_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
void ldl (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 
template<typename value_t >
std::unique_ptr< TFacInvMatrix< value_t > > ldl_inv (TMatrix< value_t > &A, const TTruncAcc &acc, const fac_options_t &options=fac_options_t())
 

Matrix Multiplication

Functions for matrix multiplication.

template<typename value_t >
void multiply (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B, const value_t beta, TMatrix< value_t > *C, const TTruncAcc &acc, TProgressBar *progress=nullptr)
 compute C ≔ β·C + α·op(A)·op(B) More...
 
template<typename value_t >
void multiply (const value_t alpha, const TMatrix< value_t > *A, const TMatrix< value_t > *B, const value_t beta, TMatrix< value_t > *C, const TTruncAcc &acc, TProgressBar *progress=nullptr)
 compute C = β·C + α·A·B More...
 
template<typename value_t >
void multiply_accu (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B, const value_t beta, TMatrix< value_t > *C, const TTruncAcc &acc)
 compute C ≔ C + α·op(A)·op(B) using accumulators
 
template<typename value_t >
std::unique_ptr< TMatrix< value_t > > multiply (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B)
 compute C ≔ β·C + α·op(A)·op(B) More...
 
template<typename value_t >
void multiply_ll_left (const value_t alpha, const TMatrix< value_t > *L, TMatrix< value_t > *A, const TTruncAcc &acc, const eval_option_t &opts)
 compute A ≔ α·L·A with lower left tridiagonal L
 
template<typename value_t >
void multiply_ll_right (const value_t alpha, TMatrix< value_t > *A, const TMatrix< value_t > *L, const TTruncAcc &acc, const eval_option_t &opts)
 compute A ≔ α·A·L with lower left tridiagonal L
 
template<typename value_t >
void multiply_ll_right (const value_t alpha, const TMatrix< value_t > *A, const TMatrix< value_t > *B, TMatrix< value_t > *C, const TTruncAcc &acc, const eval_option_t &opts)
 compute C ≔ C + α·A·B with lower left tridiagonal B
 
template<typename value_t >
void multiply_ur_left (const value_t alpha, const TMatrix< value_t > *U, TMatrix< value_t > *A, const TTruncAcc &acc, const eval_option_t &opts)
 compute A ≔ α·U·A with upper right tridiagonal U
 
template<typename value_t >
void multiply_ur_right (const value_t alpha, TMatrix< value_t > *A, const TMatrix< value_t > *U, const TTruncAcc &acc, const eval_option_t &opts)
 compute A ≔ α·A·U with upper right tridiagonal U
 
template<typename value_t >
void multiply_ur_ll (const TMatrix< value_t > *U, const TMatrix< value_t > *L, TMatrix< value_t > *A, const TTruncAcc &acc, const eval_option_t &opts_U, const eval_option_t &opts_L)
 Compute A ≔ A + U·L. More...
 
template<typename value_t >
void multiply_llt_d_ll (const TMatrix< value_t > *L, const TMatrix< value_t > *D, TMatrix< value_t > *C, const matop_t op_L, const TTruncAcc &acc)
 Compute C ≔ C + L^T·D·L. More...
 
template<typename value_t >
void multiply_llt_d_left (const value_t alpha, const TMatrix< value_t > *L, const TMatrix< value_t > *D, TMatrix< value_t > *B, const matop_t op_L, const TTruncAcc &acc)
 Compute B ≔ op(L)·D·B inplace, overwriting B. More...
 
template<typename value_t >
void multiply_llt_d_left (const value_t alpha, const TMatrix< value_t > *L, const TMatrix< value_t > *D, const TMatrix< value_t > *B, TMatrix< value_t > *C, const matop_t op_L, const TTruncAcc &acc)
 Compute C ≔ C + op(L)·D·B. More...
 
template<typename value_t , typename alpha_t , typename beta_t >
void multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B, const beta_t beta, TMatrix< value_t > &C, const TTruncAcc &acc, TProgressBar *progress=nullptr)
 
template<typename value_t , typename alpha_t , typename beta_t >
void multiply (const alpha_t alpha, const TMatrix< value_t > &A, const TMatrix< value_t > &B, const beta_t beta, TMatrix< value_t > &C, const TTruncAcc &acc, TProgressBar *progress=nullptr)
 
template<typename value_t , typename alpha_t , typename beta_t >
void multiply_accu (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B, const beta_t beta, TMatrix< value_t > &C, const TTruncAcc &acc)
 
template<typename value_t >
void add_product (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B, TMatrix< value_t > *C, const TTruncAcc &acc, const bool lazy=CFG::Arith::lazy_eval)
 
template<typename value_t , typename alpha_t >
void add_product (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B, TMatrix< value_t > &C, const TTruncAcc &acc, const bool lazy=CFG::Arith::lazy_eval)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TRkMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TRkMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TRkMatrix< value_t > *B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TRkMatrix< value_t > &B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TDenseMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TDenseMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TDenseMatrix< value_t > *B)
 
template<typename value_t , typename alpha_t >
std::unique_ptr< TMatrix< value_t > > multiply (const alpha_t alpha, const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TDenseMatrix< value_t > &B)
 
template<typename value_t , typename alpha_t >
void multiply_ll_left (const alpha_t alpha, const TMatrix< value_t > &L, TMatrix< value_t > &A, const TTruncAcc &acc, const eval_option_t &opts)
 
template<typename value_t , typename alpha_t >
void multiply_ll_right (const alpha_t alpha, TMatrix< value_t > &A, const TMatrix< value_t > &L, const TTruncAcc &acc, const eval_option_t &opts)
 
template<typename value_t , typename alpha_t >
void multiply_ll_right (const alpha_t alpha, const TMatrix< value_t > &A, const TMatrix< value_t > &B, TMatrix< value_t > &C, const TTruncAcc &acc, const eval_option_t &opts)
 
template<typename value_t , typename alpha_t >
void multiply_ur_left (const alpha_t alpha, const TMatrix< value_t > &U, TMatrix< value_t > &A, const TTruncAcc &acc, const eval_option_t &opts)
 
template<typename value_t , typename alpha_t >
void multiply_ur_right (const alpha_t alpha, TMatrix< value_t > &A, const TMatrix< value_t > &U, const TTruncAcc &acc, const eval_option_t &opts)
 
template<typename value_t >
void multiply_ur_ll (const TMatrix< value_t > &U, const TMatrix< value_t > &L, TMatrix< value_t > &A, const TTruncAcc &acc, const eval_option_t &opts_U, const eval_option_t &opts_L)
 
template<typename value_t >
void multiply_llt_d_ll (const TMatrix< value_t > &L, const TMatrix< value_t > &D, TMatrix< value_t > &C, const matop_t op_L, const TTruncAcc &acc)
 
template<typename value_t , typename alpha_t >
void multiply_llt_d_left (const alpha_t alpha, const TMatrix< value_t > &L, const TMatrix< value_t > &D, TMatrix< value_t > &B, const matop_t op_L, const TTruncAcc &acc)
 
template<typename value_t , typename alpha_t >
void multiply_llt_d_left (const alpha_t alpha, const TMatrix< value_t > &L, const TMatrix< value_t > &D, const TMatrix< value_t > &B, TMatrix< value_t > &C, const matop_t op_L, const TTruncAcc &acc)
 
template<typename value_t >
size_t multiply_steps (const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_B, const TMatrix< value_t > *B, const TMatrix< value_t > *C)
 
template<typename value_t >
size_t multiply_steps (const matop_t op_A, const TMatrix< value_t > &A, const matop_t op_B, const TMatrix< value_t > &B, const TMatrix< value_t > &C)
 
template<typename value_t >
size_t multiply_ll_left_steps (const TMatrix< value_t > *A, const TMatrix< value_t > *B)
 
template<typename value_t >
size_t multiply_ll_left_steps (const TMatrix< value_t > &A, const TMatrix< value_t > &B)
 
template<typename value_t >
size_t multiply_ll_right_steps (const TMatrix< value_t > *A, const TMatrix< value_t > *B)
 
template<typename value_t >
size_t multiply_ll_right_steps (const TMatrix< value_t > &A, const TMatrix< value_t > &B)
 
template<typename value_t >
size_t multiply_ur_left_steps (const TMatrix< value_t > *A, const TMatrix< value_t > *B)
 
template<typename value_t >
size_t multiply_ur_left_steps (const TMatrix< value_t > &A, const TMatrix< value_t > &B)
 
template<typename value_t >
size_t multiply_ur_right_steps (const TMatrix< value_t > *A, const TMatrix< value_t > *B)
 
template<typename value_t >
size_t multiply_ur_right_steps (const TMatrix< value_t > &A, const TMatrix< value_t > &B)
 
template<typename value_t >
size_t multiply_ur_ll_steps (const TMatrix< value_t > *A)
 
template<typename value_t >
size_t multiply_ur_ll_steps (const TMatrix< value_t > &A)
 
template<typename value_t >
size_t multiply_llt_d_ll_steps (const TMatrix< value_t > *L)
 
template<typename value_t >
size_t multiply_llt_d_ll_steps (const TMatrix< value_t > &L)
 
template<typename value_t >
size_t multiply_llt_d_left_steps (const TMatrix< value_t > *L, const TMatrix< value_t > *B)
 
template<typename value_t >
size_t multiply_llt_d_left_steps (const TMatrix< value_t > &L, const TMatrix< value_t > &B)
 

Matrix-Vector Multiplication

Functions for (parallel) matrix-vector multiplication

template<typename value_t >
void mul_vec (const TProcSet &ps, const value_t alpha, const TMatrix< value_t > *A, const TVector< value_t > *x, const value_t beta, TVector< value_t > *y, const matop_t op)
 compute y ≔ α·A·x + β·y on (possibly) distributed matrix A on all processors in ps More...
 
template<typename value_t >
void mul_vec_diag (const value_t alpha, const matop_t op_A, const TMatrix< value_t > *A, const matop_t op_D, const TMatrix< value_t > *D, const TVector< value_t > *x, const value_t beta, TVector< value_t > *y)
 compute y ≔ α·A·D·x + β·y with diagonal matrix D More...
 

Detailed Description

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 H-arithmetic.

To include all algebra functions and classes add

#include <hlib-alg.hh>

to your source files.

Function Documentation

◆ add()

void Hpro::add ( const value_t  alpha,
const TMatrix< value_t > *  A,
const value_t  beta,
TMatrix< value_t > *  C,
const TTruncAcc acc 
)
     The function computes the sum \f$ C := \alpha A + \beta C \f$ with
     a predefined accuracy \a acc. Thread parallel execution is supported.
Parameters
alphascaling factor for A
Aupdate matrix for C
betascaling factor for C
Cmatrix to update
accaccuracy of summation

◆ add_product()

void Hpro::add_product ( const value_t  alpha,
const matop_t  op_A,
const TMatrix< value_t > *  A,
const matop_t  op_B,
const TMatrix< value_t > *  B,
TMatrix< value_t > *  C,
const TTruncAcc acc,
const bool  lazy = CFG::Arith::lazy_eval 
)

start accumulator based matrix multiplication C = C + α·A·B

◆ eval()

void Hpro::eval ( const TMatrix< value_t > *  A,
TVector< value_t > *  v,
const matop_t  op,
const eval_option_t options 
)
  • L and U are both stored in A
  • on entry: v = x
  • on exit : v = y

◆ eval_diag()

void Hpro::eval_diag ( const TMatrix< value_t > *  A,
TVector< value_t > *  v,
const matop_t  op,
const eval_option_t options 
)
  • on entry: v = x
  • on exit : v = y

◆ eval_lower()

void Hpro::eval_lower ( const TMatrix< value_t > *  A,
TVector< value_t > *  v,
const matop_t  op,
const eval_option_t options 
)
  • on entry: v = x
  • on exit : v = y

◆ eval_upper()

void Hpro::eval_upper ( const TMatrix< value_t > *  A,
TVector< value_t > *  v,
const matop_t  op,
const eval_option_t options 
)
  • on entry: v = x
  • on exit : v = y

◆ factorise()

std::unique_ptr< TFacMatrix< value_t > > Hpro::factorise ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const fac_options_t options = fac_options_t() 
)
     Compute triangular factorisation of \a A while choosing
     appropriate factorisation method depending on the format
     of \a A, e.g. if unsymmetric, symmetric or hermitian.

     The return value is an operator object representing the
     factorised form and suitable for evaluation, e.g.
     matrix-vector multiplication (see TFacMatrix).
     \a A will be overwritten with the actual factorisation data.

◆ factorise_inv()

std::unique_ptr< TFacInvMatrix< value_t > > Hpro::factorise_inv ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const fac_options_t options = fac_options_t() 
)
     Compute triangular factorisation of \a A as in factorise
     but instead of an operator for evaluation of the factorised
     \a A, an operator for evaluation of the inverse of \a A is
     returned (see TFacInvMatrix).

◆ gauss_elim() [1/2]

void Hpro::gauss_elim ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     \a A is overwritten by \f$A^{-1} \f$. The elimination
     is performed in-place, although local copy operations
     are needed. (ATTENTION: experimental)

◆ gauss_elim() [2/2]

void Hpro::gauss_elim ( TMatrix< value_t > *  A,
TMatrix< value_t > *  C,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     \a A is overwritten by \f$A^{-1} \f$. \a C is optional
     and may be used during computation as temporary space.
     If present, it should have same format as \a A.

◆ inverse()

std::unique_ptr< TDenseMatrix< value_t > > Hpro::inverse ( const TDenseMatrix< value_t > *  A)
     Compute inverse of \f$ A \f$ (dense matrix version)
     but do not modify \f$ A \f$.

◆ inverse_diag()

std::unique_ptr< TVector< value_t > > Hpro::inverse_diag ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute only the diagonal of \a A and return the resulting
     vector. \a A is modified during computation.

◆ invert() [1/2]

void Hpro::invert ( TDenseMatrix< value_t > *  A)
     Compute inverse of \f$ A \f$ (dense matrix version).
     \a A is overwritten by \f$ A^{-1} \f$ during inversion.

◆ invert() [2/2]

void Hpro::invert ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute inverse of \f$ A \f$ with block-wise accuracy \a acc.
     \a A is overwritten by \f$ A^{-1} \f$ during inversion.

◆ invert_diag()

void Hpro::invert_diag ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute inverse of diagonal matrix \f$ A \f$ with block-wise
     accuracy \a acc. \a A is overwritten by \f$ A^{-1} \f$
     during inversion.

◆ invert_ll() [1/2]

void Hpro::invert_ll ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute inverse of lower-left triangular matrix \f$ A \f$ with 
     block-wise accuracy \a acc. \a A is overwritten by \f$ A^{-1} \f$
     during inversion.

◆ invert_ll() [2/2]

void Hpro::invert_ll ( TMatrix< value_t > *  L,
TMatrix< value_t > *  X,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute inverse of lower-left triangular matrix \f$ L \f$ with 
     block-wise accuracy \a acc. \a L may be modified during inversion.

◆ invert_ur()

void Hpro::invert_ur ( TMatrix< value_t > *  A,
const TTruncAcc acc,
const inv_options_t opts = inv_options_t() 
)
     Compute inverse of upper-right triangular matrix \f$ A \f$ with 
     block-wise accuracy \a acc. \a A is overwritten by \f$ A^{-1} \f$
     during inversion.

◆ mul_vec()

void Hpro::mul_vec ( const TProcSet ps,
const value_t  alpha,
const TMatrix< value_t > *  A,
const TVector< value_t > *  x,
const value_t  beta,
TVector< value_t > *  y,
const matop_t  op 
)
Parameters
psprocessor set defining processors involved in computation
alphascaling factor for multiplication
Amatrix to multiply with
xvector to multiply with
betascaling factor of updated vector
yvector to update with multiplication result
opdefines transformation of matrix, e.g. transposed, adjoint (
See also
matop_t)

◆ mul_vec_diag()

void Hpro::mul_vec_diag ( const value_t  alpha,
const matop_t  op_A,
const TMatrix< value_t > *  A,
const matop_t  op_D,
const TMatrix< value_t > *  D,
const TVector< value_t > *  x,
const value_t  beta,
TVector< value_t > *  y 
)
Parameters
alphascaling factor for update
op_Atransformation of matrix A, e.g. transposed, adjoint (
See also
matop_t)
Parameters
Aarbitrary matrix
op_Dtransformation of matrix D
Ddiagonal matrix
xsource vector
betascaling factor for destination
ydestination vector

◆ multiply() [1/3]

std::unique_ptr< TMatrix< value_t > > Hpro::multiply ( const value_t  alpha,
const matop_t  op_A,
const TMatrix< value_t > *  A,
const matop_t  op_B,
const TMatrix< value_t > *  B 
)
     The function computes to matrix product \f$\alpha \tilde A \tilde B\f$
     where \f$\tilde A\f$ and \f$\tilde B\f$ may be the non-modified, transposed or adjoint
     matrices \f$A\f$ and \f$B\f$ respectively.

     The output format is based on the format of \f$A\f$ or \f$B\f$, which assumes that at least
     one of those is a non-blocked matrix. Otherwise, an exception is thrown!
Parameters
alphascaling factor of product
op_Amatrix modifier for A
Afirst matrix factor
op_Bmatrix modifier for B
Bsecond matrix factor

◆ multiply() [2/3]

void Hpro::multiply ( const value_t  alpha,
const matop_t  op_A,
const TMatrix< value_t > *  A,
const matop_t  op_B,
const TMatrix< value_t > *  B,
const value_t  beta,
TMatrix< value_t > *  C,
const TTruncAcc acc,
TProgressBar *  progress = nullptr 
)
     The function computes to matrix product \f$C := \beta C + \alpha \tilde A \tilde B\f$
     where \f$\tilde A\f$ and \f$\tilde B\f$ may be the non-modified, transposed or adjoint
     matrices \f$A\f$ and \f$B\f$ respectively.

     The result of the multiplication is written to \f$C\f$, 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.
Parameters
alphascaling factor of product
op_Amatrix modifier for A
Afirst matrix factor
op_Bmatrix modifier for B
Bsecond matrix factor
betascaling factor for C
Cmatrix to update
accaccuracy of multiplication
progressoptional progress bar

◆ multiply() [3/3]

void Hpro::multiply ( const value_t  alpha,
const TMatrix< value_t > *  A,
const TMatrix< value_t > *  B,
const value_t  beta,
TMatrix< value_t > *  C,
const TTruncAcc acc,
TProgressBar *  progress = nullptr 
)
inline
     matrices are provided as matrix view (or in combination with matrix)

◆ multiply_diag()

std::unique_ptr< TMatrix< value_t > > Hpro::multiply_diag ( const value_t  alpha,
const matop_t  op_A,
const TMatrix< value_t > *  A,
const matop_t  op_D,
const TMatrix< value_t > *  D,
const matop_t  op_B,
const TMatrix< value_t > *  B 
)
  • not all matrices must be blocked!

◆ multiply_llt_d_left() [1/2]

void Hpro::multiply_llt_d_left ( const value_t  alpha,
const TMatrix< value_t > *  L,
const TMatrix< value_t > *  D,
const TMatrix< value_t > *  B,
TMatrix< value_t > *  C,
const matop_t  op_L,
const TTruncAcc acc 
)
     Compute C ≔ C + op(L)·D·B with lower left tridiagonal L,
     diagonal D and general B

◆ multiply_llt_d_left() [2/2]

void Hpro::multiply_llt_d_left ( const value_t  alpha,
const TMatrix< value_t > *  L,
const TMatrix< value_t > *  D,
TMatrix< value_t > *  B,
const matop_t  op_L,
const TTruncAcc acc 
)
     Compute B ≔ op(L)·D·B with lower left tridiagonal L and
     diagonal D.

◆ multiply_llt_d_ll()

void Hpro::multiply_llt_d_ll ( const TMatrix< value_t > *  L,
const TMatrix< value_t > *  D,
TMatrix< value_t > *  C,
const matop_t  op_L,
const TTruncAcc acc 
)
     Compute C ≔ C + L^T·D·L with lower left tridiagonal L and
     diagonal D.

◆ multiply_ur_ll()

void Hpro::multiply_ur_ll ( const TMatrix< value_t > *  U,
const TMatrix< value_t > *  L,
TMatrix< value_t > *  A,
const TTruncAcc acc,
const eval_option_t opts_U,
const eval_option_t opts_L 
)
     Compute A ≔ A + U·L with lower left tridiagonal L and
     upper right tridiagonal U.