tgorordo revised this gist 3 months ago. Go to revision
1 file changed, 16 insertions
integral_solve.jl(file created)
| @@ -0,0 +1,16 @@ | |||
| 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 | |
Newer
Older