H2Lib  3.0
uniform.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  * This is the file "uniform.h" of the H2Lib package.
4  * All rights reserved, Steffen Boerm 2009
5  * ------------------------------------------------------------ */
6 
10 #ifndef UNIFORM_H
11 #define UNIFORM_H
12 
30 typedef struct _uniform uniform;
31 
33 typedef uniform *puniform;
34 
36 typedef const uniform *pcuniform;
37 
38 /* C STD LIBRARY */
39 /* CORE 0 */
40 #include "settings.h"
41 /* CORE 1 */
42 #include "amatrix.h"
43 /* CORE 2 */
44 #include "clusterbasis.h"
45 #include "clusteroperator.h"
46 #include "rkmatrix.h"
47 /* CORE 3 */
48 /* SIMPLE */
49 /* PARTICLES */
50 /* BEM */
51 
69 struct _uniform {
84 };
85 
86 /* ------------------------------------------------------------
87  * Constructors and destructors
88  * ------------------------------------------------------------ */
89 
105 
113 HEADER_PREFIX void
115 
116 /* ------------------------------------------------------------
117  * Reference management
118  * ------------------------------------------------------------ */
119 
132 HEADER_PREFIX void
134 
147 HEADER_PREFIX void
149 
159 HEADER_PREFIX void
161 
171 HEADER_PREFIX void
173 
174 /* ------------------------------------------------------------
175  * Statistics
176  * ------------------------------------------------------------ */
177 
182 HEADER_PREFIX size_t
184 
185 /* ------------------------------------------------------------
186  * Simple utility functions
187  * ------------------------------------------------------------ */
188 
194 HEADER_PREFIX void
196 
202 HEADER_PREFIX void
203 copy_uniform(bool trans, pcuniform src, puniform trg);
204 
211 
216 HEADER_PREFIX void
217 scale_uniform(field alpha, puniform u);
218 
222 HEADER_PREFIX void
224 
226 // * @brief Computes the euclidean-norm of the coupling matrix and or the product
227 // * of weight matrices with the coupling matrix.
228 // *
229 // * Depending on given row- and column-@ref _clusteroperator "clusteroperators"
230 // * this functions computed one of the following four values via
231 // * vector iteration:
232 // * @f[
233 // * \lVert S_b \rVert_2, \quad \lVert C_t S_b \rVert_2, \quad
234 // * \lVert S_b C_s^* \rVert_2 \quad \text{or} \quad \lVert C_t S_b C_s^* \rVert_2
235 // * @f]
236 // *
237 // * @param u @ref _uniform "uniform" object.
238 // * @param rw Row @ref _clusteroperator "clusteroperator". If <tt>rw == NULL</tt>
239 // * then @f$ C_t @f$ is omitted in the computation of the norm.
240 // * @param cw Column @ref _clusteroperator "clusteroperator". If <tt>cw == NULL</tt>
241 // * then @f$ C_s @f$ is omitted in the computation of the norm.
242 // *
243 // * @return Approximation of the euclidean-norm of one of the above mentioned
244 // * matrices.
245 // */
246 //HEADER_PREFIX real
247 //norm2_fast_uniform(pcuniform u, pcclusteroperator rw, pcclusteroperator cw);
248 //
250 // * @brief Computes the frobenius-norm of the coupling matrix and or the product
251 // * of weight matrices with the coupling matrix.
252 // *
253 // * Depending on given row- and column-@ref _clusteroperator "clusteroperators"
254 // * this functions computed one of the following four values:
255 // * @f[
256 // * \lVert S_b \rVert_F, \quad \lVert C_t S_b \rVert_F, \quad
257 // * \lVert S_b C_s^* \rVert_F \quad \text{or} \quad \lVert C_t S_b C_s^* \rVert_F
258 // * @f]
259 // *
260 // * @param u @ref _uniform "uniform" object.
261 // * @param rw Row @ref _clusteroperator "clusteroperator". If <tt>rw == NULL</tt>
262 // * then @f$ C_t @f$ is omitted in the computation of the norm.
263 // * @param cw Column @ref _clusteroperator "clusteroperator". If <tt>cw == NULL</tt>
264 // * then @f$ C_s @f$ is omitted in the computation of the norm.
265 // *
266 // * @return Approximation of the frobenius-norm of one of the above mentioned
267 // * matrices.
268 // */
269 //HEADER_PREFIX real
270 //normfrob_fast_uniform(pcuniform u, pcclusteroperator rw, pcclusteroperator cw);
271 
272 /* ------------------------------------------------------------
273  * Matrix-vector multiplication
274  * ------------------------------------------------------------ */
275 
289 HEADER_PREFIX void
290 mvm_uniform_avector(field alpha, bool trans, pcuniform u, pcavector x, pavector y);
291 
292 /* ------------------------------------------------------------
293  * Conversion operations
294  * ------------------------------------------------------------ */
295 
320 HEADER_PREFIX void
322  puniform unew);
323 
343 HEADER_PREFIX void
346 
360 HEADER_PREFIX void
362 
363 #endif
364 
365 /* ------------------------------------------------------------
366  * Access methods
367  * ------------------------------------------------------------ */
368 
369 /* Avoid problems with incomplete type definitions */
370 #if defined(CLUSTERBASIS_TYPE_COMPLETE) && !defined(UNIFORM_COMPLETE)
371 #define UNIFORM_COMPLETE
372 
373 #ifdef __GNUC__
375 getrows_uniform(pcuniform) __attribute__ ((const,unused));
377 getcols_uniform(pcuniform) __attribute__ ((const,unused));
379 getS_uniform(puniform) __attribute__ ((unused));
380 #endif
381 
388 {
389  return u->rb->t->size;
390 }
391 
398 {
399  return u->cb->t->size;
400 }
401 
408 {
409  return &u->S;
410 }
411 
412 #endif
413 
void add_projected_uniform(pcuniform u, pcclusteroperator ro, pcclusteroperator co, puniform unew)
Addition of two uniform matrices in different clusterbasis.
const uniform * pcuniform
Pointer to a constant uniform object.
Definition: uniform.h:36
Representation of a cluster operator.
Definition: clusteroperator.h:44
Definition: avector.h:39
puniform clone_uniform(pcuniform src)
Clone a uniform matrix.
pclusterbasis cb
Column clusterbasis.
Definition: uniform.h:73
Representation of a cluster basis.
Definition: clusterbasis.h:40
uint getcols_uniform(pcuniform u)
Get the number of columns of a uniform matrix .
Definition: uniform.h:397
unsigned uint
Unsigned integer type.
Definition: settings.h:70
void del_uniform(puniform u)
Deletes an uniform object.
double _Complex field
Field type.
Definition: settings.h:171
void unref_row_uniform(puniform u)
Remove block row references to an uniform object.
pccluster t
Corresponding cluster.
Definition: clusterbasis.h:42
size_t getsize_uniform(pcuniform u)
Get size of a given uniform object.
uniform * puniform
Pointer to uniform object.
Definition: uniform.h:33
#define INLINE_PREFIX
Prefix for inline functions.
Definition: settings.h:36
pamatrix getS_uniform(puniform u)
Get the factor S of a uniform matrix .
Definition: uniform.h:407
void scale_uniform(field alpha, puniform u)
Scale a uniform matrix.
void random_uniform(puniform u)
Fill a uniform matrix with random coefficients.
void ref_col_uniform(puniform u, pclusterbasis cb)
Append this uniform object to the block column list.
void copy_uniform(bool trans, pcuniform src, puniform trg)
Copy a uniform matrix .
puniform cnext
Next column block in list.
Definition: uniform.h:81
uint getrows_uniform(pcuniform u)
Get the number of rows of a uniform matrix .
Definition: uniform.h:387
puniform rprev
Previous row block in list.
Definition: uniform.h:79
void ref_row_uniform(puniform u, pclusterbasis rb)
Append this uniform object to the block row list.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
puniform rnext
Next row block in list.
Definition: uniform.h:77
void add_rkmatrix_uniform(pcrkmatrix r, puniform unew)
Adds a low rank matrix to an uniform matrix.
puniform cprev
Previous column block in list.
Definition: uniform.h:83
void mvm_uniform_avector(field alpha, bool trans, pcuniform u, pcavector x, pavector y)
Computes the euclidean-norm of the coupling matrix and or the product of weight matrices with the cou...
Representation of an admissible block for -matrices.
Definition: uniform.h:69
Representation of a low-rank matrix in factorized form .
Definition: rkmatrix.h:36
puniform new_uniform(pclusterbasis rb, pclusterbasis cb)
Create a new uniform object.
void project_inplace_uniform(puniform u, pclusterbasis rb, pcclusteroperator ro, pclusterbasis cb, pcclusteroperator co)
Project uniform matrix into new clusterbasis.
Representation of a matrix as an array in column-major order.
Definition: amatrix.h:43
void clear_uniform(puniform u)
Sets the coupling matrix to zero.
amatrix S
Coupling matrix.
Definition: uniform.h:75
void unref_col_uniform(puniform u)
Remove block column references to an uniform object.
uint size
Number of indices.
Definition: cluster.h:42
pclusterbasis rb
Row clusterbasis.
Definition: uniform.h:71