H2Lib  3.0
dblock.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  * This is the file "dblock.h" of the H2Lib package.
4  * All rights reserved, Steffen Boerm 2015
5  * ------------------------------------------------------------ */
6 
10 #ifndef DBLOCK_H
11 #define DBLOCK_H
12 
18 typedef struct _dblock dblock;
19 
21 typedef dblock *pdblock;
22 
24 typedef const dblock *pcdblock;
25 
27 typedef struct _diradmdata diradmdata;
28 
31 
33 typedef const diradmdata *pcdiradmdata;
34 
35 #include "dcluster.h"
36 #include "settings.h"
37 
38 #include <stdlib.h>
39 
40 #ifdef USE_CAIRO
41 #include <cairo.h>
42 #endif
43 
45 struct _dblock
46 {
51 
56 
58  bool adm;
59 
62 
65 
71 
74 };
75 
78 {
85 
94 
97 
100 
103 };
104 
105 /* ------------------------------------------------------------
106  * Constructors and destructors
107  * ------------------------------------------------------------ */
108 
120  uint rsons, uint csons);
121 
129 HEADER_PREFIX void
131 
135 HEADER_PREFIX void
137 
138 /* ------------------------------------------------------------
139  * Statistics
140  * ------------------------------------------------------------ */
141 
147 
153 HEADER_PREFIX size_t
155 
162 
163 /* ------------------------------------------------------------
164  * Drawing
165  * ------------------------------------------------------------ */
166 
167 #ifdef USE_CAIRO
168 
174 HEADER_PREFIX void
175 cairodraw_dblock(cairo_t *cr, pcdblock b, int levels);
176 #endif
177 
178 /* ------------------------------------------------------------
179  * Building standard block trees
180  * ------------------------------------------------------------ */
181 
192  bool (*admissible)(pdcluster rc, pdcluster cc, uint l,
193  uint *rd, uint *cd, void *data),
194  void *data);
195 
196 /* ------------------------------------------------------------
197  * Parabolic admissibility condition
198  * ------------------------------------------------------------ */
199 
218 HEADER_PREFIX bool
220  uint *rd, uint *cd, void *data);
221 
238 HEADER_PREFIX bool
240  uint *rd, uint *cd,
241  void *data);
242 
250 
251 /* ------------------------------------------------------------
252  * Remove directions
253  * ------------------------------------------------------------ */
254 
272 
273 /* ------------------------------------------------------------
274  * Enumeration
275  * ------------------------------------------------------------ */
276 
291 
294 #endif
Directional cluster tree.
Definition: dcluster.h:40
pdcluster rc
Row cluster.
Definition: dblock.h:48
uint cd
Column direction.
Definition: dblock.h:55
real wave_k
Wave number.
Definition: dblock.h:96
real eta2
Parabolic admissibility parameter.
Definition: dblock.h:93
uint getdepth_dblock(pcdblock b)
Compute the depth of a directional block tree.
pdblock build_dblock(pdcluster rc, pdcluster cc, uint l, bool(*admissible)(pdcluster rc, pdcluster cc, uint l, uint *rd, uint *cd, void *data), void *data)
Build a directional block tree.
unsigned uint
Unsigned integer type.
Definition: settings.h:70
pdcluster cc
Column cluster.
Definition: dblock.h:50
real eta1
Angular admissibility parameter.
Definition: dblock.h:84
diradmdata * pdiradmdata
Pointer to diradmdata.
Definition: dblock.h:30
pleveldir remove_unused_direction(pdblock b, pdcluster t, pleveldir lold)
Remove unused directions and set up new leveldir object.
size_t getsize_dblock(pcdblock b)
Compute the storage size of a directional block tree.
uint desc
Number of descendants, including this block.
Definition: dblock.h:73
bool standard_admissibility(pdcluster rc, pdcluster cc, uint l, uint *rd, uint *cd, void *data)
Standard admissibility condition.
Directional block tree.
Definition: dblock.h:45
preal xy
Auxiliary vector, used internally.
Definition: dblock.h:99
const dblock * pcdblock
Pointer to constant dblock.
Definition: dblock.h:24
void cairodraw_dblock(cairo_t *cr, pcdblock b, int levels)
Draw a directional block tree.
pdblock new_dblock(pdcluster rc, pdcluster cc, uint rd, uint cd, uint rsons, uint csons)
Create a new directional block.
uint rsons
Number of row sons.
Definition: dblock.h:61
uint csons
Number of column sons.
Definition: dblock.h:64
uint rd
Row direction.
Definition: dblock.h:53
bool parabolic_admissibility(pdcluster rc, pdcluster cc, uint l, uint *rd, uint *cd, void *data)
Parabolic admissibility condition.
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
double real
real floating point type.
Definition: settings.h:97
const diradmdata * pcdiradmdata
Pointer to constant diradmdata.
Definition: dblock.h:33
pdblock * enumerate_dblock(pdblock b)
Enumerates a directional block tree.
pcleveldir ld
Sets of directions for all levels of the cluster tree.
Definition: dblock.h:102
bool(* admissible)(pcluster rc, pcluster cc, void *data)
Callback function for an admissibility condition.
Definition: block.h:76
real * preal
Pointer to real array.
Definition: settings.h:145
Data for directional admissibility condition.
Definition: dblock.h:77
real getmaxeta_dblock(pcdblock b)
Compute the maximum of and for all admissible blocks.
Families of directions for all levels of the cluster tree.
Definition: dcluster.h:92
pdblock * son
Pointers to sons.
Definition: dblock.h:70
uint getactives_dblock()
Obtain the number of currently active directional blocks.
void del_dblock(pdblock b)
Delete a directional block tree.
bool adm
Admissibility flag.
Definition: dblock.h:58
void update_dblock(pdblock b)
Update a directional block.
dblock * pdblock
Pointer to dblock.
Definition: dblock.h:21