Skip to content

Commit

Permalink
Merge pull request #628 from AayushSabharwal/as/sii-jumpproblem
Browse files Browse the repository at this point in the history
fix: properly implement SII fallbacks for AbstractJumpProblem
  • Loading branch information
ChrisRackauckas authored Feb 19, 2024
2 parents 69c7776 + 8fda165 commit db0d386
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/problems/problem_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Base.@propagate_inbounds function Base.getproperty(prob::AbstractSciMLProblem, s
end

SymbolicIndexingInterface.symbolic_container(prob::AbstractSciMLProblem) = prob.f
SymbolicIndexingInterface.symbolic_container(prob::AbstractJumpProblem) = prob.prob

SymbolicIndexingInterface.parameter_values(prob::AbstractSciMLProblem) = prob.p
SymbolicIndexingInterface.parameter_values(prob::AbstractJumpProblem) = prob.prob.p
SymbolicIndexingInterface.state_values(prob::AbstractSciMLProblem) = prob.u0
SymbolicIndexingInterface.state_values(prob::AbstractJumpProblem) = prob.prob.u0
SymbolicIndexingInterface.current_time(prob::AbstractSciMLProblem) = prob.tspan[1]
SymbolicIndexingInterface.current_time(prob::AbstractJumpProblem) = prob.prob.tspan[1]

Base.@propagate_inbounds function Base.getindex(prob::AbstractSciMLProblem, ::SymbolicIndexingInterface.SolvedVariables)
return getindex(prob, variable_symbols(prob))
Expand Down

0 comments on commit db0d386

Please sign in to comment.