@@ -44,7 +44,7 @@ function solve_call(_prob,args...;merge_callbacks = true, kwargs...)
44
44
callbacks = NamedTuple {(:callback,)} ( [DiffEqBase. CallbackSet (_prob. kwargs[:callback ], values (kwargs). callback )] )
45
45
kwargs = merge (kwargs_temp, callbacks)
46
46
end
47
- kwargs = merge (values (_prob. kwargs), kwargs)
47
+ kwargs = isempty (_prob . kwargs) ? kwargs : merge (values (_prob. kwargs), kwargs)
48
48
end
49
49
50
50
T = Core. Compiler. return_type (__solve,Tuple{typeof (_prob),map (typeof, args)... })
@@ -121,9 +121,13 @@ function discretize end
121
121
function get_concrete_problem (prob, kwargs)
122
122
tspan = get_concrete_tspan (prob, kwargs)
123
123
u0 = get_concrete_u0 (prob, tspan[1 ], kwargs)
124
- u0 = promote_u0 (u0, prob. p, tspan[1 ])
125
- tspan = promote_tspan (u0, prob. p, tspan, prob, kwargs)
126
- remake (prob; u0 = u0, tspan = tspan)
124
+ u0_promote = promote_u0 (u0, prob. p, tspan[1 ])
125
+ tspan_promote = promote_tspan (u0, prob. p, tspan, prob, kwargs)
126
+ if isconcreteu0 (prob, t0, kwargs) && typeof (u0_promote) === typeof (u0) && typeof (tspan) === typeof (tspan_promote)
127
+ return prob
128
+ else
129
+ return remake (prob; u0 = u0_promote, tspan = tspan_promote)
130
+ end
127
131
end
128
132
129
133
function get_concrete_problem (prob:: DDEProblem , kwargs)
@@ -159,6 +163,10 @@ function get_concrete_tspan(prob, kwargs)
159
163
tspan
160
164
end
161
165
166
+ function isconcreteu0 (prob, t0, kwargs)
167
+ ! eval_u0 (prob. u0) && prob. u0 != = nothing && ! isdistribution (prob. u0)
168
+ end
169
+
162
170
function get_concrete_u0 (prob, t0, kwargs)
163
171
if eval_u0 (prob. u0)
164
172
u0 = prob. u0 (prob. p, t0)
0 commit comments