@@ -21,7 +21,14 @@ Importance sampling is used to reduce variance.
21
21
publisher={Elsevier}
22
22
}
23
23
"""
24
- struct CubaVegas <: AbstractCubaAlgorithm end
24
+ struct CubaVegas <: AbstractCubaAlgorithm
25
+ flags:: Int
26
+ seed:: Int
27
+ minevals:: Int
28
+ nstart:: Int
29
+ nincrease:: Int
30
+ gridno:: Int
31
+ end
25
32
"""
26
33
CubaSUAVE()
27
34
@@ -40,7 +47,14 @@ Importance sampling and subdivision are thus used to reduce variance.
40
47
publisher={Elsevier}
41
48
}
42
49
"""
43
- struct CubaSUAVE <: AbstractCubaAlgorithm end
50
+ struct CubaSUAVE{R} <: AbstractCubaAlgorithm where {R <: Real }
51
+ flags:: Int
52
+ seed:: Int
53
+ minevals:: Int
54
+ nnew:: Int
55
+ nmin:: Int
56
+ flatness:: R
57
+ end
44
58
"""
45
59
CubaDivonne()
46
60
@@ -58,7 +72,19 @@ Stratified sampling is used to reduce variance.
58
72
publisher={ACM New York, NY, USA}
59
73
}
60
74
"""
61
- struct CubaDivonne <: AbstractCubaAlgorithm end
75
+ struct CubaDivonne{R1, R2, R3} < :
76
+ AbstractCubaAlgorithm where {R1 <: Real , R2 <: Real , R3 <: Real }
77
+ flags:: Int
78
+ seed:: Int
79
+ minevals:: Int
80
+ key1:: Int
81
+ key2:: Int
82
+ key3:: Int
83
+ maxpass:: Int
84
+ border:: R1
85
+ maxchisq:: R2
86
+ mindeviation:: R3
87
+ end
62
88
"""
63
89
CubaCuhre()
64
90
@@ -75,14 +101,33 @@ Multidimensional h-adaptive integration from Cuba.jl.
75
101
publisher={ACM New York, NY, USA}
76
102
}
77
103
"""
78
- struct CubaCuhre <: AbstractCubaAlgorithm end
104
+ struct CubaCuhre <: AbstractCubaAlgorithm
105
+ flags:: Int
106
+ minevals:: Int
107
+ key:: Int
108
+ end
109
+
110
+ function CubaVegas (; flags = 0 , seed = 0 , minevals = 0 , nstart = 1000 , nincrease = 500 ,
111
+ gridno = 0 )
112
+ CubaVegas (flags, seed, minevals, nstart, nincrease, gridno)
113
+ end
114
+ function CubaSUAVE (; flags = 0 , seed = 0 , minevals = 0 , nnew = 1000 , nmin = 2 ,
115
+ flatness = 25.0 )
116
+ CubaSUAVE (flags, seed, minevals, nnew, nmin, flatness)
117
+ end
118
+ function CubaDivonne (; flags = 0 , seed = 0 , minevals = 0 ,
119
+ key1 = 47 , key2 = 1 , key3 = 1 , maxpass = 5 , border = 0.0 ,
120
+ maxchisq = 10.0 , mindeviation = 0.25 )
121
+ CubaDivonne (flags, seed, minevals, key1, key2, key3, maxpass, border, maxchisq,
122
+ mindeviation)
123
+ end
124
+ CubaCuhre (; flags = 0 , minevals = 0 , key = 0 ) = CubaCuhre (flags, minevals, key)
79
125
80
126
function Integrals. __solvebp_call (prob:: IntegralProblem , alg:: AbstractCubaAlgorithm ,
81
127
sensealg,
82
128
lb, ub, p;
83
129
reltol = 1e-8 , abstol = 1e-8 ,
84
- maxiters = alg isa CubaSUAVE ? 1000000 : typemax (Int),
85
- kwargs... )
130
+ maxiters = alg isa CubaSUAVE ? 1000000 : typemax (Int))
86
131
@assert maxiters>= 1000 " maxiters for $alg should be larger than 1000"
87
132
prob = transformation_if_inf (prob) # intercept for infinite transformation
88
133
p = p
@@ -160,19 +205,29 @@ function Integrals.__solvebp_call(prob::IntegralProblem, alg::AbstractCubaAlgori
160
205
if alg isa CubaVegas
161
206
out = Cuba. vegas (f, ndim, prob. nout; rtol = reltol,
162
207
atol = abstol, nvec = nvec,
163
- maxevals = maxiters, kwargs... )
208
+ maxevals = maxiters,
209
+ flags = alg. flags, seed = alg. seed, minevals = alg. minevals,
210
+ nstart = alg. nstart, nincrease = alg. nincrease,
211
+ gridno = alg. gridno)
164
212
elseif alg isa CubaSUAVE
165
213
out = Cuba. suave (f, ndim, prob. nout; rtol = reltol,
166
214
atol = abstol, nvec = nvec,
167
- maxevals = maxiters, kwargs... )
215
+ maxevals = maxiters,
216
+ flags = alg. flags, seed = alg. seed, minevals = alg. minevals,
217
+ nnew = alg. nnew, nmin = alg. nmin, flatness = alg. flatness)
168
218
elseif alg isa CubaDivonne
169
219
out = Cuba. divonne (f, ndim, prob. nout; rtol = reltol,
170
220
atol = abstol, nvec = nvec,
171
- maxevals = maxiters, kwargs... )
221
+ maxevals = maxiters,
222
+ flags = alg. flags, seed = alg. seed, minevals = alg. minevals,
223
+ key1 = alg. key1, key2 = alg. key2, key3 = alg. key3,
224
+ maxpass = alg. maxpass, border = alg. border,
225
+ maxchisq = alg. maxchisq, mindeviation = alg. mindeviation)
172
226
elseif alg isa CubaCuhre
173
227
out = Cuba. cuhre (f, ndim, prob. nout; rtol = reltol,
174
228
atol = abstol, nvec = nvec,
175
- maxevals = maxiters, kwargs... )
229
+ maxevals = maxiters,
230
+ flags = alg. flags, minevals = alg. minevals, key = alg. key)
176
231
end
177
232
178
233
if isinplace (prob) || prob. batch != 0
0 commit comments