Skip to content

Commit

Permalink
feat: implement constructorof for ODEProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Aug 21, 2024
1 parent ebd49ee commit c0f30cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/problems/ode_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ function Base.setproperty!(prob::ODEProblem, s::Symbol, v, order::Symbol)
Base.setfield!(prob, s, v, order)
end

function ConstructionBase.constructorof(::Type{P}) where {P <: ODEProblem}
function ctor(f, u0, tspan, p, kw, pt)
if f isa AbstractODEFunction
iip = isinplace(f)
else
iip = isinplace(f, 4)
end
return ODEProblem{iip}(f, u0, tspan, p, pt; kw...)
end
end

"""
ODEProblem(f::ODEFunction,u0,tspan,p=NullParameters(),callback=CallbackSet())
Expand Down

0 comments on commit c0f30cc

Please sign in to comment.