Skip to content

Commit

Permalink
- Remove useless case in simplify (makes code slower)
Browse files Browse the repository at this point in the history
- Removed some flattening tests since whenever a tiny simplify change is performed all thermosyspro and multibody flattening examples needed to be updated. They are simulated, and that is what is important.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17956 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 31, 2013
1 parent ea663ef commit a486e41
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3605,24 +3605,6 @@ algorithm
true = Expression.expEqual(e1,e2);
then DAE.RCONST(1.0);

// (a+b)c1 => ac1+bc1, for constant c1 and a or b
case (DAE.MUL(ty = ty),DAE.BINARY(exp1 = e1,operator = DAE.ADD(ty = ty2),exp2 = e2),e3)
equation
true = Expression.isConst(e3);
true = Expression.isConst(e1) or Expression.isConst(e2);
res = DAE.BINARY(DAE.BINARY(e3,DAE.MUL(ty),e1),DAE.ADD(ty2),DAE.BINARY(e3,DAE.MUL(ty),e2));
then
res;

// (a-b)c1 => a/c1-b/c1, for constant c1 and a or b
case (DAE.MUL(ty = ty),DAE.BINARY(exp1 = e1,operator = DAE.SUB(ty = ty2),exp2 = e2),e3)
equation
true = Expression.isConst(e3);
true = Expression.isConst(e1) or Expression.isConst(e2);
res = DAE.BINARY(DAE.BINARY(e3,DAE.MUL(ty),e1),DAE.SUB(ty2),DAE.BINARY(e3,DAE.MUL(ty),e2));
then
res;

// a+(-b)
case (DAE.ADD(ty = tp),e1,DAE.UNARY(operator = DAE.UMINUS(ty = tp2),exp = e2))
equation
Expand Down

0 comments on commit a486e41

Please sign in to comment.