From e5bc151bf06774bd54a15761c8c9b5ee187c073a Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Wed, 27 Sep 2023 15:20:04 +0800 Subject: [PATCH] Fix SDEProblem constructor issues Signed-off-by: ErikQQY <2283984853@qq.com> --- Project.toml | 2 +- src/problems/sde_problems.jl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index f51f636ad..1a787c897 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.0.2" +version = "2.0.3" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/problems/sde_problems.jl b/src/problems/sde_problems.jl index 2e28757f5..5c850590c 100644 --- a/src/problems/sde_problems.jl +++ b/src/problems/sde_problems.jl @@ -109,6 +109,10 @@ struct SDEProblem{uType, tType, isinplace, P, NP, F, G, K, ND} <: noise, kwargs, noise_rate_prototype, seed) end + + function SDEProblem{iip}(f, g, u0, tspan, p = NullParameters(); kwargs...) where {iip} + SDEProblem(SDEFunction{iip}(f, g), u0, tspan, p; kwargs...) + end end TruncatedStacktraces.@truncate_stacktrace SDEProblem 3 1 2 @@ -118,7 +122,8 @@ function SDEProblem(f::AbstractSDEFunction, u0, tspan, p = NullParameters(); kwa end function SDEProblem(f, g, u0, tspan, p = NullParameters(); kwargs...) - SDEProblem(SDEFunction(f, g), u0, tspan, p; kwargs...) + iip = isinplace(f, 4) + SDEProblem{iip}(SDEFunction{iip}(f, g), u0, tspan, p; kwargs...) end """