@@ -220,12 +220,13 @@ function fluxmat(rn::ReactionSystem, pmap::Dict = Dict(); sparse=false)
220
220
rcmap = reactioncomplexmap (rn)
221
221
nc = length (rcmap)
222
222
nr = length (rates)
223
- mtype = eltype (rates) <: Symbolics.BasicSymbolic ? Any : eltype (rates)
224
- if sparse
225
- return fluxmat (SparseMatrixCSC{mtype, Int}, rcmap, rates)
223
+ mtype = eltype (rates) <: Symbolics.BasicSymbolic ? Num : eltype (rates)
224
+ fluxmat = if sparse
225
+ fluxmat (SparseMatrixCSC{mtype, Int}, rcmap, rates)
226
226
else
227
- return fluxmat (Matrix{mtype}, rcmap, rates)
227
+ fluxmat (Matrix{mtype}, rcmap, rates)
228
228
end
229
+ mtype == Num ? Matrix {Any} (fluxmat) : fluxmat
229
230
end
230
231
231
232
function fluxmat (:: Type{SparseMatrixCSC{T, Int}} , rcmap, rates) where T
@@ -296,7 +297,7 @@ function massactionvector(rn::ReactionSystem, scmap::Dict = Dict(); combinatoric
296
297
error (" The supplied ReactionSystem has reactions that are not ismassaction. The mass action vector is only defined for pure mass action networks." )
297
298
end
298
299
299
- vtype = eltype (specs) <: Symbolics.BasicSymbolic ? Any : eltype (specs)
300
+ vtype = eltype (specs) <: Symbolics.BasicSymbolic ? Num : eltype (specs)
300
301
Φ = Vector {vtype} ()
301
302
rcmap = reactioncomplexmap (rn)
302
303
for comp in keys (reactioncomplexmap (rn))
@@ -307,7 +308,7 @@ function massactionvector(rn::ReactionSystem, scmap::Dict = Dict(); combinatoric
307
308
push! (Φ, maprod)
308
309
end
309
310
310
- Φ
311
+ vtype == Num ? Vector {Any} (Φ) : Φ
311
312
end
312
313
313
314
function massactionvector (rn:: ReactionSystem , scmap:: Tuple ; combinatoric_ratelaws = Catalyst. get_combinatoric_ratelaws (rn))
0 commit comments