@@ -332,18 +332,25 @@ end
332
332
333
333
# ODEProblem from AbstractReactionNetwork
334
334
function DiffEqBase. ODEProblem (rs:: ReactionSystem , u0:: Union{AbstractArray, Number} , tspan, p, args... ; kwargs... )
335
- return ODEProblem (convert (ODESystem,rs),Pair .(rs. states,u0),tspan,Pair .(rs. ps,p), args... ; kwargs... )
335
+ println (" HERE" )
336
+ u0 = typeof (u0) <: Array{<:Pair} ? u0 : Pair .(rs. states,u0)
337
+ p = typeof (p) <: Array{<:Pair} ? p : Pair .(rs. ps,p)
338
+ return ODEProblem (convert (ODESystem,rs),u0,tspan,p, args... ; kwargs... )
336
339
end
337
340
338
341
# SDEProblem from AbstractReactionNetwork
339
342
function DiffEqBase. SDEProblem (rs:: ReactionSystem , u0:: Union{AbstractArray, Number} , tspan, p, args... ; kwargs... )
343
+ u0 = typeof (u0) <: Array{<:Pair} ? u0 : Pair .(rs. states,u0)
344
+ p = typeof (p) <: Array{<:Pair} ? p : Pair .(rs. ps,p)
340
345
p_matrix = zeros (length (rs. states), length (rs. eqs))
341
- return SDEProblem (convert (SDESystem,rs),Pair .(rs . states,u0) ,tspan,Pair .(rs . ps,p) ,args... ; noise_rate_prototype= p_matrix,kwargs... )
346
+ return SDEProblem (convert (SDESystem,rs),u0 ,tspan,p ,args... ; noise_rate_prototype= p_matrix,kwargs... )
342
347
end
343
348
344
349
# DiscreteProblem from AbstractReactionNetwork
345
- function DiffEqBase. DiscreteProblem (rs:: ReactionSystem , u0, tspan:: Tuple , p= nothing , args... ; kwargs... )
346
- return DiscreteProblem (convert (JumpSystem,rs), Pair .(rs. states,u0),tspan,Pair .(rs. ps,p), args... ; kwargs... )
350
+ function DiffEqBase. DiscreteProblem (rs:: ReactionSystem , u0:: Union{AbstractArray, Number} , tspan:: Tuple , p= nothing , args... ; kwargs... )
351
+ u0 = typeof (u0) <: Array{<:Pair} ? u0 : Pair .(rs. states,u0)
352
+ p = typeof (p) <: Array{<:Pair} ? p : Pair .(rs. ps,p)
353
+ return DiscreteProblem (convert (JumpSystem,rs), u0,tspan,p, args... ; kwargs... )
347
354
end
348
355
349
356
# JumpProblem from AbstractReactionNetwork
0 commit comments