Skip to content

Commit

Permalink
fix #2429
Browse files Browse the repository at this point in the history
use original expression in case of parameter or time alias and negate for global negate

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17836 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Oct 23, 2013
1 parent 413f313 commit 64eae7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Compiler/BackEnd/RemoveSimpleEquations.mo
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected import List;
protected import Types;
protected import Util;

protected type EquationAttributes = tuple<DAE.ElementSource, Boolean> "eqnAttributes";
protected type EquationAttributes = tuple<DAE.ElementSource, Boolean> "eqnAttributes(source,differentiated)";

protected
uniontype SimpleContainer
Expand Down Expand Up @@ -2001,7 +2001,7 @@ algorithm
vsattr = Debug.bcallret5(replacable and replaceble1, addVarSetAttributes, v, negate, mark, simpleeqnsarr, vsattr, vsattr);
rows = List.removeOnTrue(r, intEq, iMT[i]);
_ = arrayUpdate(iMT, i, {});
(vars, eqnslst, shared, repl, vsattr) = traverseAliasTree(rows, i, exp1, SOME(expcr), negate, SOME(DAE.RCONST(0.0)), mark, simpleeqnsarr, iMT, unreplacable, vars, eqnslst, shared, repl, vsattr);
(vars, eqnslst, shared, repl, vsattr) = traverseAliasTree(rows, i, exp, SOME(expcr), negate, SOME(DAE.RCONST(0.0)), mark, simpleeqnsarr, iMT, unreplacable, vars, eqnslst, shared, repl, vsattr);
then
(vars, eqnslst, shared, repl);
// time set
Expand All @@ -2021,7 +2021,7 @@ algorithm
vsattr = addVarSetAttributes(v, negate, mark, simpleeqnsarr, EMPTYVARSETATTRIBUTES);
rows = List.removeOnTrue(r, intEq, iMT[i]);
_ = arrayUpdate(iMT, i, {});
(vars, eqnslst, shared, repl, vsattr) = traverseAliasTree(rows, i, exp1, SOME(expcr), negate, SOME(dexp), mark, simpleeqnsarr, iMT, unreplacable, vars, eqnslst, shared, repl, vsattr);
(vars, eqnslst, shared, repl, vsattr) = traverseAliasTree(rows, i, exp, SOME(expcr), negate, SOME(dexp), mark, simpleeqnsarr, iMT, unreplacable, vars, eqnslst, shared, repl, vsattr);
then
(vars, eqnslst, shared, repl);
// constant set
Expand Down

0 comments on commit 64eae7c

Please sign in to comment.