Fix logic of include_eqs in the presence of [static]/[dynamic] equations
In a model with [static]/[dynamic] equations, if the user was using include_eqs with a list of equations that does *not* contain equations marked [static]/[dynamic], then the call to ModelTree::includeExcludeEquations(…, static_equations=true) would have an empty list of equation tags (as stored in tag_eqns). The right behaviour in this case is to exclude all static equations. However, the code would exclude none, and this would disrupt the equilibrium between [static] and [dynamic] equations (since all [dynamic] equations were excluded by the other call to the same method). The fix consists in removing the shortcut that returns from the method if tag_eqns is empty.pac-components
parent
a492417a5b
commit
a73b0d911a
|
@ -1566,9 +1566,6 @@ ModelTree::includeExcludeEquations(set<pair<string, string>> &eqs, bool exclude_
|
|||
else
|
||||
++it;
|
||||
|
||||
if (tag_eqns.empty())
|
||||
return excluded_vars;
|
||||
|
||||
set<int> eqns;
|
||||
if (exclude_eqs)
|
||||
eqns = tag_eqns;
|
||||
|
|
Loading…
Reference in New Issue