Skip to content

Commit c4af9f9

Browse files
Merge pull request #146 from KronosTheLate/throw_error_without_solver
Throw helpfull error if no algorithm is provided
2 parents e09548c + 157afc4 commit c4af9f9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Integrals.jl

+10
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ function SciMLBase.solve(prob::IntegralProblem,
107107
prob = transformation_if_inf(prob, do_inf_transformation)
108108
__solvebp(prob, alg, sensealg, prob.lb, prob.ub, prob.p; kwargs...)
109109
end
110+
# Throw error if alg is not provided, as defaults are not implemented.
111+
SciMLBase.solve(::IntegralProblem) = throw(ArgumentError("""
112+
No integration algorithm `alg` was supplied as the second positional argument.
113+
Reccomended integration algorithms are:
114+
For scalar functions: QuadGKJL()
115+
For ≤ 8 dimensional vector functions: HCubatureJL()
116+
For > 8 dimensional vector functions: MonteCarloIntegration.vegas(f, st, en, kwargs...)
117+
See the docstrings of the different algorithms for more detail.
118+
"""
119+
))
110120

111121
# Give a layer to intercept with AD
112122
__solvebp(args...; kwargs...) = __solvebp_call(args...; kwargs...)

0 commit comments

Comments
 (0)