-
-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Description
Migrated from PR: SciML/StochasticDiffEq.jl#507
Author: @axsk
Fixes: #3170
A fix for SROCK2 failing with NoiseWrapper noise for non-diagonal problems. The issue was that the code accessed W.rng which doesn't exist on NoiseWrapper.
Fix approach: Extract RNG access into a helper function with dispatch:
function init_χ!(vec_χ, W)
rand!(rng(W), vec_χ)
@.. vec_χ = 2*floor(vec_χ + 1//2) - 1
end
rng(W::DiffEqNoiseProcess.AbstractNoiseProcess) = W.rng
rng(W::NoiseWrapper) = W.source.rngThis also fixes SKSROCK which had the same issue. The fix was applied to both the out-of-place and in-place code paths in src/perform_step/SROCK_perform_step.jl.
Full diff preserved at: https://github.com/SciML/StochasticDiffEq.jl/pull/507.diff
Reactions are currently unavailable