@@ -352,26 +352,9 @@ function remake(prob::SDEProblem;
352352 if seed === missing
353353 seed = prob. seed
354354 end
355-
356- if f === missing && g === missing
357- f = prob. f
358- g = prob. g
359- elseif f != = missing && g === missing
360- g = prob. g
361- elseif f === missing && g != = missing
362- if prob. f isa SDEFunction
363- f = remake (prob. f; g = g)
364- else
365- f = SDEFunction (prob. f, g; sys = prob. f. sys)
366- end
367- else
368- if f isa SDEFunction
369- f = remake (f; g = g)
370- else
371- f = SDEFunction (f, g; sys = prob. f. sys)
372- end
373- end
374- f = remake (f; initialization_data)
355+ f = coalesce (f, prob. f)
356+ g = coalesce (g, prob. g)
357+ f = remake (prob. f; f, g, initialization_data)
375358 iip = isinplace (prob)
376359
377360 if kwargs === missing
@@ -443,12 +426,8 @@ function remake(prob::DDEProblem; f = missing, h = missing, u0 = missing,
443426 initialization_data = nothing
444427 end
445428
446- if f === missing
447- f = prob. f
448- elseif ! (f isa DDEFunction)
449- f = remake (prob. f; f = f)
450- end
451- f = remake (f; initialization_data)
429+ f = coalesce (f, prob. f)
430+ f = remake (prob. f; f, initialization_data)
452431
453432 h = coalesce (h, prob. h)
454433 constant_lags = coalesce (constant_lags, prob. constant_lags)
@@ -542,25 +521,9 @@ function remake(prob::SDDEProblem;
542521 seed = prob. seed
543522 end
544523
545- if f === missing && g === missing
546- f = prob. f
547- g = prob. g
548- elseif f != = missing && g === missing
549- g = prob. g
550- elseif f === missing && g != = missing
551- if prob. f isa SDEFunction
552- f = remake (prob. f; g = g)
553- else
554- f = SDEFunction (prob. f, g; sys = prob. f. sys)
555- end
556- else
557- if f isa SDEFunction
558- f = remake (f; g = g)
559- else
560- f = SDEFunction (f, g; sys = prob. f. sys)
561- end
562- end
563- f = remake (f; initialization_data)
524+ f = coalesce (f, prob. f)
525+ g = coalesce (g, prob. g)
526+ f = remake (prob. f; f, g, initialization_data)
564527 iip = isinplace (prob)
565528
566529 h = coalesce (h, prob. h)
@@ -587,7 +550,7 @@ function remake(prob::SDDEProblem;
587550 _kwargs... )
588551 else
589552 SDDEProblem {iip} (
590- f, newu0, tspan, newp; noise, noise_rate_prototype, seed, constant_lags,
553+ f, g, newu0, tspan, newp; noise, noise_rate_prototype, seed, constant_lags,
591554 dependent_lags, order_discontinuity_t0, neutral, kwargs... )
592555 end
593556end
0 commit comments