H2Lib  3.0
h2arith.h
Go to the documentation of this file.
1 
11 /*@todo extend the function prototypes to general cases*/
12 #ifndef H2ARITH_H
13 #define H2ARITH_H
14 
15 #include "clusteroperator.h"
16 #include "h2matrix.h"
17 #include "h2compression.h"
18 #include "h2update.h"
19 
28 /* ------------------------------------------------------------
29  Auxiliary functions
30  ------------------------------------------------------------ */
31 
41 
51 
52 
57 HEADER_PREFIX void
59 
60 /* ------------------------------------------------------------
61  Sum
62  ------------------------------------------------------------ */
63 
74 HEADER_PREFIX void
77  ptruncmode tm, real tol);
78 
79 /* ------------------------------------------------------------
80  Convert functions
81  ------------------------------------------------------------ */
82 
90 convert_h2matrix_amatrix(bool atrans, pch2matrix a);
91 
92 /* static or in clusterbasis ??? */
96 HEADER_PREFIX void
98 
107 convert_uniform_rkmatrix(bool atrans, pcuniform a);
108 
117 
118 /* ------------------------------------------------------------
119  Multiplication
120  ------------------------------------------------------------ */
121 
130 mul_h2matrix_rkmatrix(pch2matrix a, bool btrans, pch2matrix B, real tol);
131 
145 HEADER_PREFIX void
146 addmul_h2matrix(field alpha, pch2matrix a, bool btrans, pch2matrix B,
148  ptruncmode tm, real tol);
149 
161  ph2matrix h2, ptruncmode tm, real tol);
162 
163 /* ------------------------------------------------------------
164  Inversion
165  ------------------------------------------------------------ */
166 
182 HEADER_PREFIX void
185  ptruncmode tm, real tol);
186 
187 /* ------------------------------------------------------------
188  Forward / backward substitution
189  ------------------------------------------------------------ */
190 
198 HEADER_PREFIX void
199 lowersolve_h2matrix_avector(bool unit, bool atrans, pch2matrix a, pavector x);
200 
208 HEADER_PREFIX void
209 uppersolve_h2matrix_avector(bool unit, bool atrans, pch2matrix a, pavector x);
210 
211 
212 
221 HEADER_PREFIX void
222 lowersolve_h2matrix_amatrix(bool unit, bool atrans, pch2matrix a,
223  bool xtrans, pamatrix X);
224 
225 
235 HEADER_PREFIX void
236 uppersolve_h2matrix_amatrix(bool unit, bool atrans, pch2matrix a,
237  bool xtrans, pamatrix X);
238 
255 HEADER_PREFIX void
256 lowersolve_amatrix_h2matrix(bool aunit, bool atrans, pcamatrix a,
257  bool xytrans, pch2matrix X,
259  ptruncmode tm, real tol);
260 
278 HEADER_PREFIX void
279 uppersolve_amatrix_h2matrix(bool aunit, bool atrans, pcamatrix a,
280  bool ytrans, ph2matrix Y, pclusteroperator rwf, pclusteroperator cwf,
281  ptruncmode tm, real tol);
282 
304 HEADER_PREFIX void
305 lowersolve_h2matrix(bool aunit, bool atrans, pch2matrix a,
306  bool xytrans, ph2matrix X, pclusteroperator xrwf, pclusteroperator xcwf,
308  ptruncmode tm, real tol);
309 
327 HEADER_PREFIX void
328 uppersolve_h2matrix(bool aunit, bool atrans, pch2matrix a,
329  bool ytrans, ph2matrix Y, pclusteroperator yrwf, pclusteroperator ycwf,
330  ptruncmode tm, real tol);
331 
332 /* ------------------------------------------------------------
333  LR decomposition
334  ------------------------------------------------------------ */
335 
356 HEADER_PREFIX void
360  ptruncmode tm, real tol);
361 
367 HEADER_PREFIX void
369 
370 
371 /* ------------------------------------------------------------
372  Cholesky decomposition
373  ------------------------------------------------------------ */
374 
382 HEADER_PREFIX void
384  ptruncmode tm);
385 
401 HEADER_PREFIX void
404  ptruncmode tm, real tol);
405 
410 HEADER_PREFIX void
412 
415 #endif
void lrsolve_h2matrix_avector(pch2matrix L, pch2matrix R, pavector x)
prkmatrix convert_uniform_rkmatrix(bool atrans, pcuniform a)
converts an uniform matrix to a new rkmatrix uses fastaddmul_clusterbasis_amatrix ...
Representation of a cluster operator.
Definition: clusteroperator.h:44
void add_hmatrix_h2matrix(pchmatrix a, ph2matrix B, pclusteroperator rwf, pclusteroperator cwf, ptruncmode tm, real tol)
Definition: avector.h:39
ph2matrix build_from_block_lower_h2matrix(pcblock b, pclusterbasis rb, pclusterbasis cb)
builds a lower triangular H2-matrix based on block tree b
Representation of -matrices.
Definition: h2matrix.h:48
void uppersolve_h2matrix_amatrix(bool unit, bool atrans, pch2matrix a, bool xtrans, pamatrix X)
computes or , using backward substitution
Representation of -matrices.
Definition: hmatrix.h:49
Representation of a cluster basis.
Definition: clusterbasis.h:40
void lowersolve_h2matrix_amatrix(bool unit, bool atrans, pch2matrix a, bool xtrans, pamatrix X)
computes or , using forward substitution
void choldecomp_h2matrix(ph2matrix a, pclusteroperator arwf, pclusteroperator acwf, ph2matrix L, pclusteroperator lrwf, pclusteroperator lcwf, ptruncmode tm, real tol)
computes the Cholesky decomposition of a and stores the result in L and R
double _Complex field
Field type.
Definition: settings.h:171
void lowersolve_amatrix_h2matrix(bool aunit, bool atrans, pcamatrix a, bool xytrans, pch2matrix X, ph2matrix Y, pclusteroperator rwf, pclusteroperator cwf, ptruncmode tm, real tol)
computes or , using forward substitution
ph2matrix mul_h2matrix(field alpha, ph2matrix a, ph2matrix B, ph2matrix h2, ptruncmode tm, real tol)
computes and converts it to a new h2matrix
void lowersolve_h2matrix_avector(bool unit, bool atrans, pch2matrix a, pavector x)
computes , using forward substitution
void addmul_h2matrix(field alpha, pch2matrix a, bool btrans, pch2matrix B, ph2matrix C, pclusteroperator rwf, pclusteroperator cwf, ptruncmode tm, real tol)
void invert_h2matrix(ph2matrix a, pclusteroperator arwf, pclusteroperator acwf, ph2matrix B, pclusteroperator brwf, pclusteroperator bcwf, ptruncmode tm, real tol)
void lowersolve_h2matrix(bool aunit, bool atrans, pch2matrix a, bool xytrans, ph2matrix X, pclusteroperator xrwf, pclusteroperator xcwf, ph2matrix Y, pclusteroperator yrwf, pclusteroperator ycwf, ptruncmode tm, real tol)
computes or , using forward substitution
ph2matrix build_from_block_upper_h2matrix(pcblock b, pclusterbasis rb, pclusterbasis cb)
builds a upper triangular H2-matrix based on block tree b
void tolower_h2matrix(ph2matrix a)
Clears all upper diagonal blocks of a h2matrix.
Define different strategies used by various truncation and compression algorithms for hmatrices and h...
Definition: truncation.h:43
void uppersolve_amatrix_h2matrix(bool aunit, bool atrans, pcamatrix a, bool ytrans, ph2matrix Y, pclusteroperator rwf, pclusteroperator cwf, ptruncmode tm, real tol)
computes or , using backward substitution
pamatrix convert_h2matrix_amatrix(bool atrans, pch2matrix a)
converts an h2matrix to a new amatrix
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
double real
real floating point type.
Definition: settings.h:97
void cholsolve_h2matrix_avector(pch2matrix a, pavector x)
prkmatrix mul_h2matrix_rkmatrix(pch2matrix a, bool btrans, pch2matrix B, real tol)
computes and converts it to a new rkmatrix
Representation of block trees.
Definition: block.h:48
void fastaddmul_clusterbasis_amatrix(pcclusterbasis cb, pamatrix Yt, pamatrix Y)
computes
void init_cholesky_h2matrix(ph2matrix a, pclusteroperator*prwf, pclusteroperator*pcwf, ptruncmode tm)
initialises a, rwf and cwf for choldecomp_h2matrix
Representation of an admissible block for -matrices.
Definition: uniform.h:69
Representation of a low-rank matrix in factorized form .
Definition: rkmatrix.h:36
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
void uppersolve_h2matrix(bool aunit, bool atrans, pch2matrix a, bool ytrans, ph2matrix Y, pclusteroperator yrwf, pclusteroperator ycwf, ptruncmode tm, real tol)
computes or , using backward substitution
void uppersolve_h2matrix_avector(bool unit, bool atrans, pch2matrix a, pavector x)
computes , using backward substitution
void lrdecomp_h2matrix(ph2matrix a, pclusteroperator arwf, pclusteroperator acwf, ph2matrix L, pclusteroperator lrwf, pclusteroperator lcwf, ph2matrix R, pclusteroperator rrwf, pclusteroperator rcwf, ptruncmode tm, real tol)
computes the LR-decomposition of a, L has unit diagonal
phmatrix convert_h2matrix_hmatrix(pch2matrix a)
converts an h2matrix to a new hmatrix