H2Lib  3.0
clusteroperator.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  This is the file "clusteroperator.h" of the H2Lib package.
4  All rights reserved, Steffen Boerm 2009
5  ------------------------------------------------------------ */
6 
11 #ifndef CLUSTEROPERATOR_H
12 #define CLUSTEROPERATOR_H
13 
32 
35 
38 
39 #include "cluster.h"
40 #include "clusterbasis.h"
41 #include "amatrix.h"
42 
45 {
48 
53 
56 
61 
64 };
65 
66 #define CLUSTEROPERATOR_TYPE_COMPLETE
67 
68 /* ------------------------------------------------------------
69  Constructors and destructors
70  ------------------------------------------------------------ */
71 
85 
99 
111 HEADER_PREFIX void
113 
127 
141 
151 HEADER_PREFIX void
153 
160 HEADER_PREFIX void
162 
163 /* ------------------------------------------------------------
164  Reference counting
165  ------------------------------------------------------------ */
166 
174 HEADER_PREFIX void
176 
185 HEADER_PREFIX void
187 
188 /* ------------------------------------------------------------
189  Low-level management
190  ------------------------------------------------------------ */
191 
200 HEADER_PREFIX void
202 
209 HEADER_PREFIX void
211 
223 
224 /* ------------------------------------------------------------
225  Build cluster operator based on cluster tree of cluster basis
226  ------------------------------------------------------------ */
227 
239 
253 
254 /* ------------------------------------------------------------
255  Statistics
256  ------------------------------------------------------------ */
257 
263 
270 HEADER_PREFIX size_t
272 
273 /* ------------------------------------------------------------
274  Debugging
275  ------------------------------------------------------------ */
276 
280 HEADER_PREFIX void
282 
292 HEADER_PREFIX void
294 
310 
311 /* ------------------------------------------------------------
312  Enumeration
313  ------------------------------------------------------------ */
314 
331 
332 /* ------------------------------------------------------------
333  Cluster basis product
334  ------------------------------------------------------------ */
335 
345 HEADER_PREFIX void
347  pclusteroperator pr);
348 
349 #endif
350 
351 /* ------------------------------------------------------------
352  * Access methods
353  * ------------------------------------------------------------ */
354 
355 /* Avoid problems with incomplete type definitions */
356 #if defined(CLUSTEROPERATOR_TYPE_COMPLETE) && !defined(CLUSTEROPERATOR_COMPLETE)
357 #define CLUSTEROPERATOR_COMPLETE
358 
359 #ifdef __GNUC__
361 getC_clusteroperator(pclusteroperator) __attribute__ ((unused));
362 #endif
363 
364 /* @brief Get the coefficient matrix @f$C@f$ of a @ref clusteroperator.
365  *
366  * @param co Cluster operator.
367  * @returns Coefficient matrix @f$C@f$ */
369 getC_clusteroperator(pclusteroperator co)
370 {
371  return &co->C;
372 }
373 
374 #endif
375 
size_t getsize_clusteroperator(pcclusteroperator co)
Get the size of a given clusteroperator object.
pclusteroperator new_clusteroperator(pccluster t)
Create a new clusteroperator object.
Representation of a cluster operator.
Definition: clusteroperator.h:44
pclusteroperator init_leaf_clusteroperator(pclusteroperator co, pccluster t)
Initialize a clusteroperator object for a leaf.
const clusteroperator* pcclusteroperator
Pointer to constant clusterbasis object.
Definition: clusteroperator.h:37
void print_tree_clusteroperator(pcclusteroperator co)
Print the tree structure of a clusteroperator.
Representation of a cluster basis.
Definition: clusterbasis.h:40
uint refs
References to this cluster operator.
Definition: clusteroperator.h:63
uint sons
Number of sons, either t->sons or zero.
Definition: clusteroperator.h:58
unsigned uint
Unsigned integer type.
Definition: settings.h:70
pclusteroperator build_from_cluster_clusteroperator(pccluster t)
Construct a clusteroperator matching a cluster tree.
void resize_clusteroperator(pclusteroperator co, uint krow, uint kcol)
Change the number of rows and columns of a cluster operator and resize cb->C accordingly.
void norm2diff_clusteroperator(pcclusteroperator co1, pcclusteroperator co2)
Compute and print the norms and norm differences of the coefficient matrices of two cluster operators...
uint getactives_clusteroperator()
Get number of active clusteroperator objects.
#define INLINE_PREFIX
Prefix for inline functions.
Definition: settings.h:36
void del_clusteroperator(pclusteroperator co)
Delete a clusteroperator object.
pclusteroperator init_clusteroperator(pclusteroperator co, pccluster t)
Initialize a clusteroperator object.
pclusteroperator identify_son_clusterweight_clusteroperator(pcclusteroperator cwf, pccluster t)
Find son clusteroperator matching a given cluster.
real compareweights_clusteroperator(pcclusteroperator co1, pcclusteroperator co2)
Compare two cluster weights.
clusteroperator* pclusteroperator
Pointer to clusteroperator object.
Definition: clusteroperator.h:34
void basisproduct_clusteroperator(pcclusterbasis cb1, pcclusterbasis cb2, pclusteroperator pr)
Compute the cluster basis product .
void uninit_clusteroperator(pclusteroperator co)
Uninitializes a clusteroperator object.
amatrix C
Coefficient matrix.
Definition: clusteroperator.h:55
uint kcol
Number of columns, usually equal to rank of corresponding cluster basis.
Definition: clusteroperator.h:52
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
void removesons_clusteroperator(pclusteroperator co)
Turn this clusteroperator into a leaf.
double real
real floating point type.
Definition: settings.h:97
pclusteroperator* enumerate_clusteroperator(pccluster t, pclusteroperator co)
Enumerate clusteroperator according to cluster tree.
pclusteroperator new_leaf_clusteroperator(pccluster t)
Creates a new clusteroperator object for a leaf.
uint krow
Number of rows.
Definition: clusteroperator.h:50
void update_clusteroperator(pclusteroperator co)
Updates bookkeeping information.
void unref_clusteroperator(pclusteroperator co)
Reduce the reference counter of a clusteroperator object.
Representation of cluster trees.
Definition: cluster.h:40
void ref_clusteroperator(pclusteroperator*ptr, pclusteroperator co)
Set a pointer to a clusterbasis object, increase its reference counter, and decrease reference counte...
pccluster t
Corresponding cluster.
Definition: clusteroperator.h:47
pclusteroperator* son
Pointers to sons.
Definition: clusteroperator.h:60
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
pclusteroperator build_from_clusterbasis_clusteroperator(pcclusterbasis cb)
Construct a clusteroperator matching a clusterbasis.