Skip to content

Commit b777518

Browse files
committed
up
1 parent b3dce88 commit b777518

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/network_analysis.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,12 @@ end
211211
Returns a symbolic matrix by default, but will return a numerical matrix if rate constants are specified as a `Tuple`, `Vector`, or `Dict` of symbol-value pairs via `pmap`.
212212
"""
213213
function fluxmat(rn::ReactionSystem, pmap::Dict = Dict(); sparse=false)
214-
rates = reactionrates(rn)
214+
rates = if isempty(pmap)
215+
reactionrates(rn)
216+
else
217+
substitutevals(rn, pmap, parameters(rn), reactionrates(rn))
218+
end
215219

216-
!isempty(pmap) && (rates = substitutevals(rn, pmap, parameters(rn), rates))
217220
rcmap = reactioncomplexmap(rn)
218221
nc = length(rcmap)
219222
nr = length(rates)
@@ -282,14 +285,16 @@ function massactionvector(rn::ReactionSystem, scmap::Dict = Dict(); combinatoric
282285
r = numreactions(rn)
283286
rxs = reactions(rn)
284287
sm = speciesmap(rn)
285-
specs = species(rn)
288+
specs = if isempty(scmap)
289+
species(rn)
290+
else
291+
substitutevals(rn, scmap, species(rn), species(rn))
292+
end
286293

287294
if !all(r -> ismassaction(r, rn), rxs)
288295
error("The supplied ReactionSystem has reactions that are not ismassaction. The mass action vector is only defined for pure mass action networks.")
289296
end
290297

291-
!isempty(scmap) && (specs = substitutevals(rn, scmap, specs, specs))
292-
293298
vtype = eltype(specs) <: Symbolics.BasicSymbolic ? Num : eltype(specs)
294299
Φ = Vector{vtype}()
295300
rcmap = reactioncomplexmap(rn)

0 commit comments

Comments
 (0)