We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4268cd3 commit 9e7d373Copy full SHA for 9e7d373
src/systems/reaction/reactionsystem.jl
@@ -79,16 +79,12 @@ function assemble_drift(rs)
79
for (spec,stoich) in rx.netstoich
80
i = species_to_idx[spec]
81
if iszero(eqs[i].rhs)
82
- Δspec = isone(stoich) ? rl : stoich * rl
83
- eqs[i] = Equation(eqs[i].lhs, Δspec)
+ rhs = isone(stoich) ? rl : stoich * rl
84
else
85
Δspec = isone(abs(stoich)) ? rl : abs(stoich) * rl
86
- if stoich > zero(stoich)
87
- eqs[i] = Equation(eqs[i].lhs, eqs[i].rhs + Δspec)
88
- else
89
- eqs[i] = Equation(eqs[i].lhs, eqs[i].rhs - Δspec)
90
- end
+ rhs = (stoich > zero(stoich)) ? (eqs[i].rhs + Δspec) : (eqs[i].rhs - Δspec)
91
end
+ eqs[i] = Equation(eqs[i].lhs, rhs)
92
93
94
eqs
0 commit comments