Skip to content

Commit

Permalink
feat: add constructorof for DiscreteProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jan 16, 2025
1 parent 7ed01df commit c081f78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/problems/discrete_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ struct DiscreteProblem{uType, tType, isinplace, P, F, K} <:
end
end

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

"""
DiscreteProblem{isinplace}(f,u0,tspan,p=NullParameters(),callback=nothing)
Expand Down

0 comments on commit c081f78

Please sign in to comment.