integral_solve.jl
· 501 B · Julia
Raw
using Integrals
# Recommended integration algorithms are:
# For scalar functions: QuadGKJL()
# For ≤ 8 dimensional vector functions: HCubatureJL()
# For > 8 dimensional vector functions: MonteCarloIntegration.vegas(f, st, en, kwargs...)
function Integrals.solve(p::IntegralProblem; kwargs...)
if length(p.lb) <= 1
return solve(p, QuadGKJL(); kwargs...)
elseif length(p.lb) <= 8
return solve(p, HCubatureJL(); kwargs...)
else # length(p.lb) > 8
return solve(p, VEGAS(); kwargs...)
end
end
| 1 | using Integrals |
| 2 | |
| 3 | # Recommended integration algorithms are: |
| 4 | # For scalar functions: QuadGKJL() |
| 5 | # For ≤ 8 dimensional vector functions: HCubatureJL() |
| 6 | # For > 8 dimensional vector functions: MonteCarloIntegration.vegas(f, st, en, kwargs...) |
| 7 | |
| 8 | function Integrals.solve(p::IntegralProblem; kwargs...) |
| 9 | if length(p.lb) <= 1 |
| 10 | return solve(p, QuadGKJL(); kwargs...) |
| 11 | elseif length(p.lb) <= 8 |
| 12 | return solve(p, HCubatureJL(); kwargs...) |
| 13 | else # length(p.lb) > 8 |
| 14 | return solve(p, VEGAS(); kwargs...) |
| 15 | end |
| 16 | end |