H2Lib
3.0
|
Representation of cluster operators used to describe weights and transformations of cluster bases. More...
Data Structures | |
struct | _clusteroperator |
Representation of a cluster operator. More... | |
Typedefs | |
typedef struct _clusteroperator | clusteroperator |
Representation of a cluster operator. | |
typedef clusteroperator* | pclusteroperator |
Pointer to clusteroperator object. | |
typedef const clusteroperator* | pcclusteroperator |
Pointer to constant clusterbasis object. | |
Representation of cluster operators used to describe weights and transformations of cluster bases.
The clusteroperator class represents a cluster operator corresponding to a cluster basis such that and have the same number of columns.
Weight matrices for a cluster basis can be obtained using weight_clusterbasis_clusteroperator , total weight matrices for an h2matrix are available via totalweights_h2matrix.
void basisproduct_clusteroperator | ( | pcclusterbasis | cb1, |
pcclusterbasis | cb2, | ||
pclusteroperator | pr | ||
) |
Compute the cluster basis product .
pr
can only have sons if both cb1
and cb2
do. If pr
is a leaf, currently either cb1
or cb2
has to be a leaf.
cb1 | First cluster basis. |
cb2 | Second cluster basis. |
pr | Target cluster operator. |
pclusteroperator build_from_cluster_clusteroperator | ( | pccluster | t | ) |
Construct a clusteroperator matching a cluster tree.
Constructs a clusteroperator for a cluster and its descendants.
Row and column numbers will be set to zero.
t | Root cluster. |
t
and its descendants. pclusteroperator build_from_clusterbasis_clusteroperator | ( | pcclusterbasis | cb | ) |
Construct a clusteroperator matching a clusterbasis.
Constructs a clusteroperator for a clusterbasis and its descendants.
Row numbers will be set to zero, column numbers will be set to the ranks of the corresponding cluster basis.
cb | Root clusterbasis. |
cb
and its descendants. real compareweights_clusteroperator | ( | pcclusteroperator | co1, |
pcclusteroperator | co2 | ||
) |
Compare two cluster weights.
Compare the Gramians of two cluster operators and , i.e., compute for all clusters and return the maximum. This approach makes the result invariant under orthogonal transformations applied to the rows.
co1 | First clusteroperator . |
co2 | Second clusteroperator . |
void del_clusteroperator | ( | pclusteroperator | co | ) |
Delete a clusteroperator object.
Releases the storage corresponding to the object. If this clusteroperator references sons, these sons are unreferenced.
Only objects with cb->refs==0
may be deleted.
co | Object to be deleted. |
pclusteroperator* enumerate_clusteroperator | ( | pccluster | t, |
pclusteroperator | co | ||
) |
Enumerate clusteroperator according to cluster tree.
The clusteroperator elements are enumerated in an array of size t->desc
. The enumeration starts with 0
assigned to the root and then proceeds with co->son[0]
corresponding to the entries 1
to cb->son[0]->desc
in the array and ending with co->son[sons-1]
corresponding to the last t->son[sons-1]->desc
entries.
t | Cluster tree. |
co | Cluster operator matching the cluster tree given by t . |
t->desc
containing pointers to the clusteroperator objects corresponding to co
and its descendants. uint getactives_clusteroperator | ( | ) |
Get number of active clusteroperator objects.
size_t getsize_clusteroperator | ( | pcclusteroperator | co | ) |
Get the size of a given clusteroperator object.
Yields the total size of this object and all its descendants.
co | clusteroperator root. |
pclusteroperator identify_son_clusterweight_clusteroperator | ( | pcclusteroperator | cwf, |
pccluster | t | ||
) |
Find son clusteroperator matching a given cluster.
Find a son of cwf
matching the cluster t
. Returns cwf
if no son was found.
cwf | Father clusteroperator. |
t | Son cluster. |
cwf
with cwf->son[i]->t==t
if it exists and cwf
otherwise. pclusteroperator init_clusteroperator | ( | pclusteroperator | co, |
pccluster | t | ||
) |
Initialize a clusteroperator object.
Sets up the components of the object. If t
is not a leaf, the array son
is allocated, otherwise it is set to null.
co | Object to be initialized. |
t | Corresponding cluster. |
pclusteroperator init_leaf_clusteroperator | ( | pclusteroperator | co, |
pccluster | t | ||
) |
Initialize a clusteroperator object for a leaf.
Sets up the components of the object. Sets son
to null. If t->sons>0
, this yields a partial cluster operator.
co | Object to be initialized. |
t | Corresponding cluster. |
pclusteroperator new_clusteroperator | ( | pccluster | t | ) |
Create a new clusteroperator object.
Allocates storage for the object and sets up its components.
t | corresponding cluster. |
pclusteroperator new_leaf_clusteroperator | ( | pccluster | t | ) |
Creates a new clusteroperator object for a leaf.
Allocates storage for the object and sets up its components.
t | Corresponding cluster. |
void norm2diff_clusteroperator | ( | pcclusteroperator | co1, |
pcclusteroperator | co2 | ||
) |
Compute and print the norms and norm differences of the coefficient matrices of two cluster operators.
norm2diff
should return a value, e.g., the maximal norm, instead of printing to stdout
.co1 | First clusteroperator. |
co2 | Second clusteroperator. |
void print_tree_clusteroperator | ( | pcclusteroperator | co | ) |
Print the tree structure of a clusteroperator.
co | Root clusteroperator. |
void ref_clusteroperator | ( | pclusteroperator* | ptr, |
pclusteroperator | co | ||
) |
Set a pointer to a clusterbasis object, increase its reference counter, and decrease reference counter of original pointer target.
ptr | Pointer to the pclusteroperator variable that will be changed. |
co | clusteroperator that will be referenced. |
void removesons_clusteroperator | ( | pclusteroperator | co | ) |
Turn this clusteroperator into a leaf.
Unreferences all sons, sets co->sons
to zero and co->son
to null.
co | Target cluster operator. |
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.
co | Cluster operator that will be changed. |
krow | New number of rows. |
kcol | New number of columns. |
void uninit_clusteroperator | ( | pclusteroperator | co | ) |
Uninitializes a clusteroperator object.
Invalidates pointers, freeing corresponding storage if appropriate, and prepares the object for deletion.
If this clusteroperator references sons, these sons are unreferenced.
Only objects with cb->refs==0
may be uninitialized.
co | Object to be uninitialized. |
void unref_clusteroperator | ( | pclusteroperator | co | ) |
Reduce the reference counter of a clusteroperator object.
If the reference counter reaches zero, the object is deleted.
cb=NULL
instead, since this guarantees that the pointer is properly invalidated.co | clusteroperator that will be unreferenced. |
void update_clusteroperator | ( | pclusteroperator | co | ) |
Updates bookkeeping information.
This function should be called after the sons of a clusteroperator have been changed.
co | clusteroperator that will be updated. |