Skip to content

Commit

Permalink
Merge ad4d693 into 888a36b
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Apr 4, 2023
2 parents 888a36b + ad4d693 commit af92fbb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/JumpProcesses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using RandomNumbers, TreeViews, LinearAlgebra, Markdown, DocStringExtensions
using DataStructures, PoissonRandom, Random, ArrayInterface
using FunctionWrappers, UnPack
using Graphs
using SciMLBase: SciMLBase
using SciMLBase: SciMLBase, ___internal_setindex!
using Base.FastMath: add_fast

import DiffEqBase: DiscreteCallback, init, solve, solve!, plot_indices, initialize!
Expand Down
13 changes: 13 additions & 0 deletions src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ function DiffEqBase.remake(thing::JumpProblem; kwargs...)
thing.kwargs)
end

# when setindex! is used.
function Base.setindex!(prob::JumpProblem, args...; kwargs...)
___internal_setindex!(prob.prob, args...; kwargs...)
if using_params(prob.massaction_jump)
update_parameters!(prob.massaction_jump, prob.prob.p)
end
end

# when getindex is used.
function Base.getindex(prob::JumpProblem, args...; kwargs...)
Base.getindex(prob.prob, args...; kwargs...)
end

DiffEqBase.isinplace(::JumpProblem{iip}) where {iip} = iip
JumpProblem(prob::JumpProblem) = prob

Expand Down

0 comments on commit af92fbb

Please sign in to comment.