forked from yixuan/RcppNumerical
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecl.h
More file actions
89 lines (67 loc) · 1.49 KB
/
decl.h
File metadata and controls
89 lines (67 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
decl.h
Type declarations
this file is part of Cuhre
last modified 21 Jul 14 th
*/
#include "stddecl.h"
typedef struct {
real avg, err;
count bisectdim;
} Result;
typedef const Result cResult;
typedef struct {
real avg, err, lastavg, lasterr;
real weightsum, avgsum;
real guess, chisum, chisqsum, chisq;
} Totals;
typedef const Totals cTotals;
typedef struct {
real lower, upper;
} Bounds;
typedef const Bounds cBounds;
enum { nrules = 5 };
typedef struct {
count n;
real weight[nrules], scale[nrules], norm[nrules];
real gen[];
} Set;
#define SetSize (sizeof(Set) + t->ndim*sizeof(real))
typedef struct {
Set *first, *last;
real errcoeff[3];
count n;
} Rule;
typedef const Rule cRule;
typedef int (*Integrand)(ccount *, creal *, ccount *, real *,
void *, cnumber *, cint *);
typedef struct _this {
count ndim, ncomp;
#ifndef MLVERSION
Integrand integrand;
void *userdata;
number nvec;
#ifdef HAVE_FORK
SHM_ONLY(int shmid;)
Spin *spin;
#endif
#endif
real *frame;
real epsrel, epsabs;
int flags;
number mineval, maxeval;
count key, nregions;
cchar *statefile;
number neval;
Rule rule;
jmp_buf abort;
} This;
#define nframe rule.n
typedef const This cThis;
typedef struct region {
count div;
Bounds bounds[];
} Region;
#define RegionSize (sizeof(Region) + t->ndim*sizeof(Bounds) + t->ncomp*sizeof(Result))
#define RegionResult(r) ((Result *)(r->bounds + t->ndim))
#define RegionPtr(p, n) ((Region *)((char *)p->region + (n)*regionsize))