@@ -54,10 +54,10 @@ Return arrays of saved time points, states, and rates, initialized with the solu
5454first time point if `save_start = true` (the default).
5555"""
5656function solution_arrays (u:: uType , tspan, rate_prototype;
57- timeseries_init = typeof (u)[],
58- ts_init = eltype (tspan)[],
59- save_idxs = nothing ,
60- save_start = true ) where {uType}
57+ timeseries_init = typeof (u)[],
58+ ts_init = eltype (tspan)[],
59+ save_idxs = nothing ,
60+ save_start = true ) where {uType}
6161 # determine types of time and state
6262 # uType = typeof(u)
6363 tType = eltype (tspan)
@@ -108,10 +108,10 @@ Suggest that solution `sol` reserves capacity for a number of elements that
108108depends on the parameter settings of the numerical solver.
109109"""
110110function Base. sizehint! (sol:: RODESolution , alg, tspan, tstops, saveat;
111- save_everystep = isempty (saveat),
112- adaptive = StochasticDiffEq. isadaptive (getalg (alg)),
113- internalnorm = DiffEqBase. ODE_DEFAULT_NORM,
114- dt = zero (eltype (tspan)))
111+ save_everystep = isempty (saveat),
112+ adaptive = StochasticDiffEq. isadaptive (getalg (alg)),
113+ internalnorm = DiffEqBase. ODE_DEFAULT_NORM,
114+ dt = zero (eltype (tspan)))
115115 # obtain integration time
116116 t0 = first (tspan)
117117 integrationtime = last (tspan) - t0
@@ -137,11 +137,11 @@ function Base.sizehint!(sol::RODESolution, alg, tspan, tstops, saveat;
137137end
138138
139139function build_history_function (prob, alg, reltol, rate_prototype, noise_rate_prototype,
140- jump_prototype, W, _seed, dense;
141- dt = zero (eltype (prob. tspan)),
142- adaptive = StochasticDiffEq. isadaptive (getalg (alg)),
143- calck = false ,
144- internalnorm = DiffEqBase. ODE_DEFAULT_NORM)
140+ jump_prototype, W, _seed, dense;
141+ dt = zero (eltype (prob. tspan)),
142+ adaptive = StochasticDiffEq. isadaptive (getalg (alg)),
143+ calck = false ,
144+ internalnorm = DiffEqBase. ODE_DEFAULT_NORM)
145145 @unpack f, g, h, u0, tspan, p = prob
146146
147147 t0 = first (tspan)
@@ -170,52 +170,53 @@ function build_history_function(prob, alg, reltol, rate_prototype, noise_rate_pr
170170 sde_u, sde_uprev = u_uprev (u0; alias_u0 = false )
171171
172172 # # initialize output arrays
173- sde_ts, sde_timeseries, sde_saveiter = solution_arrays (sde_u, tspan, rate_prototype,
174- save_idxs = nothing ,
175- save_start = true )
173+ sde_ts, sde_timeseries,
174+ sde_saveiter = solution_arrays (sde_u, tspan, rate_prototype,
175+ save_idxs = nothing ,
176+ save_start = true )
176177
177178 # # obtain cache (we alias uprev2 and uprev)
178179 sde_cache = StochasticDiffEq. alg_cache (getalg (alg), prob, sde_u, W. dW, W. dZ, p,
179- rate_prototype, noise_rate_prototype,
180- jump_prototype, uEltypeNoUnits,
181- uBottomEltypeNoUnits, tTypeNoUnits, sde_uprev, f,
182- t0, dt, Val{isinplace (prob)})
180+ rate_prototype, noise_rate_prototype,
181+ jump_prototype, uEltypeNoUnits,
182+ uBottomEltypeNoUnits, tTypeNoUnits, sde_uprev, f,
183+ t0, dt, Val{isinplace (prob)})
183184
184185 # build dense interpolation of history
185186 id = StochasticDiffEq. LinearInterpolationData (sde_timeseries, sde_ts)
186187 if typeof (getalg (alg)) <: StochasticDiffEq.StochasticDiffEqCompositeAlgorithm
187188 alg_choice = Int[]
188189 sde_sol = DiffEqBase. build_solution (prob, alg, sde_ts, sde_timeseries, W = W,
189- stats = DiffEqBase. Stats (0 ),
190- calculate_error = false ,
191- alg_choice = alg_choice,
192- interp = id, dense = dense, seed = _seed)
190+ stats = DiffEqBase. Stats (0 ),
191+ calculate_error = false ,
192+ alg_choice = alg_choice,
193+ interp = id, dense = dense, seed = _seed)
193194 else
194195 sde_sol = DiffEqBase. build_solution (prob, alg, sde_ts, sde_timeseries, W = W,
195- stats = DiffEqBase. Stats (0 ),
196- calculate_error = false ,
197- interp = id, dense = dense, seed = _seed)
196+ stats = DiffEqBase. Stats (0 ),
197+ calculate_error = false ,
198+ interp = id, dense = dense, seed = _seed)
198199 end
199200
200201 # # reserve capacity
201202 sizehint! (sde_sol, getalg (alg), tspan, (), ();
202- save_everystep = true , adaptive = adaptive, internalnorm = internalnorm,
203- dt = tType (dt))
203+ save_everystep = true , adaptive = adaptive, internalnorm = internalnorm,
204+ dt = tType (dt))
204205
205206 # # create simple integrator
206207 sde_integrator = HistorySDEIntegrator{typeof (getalg (alg)), isinplace (prob),
207- typeof (prob. u0),
208- tType, typeof (sde_sol), typeof (sde_cache)}(sde_sol,
209- sde_u,
210- t0,
211- zero (tType),
212- sde_uprev,
213- t0,
214- getalg (alg),
215- zero (tType),
216- tdir,
217- 1 ,
218- sde_cache)
208+ typeof (prob. u0),
209+ tType, typeof (sde_sol), typeof (sde_cache)}(sde_sol,
210+ sde_u,
211+ t0,
212+ zero (tType),
213+ sde_uprev,
214+ t0,
215+ getalg (alg),
216+ zero (tType),
217+ tdir,
218+ 1 ,
219+ sde_cache)
219220
220221 # # combine the user-provided history function and the ODE integrator with dense solution
221222 # # to a joint dense history of the DDE
0 commit comments