forked from yixuan/RcppNumerical
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCuhre.c
More file actions
48 lines (39 loc) · 1.07 KB
/
Cuhre.c
File metadata and controls
48 lines (39 loc) · 1.07 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
/*
Cuhre.c
Adaptive integration using cubature rules
by Thomas Hahn
last modified 22 Jul 14 th
*/
#define CUHRE
#define ROUTINE "Cuhre"
#include "decl.h"
#include "CSample.c"
/*********************************************************************/
Extern void EXPORT(Cuhre)(ccount ndim, ccount ncomp,
Integrand integrand, void *userdata, cnumber nvec,
creal epsrel, creal epsabs,
cint flags, cnumber mineval, cnumber maxeval,
ccount key, cchar *statefile, Spin **pspin,
count *pnregions, number *pneval, int *pfail,
real *integral, real *error, real *prob)
{
This t;
VerboseInit();
t.ndim = ndim;
t.ncomp = ncomp;
t.integrand = integrand;
t.userdata = userdata;
t.nvec = nvec;
t.epsrel = epsrel;
t.epsabs = epsabs;
t.flags = 4; /* MaxVerbose(flags); */ /* No verbose. -- Yixuan */
t.mineval = mineval;
t.maxeval = maxeval;
t.key = key;
t.statefile = statefile;
FORK_ONLY(t.spin = Invalid(pspin) ? NULL : *pspin;)
*pfail = Integrate(&t, integral, error, prob);
*pnregions = t.nregions;
*pneval = t.neval;
WaitCores(&t, pspin);
}