Skip to content

Commit 00485a1

Browse files
Merge pull request #138 from ArnoStrouwen/polyalg
start poly alg
2 parents 4542c83 + 1e2aed8 commit 00485a1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/Integrals.jl

+28
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,34 @@ function transformation_if_inf(prob, do_inf_transformation = nothing)
198198
transformation_if_inf(prob, do_inf_transformation)
199199
end
200200

201+
function SciMLBase.solve(prob::IntegralProblem; sensealg = ReCallVJP(ZygoteVJP()),
202+
do_inf_transformation = nothing, kwargs...)
203+
if prob.batch != 0
204+
if prob.nout > 1
205+
error("Currently no default algorithm for the combination batch > 0 and nout > 1,
206+
try the methods in IntegralsCuba or IntegralsCubature")
207+
end
208+
return solve(prob, VEGAS(); sensealg = sensealg,
209+
do_inf_transformation = do_inf_transformation, kwargs...)
210+
end
211+
212+
if prob.nout > 1
213+
return solve(prob, HCubatureJL(); sensealg = sensealg,
214+
do_inf_transformation = do_inf_transformation, kwargs...)
215+
end
216+
217+
if prob.lb isa Number
218+
return solve(prob, QuadGKJL(); sensealg = sensealg,
219+
do_inf_transformation = do_inf_transformation, kwargs...)
220+
elseif length(prob.lb) > 8
221+
return solve(prob, VEGAS(); sensealg = sensealg,
222+
do_inf_transformation = do_inf_transformation, kwargs...)
223+
else
224+
return solve(prob, HCubatureJL(); sensealg = sensealg,
225+
do_inf_transformation = do_inf_transformation, kwargs...)
226+
end
227+
end
228+
201229
"""
202230
```julia
203231
solve(prob::IntegralProblem, alg::SciMLBase.AbstractIntegralAlgorithm; kwargs...)

0 commit comments

Comments
 (0)