Skip to content

Commit c55ab21

Browse files
committed
alias_noise keyword to solve.
When true, the default, it deepcopies the noise from and back to prob
1 parent 9923508 commit c55ab21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/solve.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function DiffEqBase.__solve(prob::DiffEqBase.AbstractRODEProblem,
55
kwargs...) where recompile_flag
66
integrator = DiffEqBase.__init(prob,alg,timeseries,ts,recompile;kwargs...)
77
solve!(integrator)
8-
if typeof(prob) <: DiffEqBase.AbstractRODEProblem && typeof(prob.noise) == typeof(integrator.sol.W)
9-
# would be better to make the following a function `noise_deepcopy!(W::T, Z::T) where {T <: AbstractNoiseProcess}` in `DiffEqNoiseProcess.jl`, but this should do it for the moment
8+
if typeof(prob) <: DiffEqBase.AbstractRODEProblem && typeof(prob.noise) == typeof(integrator.sol.W) && (!haskey(kwargs, :alias_noise) || kwargs[:alias_noise] == true)
9+
# would be better to make the following a function `noise_deepcopy!(W::T, Z::T) where {T <: AbstractNoiseProcess}` in `DiffEqNoiseProcess.jl` or a proper `copy` overload, but this should do it for the moment
1010
for x in fieldnames(typeof(prob.noise))
1111
setfield!(prob.noise, x, deepcopy(getfield(integrator.sol.W, x)))
1212
end
@@ -417,7 +417,7 @@ function DiffEqBase.__init(
417417
end
418418
=#
419419
end
420-
elseif typeof(prob) <: DiffEqBase.AbstractRODEProblem
420+
elseif typeof(prob) <: DiffEqBase.AbstractRODEProblem && (!haskey(kwargs, :alias_noise) || kwargs[:alias_noise] == true)
421421
W = deepcopy(prob.noise)
422422
if W.reset
423423
if W.curt != t

0 commit comments

Comments
 (0)