Skip to content

Commit 66ac0fd

Browse files
fix: fix constructorof for SDEProblem handling f::AbstractSDEFunction
1 parent ce6ca68 commit 66ac0fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/problems/sde_problems.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,14 @@ function ConstructionBase.constructorof(::Type{P}) where {P <: SDEProblem}
129129
function ctor(f, g, u0, tspan, p, noise, kw, noise_rate_prototype, seed)
130130
if f isa AbstractSDEFunction
131131
iip = isinplace(f)
132+
if g !== f.g
133+
f = remake(f; g)
134+
end
135+
return SDEProblem{iip}(f, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
132136
else
133137
iip = isinplace(f, 4)
138+
return SDEProblem{iip}(f, g, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
134139
end
135-
return SDEProblem{iip}(f, g, u0, tspan, p; kw..., noise, noise_rate_prototype, seed)
136140
end
137141
end
138142

0 commit comments

Comments
 (0)