Skip to content

Commit 61c3026

Browse files
feat: add constructorof for SDEProblem
1 parent 598c7cd commit 61c3026

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/problems/sde_problems.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ function SDEProblem(f, g, u0, tspan, p = NullParameters(); kwargs...)
125125
SDEProblem{iip}(SDEFunction{iip}(f, g), u0, tspan, p; kwargs...)
126126
end
127127

128+
function ConstructionBase.constructorof(::Type{P}) where {P <: SDEProblem}
129+
function ctor(f, g, u0, tspan, p, noise, kw, noise_rate_prototype, seed)
130+
if f isa AbstractSDEFunction
131+
iip = isinplace(f)
132+
else
133+
iip = isinplace(f, 4)
134+
end
135+
return SDEProblem{iip}(f, g, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
136+
end
137+
end
138+
128139
"""
129140
$(TYPEDEF)
130141
"""

0 commit comments

Comments
 (0)