H2Lib  3.0
h2compression.h
Go to the documentation of this file.
1 /* ------------------------------------------------------------
2  This is the file "h2compression.h" of the H2Lib package.
3  All rights reserved, Steffen Boerm 2011
4  ------------------------------------------------------------ */
5 
10 #ifndef H2COMPRESSION_H
11 #define H2COMPRESSION_H
12 
27 typedef struct _truncblock truncblock;
28 
31 
32 #include "h2matrix.h"
33 #include "hmatrix.h"
34 #include "truncation.h"
35 
36 /* ------------------------------------------------------------
37  High-level compression functions
38  ------------------------------------------------------------ */
39 
50 
60 
73 compress_h2matrix_h2matrix(pch2matrix G, bool rbortho, bool cbortho,
74  pctruncmode tm, real eps);
75 
90  pctruncmode tm, real eps);
91 
92 /* ------------------------------------------------------------
93  Compute local and total weights for H^2-matrices
94  ------------------------------------------------------------ */
95 
121 HEADER_PREFIX void
123  pctruncmode tm, pclusteroperator rlw);
124 
150 HEADER_PREFIX void
152  pctruncmode tm, pclusteroperator clw);
153 
189 HEADER_PREFIX void
192  pclusteroperator clw);
193 
205 HEADER_PREFIX void
207  pclusteroperator lw);
208 
227 HEADER_PREFIX void
228 totalweights_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm,
230 
231 /* ------------------------------------------------------------
232  Compute truncated cluster basis
233  ------------------------------------------------------------ */
234 
254 HEADER_PREFIX void
256  pcclusteroperator clw, pctruncmode tm, real eps, pclusterbasis cbnew,
258 
259 /* ------------------------------------------------------------
260  Compute adaptive cluster bases for an H^2-matrix
261  ------------------------------------------------------------ */
262 
276 buildrowbasis_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm,
278 
292 buildcolbasis_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm,
294 
313 HEADER_PREFIX void
314 truncrowbasis_h2matrix(ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm,
316 
335 HEADER_PREFIX void
336 trunccolbasis_h2matrix(ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm,
338 
339 /* ------------------------------------------------------------
340  Approximate H^2-matrix in new cluster bases
341  ------------------------------------------------------------ */
342 
358 
368 HEADER_PREFIX void
371 
372 /* ------------------------------------------------------------
373  Specialized recompression routines for H^2-matrix arithmetic algorithms
374  ------------------------------------------------------------ */
375 
386 HEADER_PREFIX void
388 
402 HEADER_PREFIX void
404  pctruncmode tm);
405 
419 HEADER_PREFIX void
421  pctruncmode tm);
422 
432 HEADER_PREFIX void
434  pctruncmode tm, real eps);
435 
444 HEADER_PREFIX void
446 
447 /* ------------------------------------------------------------
448  Unification
449  ------------------------------------------------------------ */
450 
453 struct _truncblock {
461 
465 
470 
473 };
474 
484 
488 HEADER_PREFIX void
490 
500 
521 
549 HEADER_PREFIX void
552 
582 HEADER_PREFIX void
586 
605 HEADER_PREFIX void
608 
609 /* ------------------------------------------------------------
610  Compute adaptive cluster bases for H-matrices
611  ------------------------------------------------------------ */
612 
621 
630 
631 /* ------------------------------------------------------------
632  Approximate H-matrix in new cluster bases
633  ------------------------------------------------------------ */
634 
645  pclusterbasis cb);
646 
647 /* ------------------------------------------------------------
648  Compute adaptive cluster bases for dense matrices
649  ------------------------------------------------------------ */
650 
660 
670 
671 /* ------------------------------------------------------------
672  Approximate dense matrix in new cluster bases
673  ------------------------------------------------------------ */
674 
685  pclusterbasis cb);
686 
689 #endif
void trunccolbasis_h2matrix(ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusterbasis cbnew, pclusteroperator old2new)
Construct an improved column basis for an -matrix.
void recompress_inplace_h2matrix(ph2matrix G, pctruncmode tm, real eps)
Recompress an -matrix.
void truncate_inplace_clusterbasis(pclusterbasis cb, pclusteroperator cw, pctruncmode tm, real eps)
Replace a cluster basis with a truncated basis.
Representation of a cluster operator.
Definition: clusteroperator.h:44
Representation of -matrices.
Definition: h2matrix.h:48
void del_truncblock(ptruncblock tb)
Delete a list of truncblock objects.
void unify_parallel_h2matrix(ph2matrix G, uint pardepth, pclusteroperator*rw1, pclusteroperator*cw1, pctruncmode tm, real eps, pclusteroperator*rw, pclusteroperator*cw)
Unify -submatrices into a large -matrix, experimental parallel implementation.
ptruncblock new_truncblock(pcclusterbasis cb, pcclusteroperator cw, ptruncblock next)
Create a new truncblock object.
void totalweights_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, pclusteroperator rw, pclusteroperator cw)
Construct total weights for a given -matrix.
void rowweights_h2matrix(pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator rlw)
Prepare local row weights for a given -matrix.
Representation of -matrices.
Definition: hmatrix.h:49
Representation of a cluster basis.
Definition: clusterbasis.h:40
unsigned uint
Unsigned integer type.
Definition: settings.h:70
ph2matrix compress_symmetric_h2matrix_h2matrix(pch2matrix G, bool rbortho, pctruncmode tm, real eps)
Approximate a symmetric -matrix, represented by an h2matrix object, by a recompressed -matrix...
void orthoweight_clusterbasis(pclusterbasis cb)
Compute cluster weights and store them in the cluster basis.
pclusterbasis buildcolbasis_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusteroperator old2new)
Construct an improved row basis for an -matrix.
pclusterbasis buildrowbasis_hmatrix(pchmatrix G, pctruncmode tm, real eps)
Construct a row basis for a hierarchical matrix.
double _Complex field
Field type.
Definition: settings.h:171
ph2matrix compress_hmatrix_h2matrix(pchmatrix G, pctruncmode tm, real eps)
Approximate a hierarchical matrix, represented by an hmatrix object, by an -matrix.
truncblock * ptruncblock
Pointer to truncblock object.
Definition: h2compression.h:30
void totalweight_row_clusteroperator(pclusterbasis rb, pclusteroperator rw, pctruncmode tm)
Compute total row weights of a matrix.
pclusterbasis unify_clusterbasis(pccluster t, ptruncblock tb, pctruncmode tm, real eps, pclusteroperator*cw)
Construct a unified cluster basis.
void localweights_h2matrix(pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator rlw, pclusteroperator clw)
Prepare local weights for a given -matrix.
void unify_h2matrix(ph2matrix G, pclusteroperator*rw1, pclusteroperator*cw1, pctruncmode tm, real eps, pclusteroperator*rw, pclusteroperator*cw)
Unify -submatrices into a large -matrix.
clusteroperator tmp_cw
Temporary storage, used to handle partial cluster bases.
Definition: h2compression.h:469
pclusterbasis buildcolbasis_amatrix(pcamatrix G, pcblock b, pctruncmode tm, real eps)
Construct a column basis for an array matrix.
ph2matrix compress_amatrix_h2matrix(pcamatrix G, pcblock b, pctruncmode tm, real eps)
Approximate a matrix, represented by an amatrix object, by an -matrix.
ph2matrix build_projected_h2matrix(pch2matrix G, pclusterbasis rb, pcclusteroperator ro, pclusterbasis cb, pcclusteroperator co)
Construct an -matrix approximation of a given -matrix in new cluster bases by blockwise projection...
void totalweight_col_clusteroperator(pclusterbasis cb, pclusteroperator cw, pctruncmode tm)
Compute total column weights of a matrix.
ptruncblock next
Next truncblock in list.
Definition: h2compression.h:472
ph2matrix build_projected_amatrix_h2matrix(pcamatrix G, pcblock b, pclusterbasis rb, pclusterbasis cb)
Construct an -matrix approximation of a given array matrix in given cluster bases by blockwise projec...
pclusterbasis buildcolbasis_hmatrix(pchmatrix G, pctruncmode tm, real eps)
Construct a column basis for a hierarchical matrix.
Define different strategies used by various truncation and compression algorithms for hmatrices and h...
Definition: truncation.h:43
void truncate_clusterbasis(pcclusterbasis cb, pcclusteroperator cw, pcclusteroperator clw, pctruncmode tm, real eps, pclusterbasis cbnew, pclusteroperator old2new)
Compute a truncated cluster basis.
void convert_rkmatrix_uniform(pcrkmatrix r, puniform u, pctruncmode tm, pclusteroperator*rw, pclusteroperator*cw)
Converts an rkmatrix into a uniform matrix.
void truncrowbasis_h2matrix(ph2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusterbasis rbnew, pclusteroperator old2new)
Construct an improved row basis for an -matrix.
ph2matrix build_projected_hmatrix_h2matrix(pchmatrix G, pclusterbasis rb, pclusterbasis cb)
Construct an -matrix approximation of a given hierarchical matrix in given cluster bases by blockwise...
Description of basis and weights for one submatrix in the unification algorithm.
Definition: h2compression.h:453
ph2matrix compress_h2matrix_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps)
Approximate an -matrix, represented by an h2matrix object, by a recompressed -matrix.
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 obtai...
pclusterbasis buildrowbasis_amatrix(pcamatrix G, pcblock b, pctruncmode tm, real eps)
Construct a row basis for an array matrix.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
pcclusterbasis cb
Cluster basis of the submatrix.
Definition: h2compression.h:455
double real
real floating point type.
Definition: settings.h:97
ptruncblock reverse_truncblock(ptruncblock tb)
Reverse the order of a list of truncblock objects.
pcclusteroperator cw
Total weights for cb.
Definition: h2compression.h:457
void project_inplace_h2matrix(ph2matrix G, pclusterbasis rb, pcclusteroperator ro, pclusterbasis cb, pcclusteroperator co)
Switch the cluster bases of an -matrix by applying blockwise projections.
Representation of block trees.
Definition: block.h:48
Representation of cluster trees.
Definition: cluster.h:40
field cw_factor
Optional scaling factor for cw, required to apply aging factors to partial cluster bases...
Definition: h2compression.h:460
Representation of an admissible block for -matrices.
Definition: uniform.h:69
Representation of a low-rank matrix in factorized form .
Definition: rkmatrix.h:36
clusterbasis tmp_cb
Temporary storage, used to handle partial cluster bases.
Definition: h2compression.h:467
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
void colweights_h2matrix(pch2matrix G, pcclusteroperator rbw, pcclusteroperator cbw, pctruncmode tm, pclusteroperator clw)
Prepare local column weights for a given -matrix.
pclusteroperator old2new
Will be filled by basis change operator from cb to the new unified basis.
Definition: h2compression.h:464
pclusterbasis buildrowbasis_h2matrix(pch2matrix G, bool rbortho, bool cbortho, pctruncmode tm, real eps, pclusteroperator old2new)
Construct an improved row basis for an -matrix.