Skip to content

Commit

Permalink
- handle also inputs from DAELow.ALGORITHM in remove simple equations
Browse files Browse the repository at this point in the history
 - remove negation sign,
 - remove equal inputs
 - TODO: check if all inputs still used in algorithm 

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6033 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Sep 6, 2010
1 parent fbad45a commit 4a45ac2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Compiler/BackendVarTransform.mo
Expand Up @@ -67,6 +67,7 @@ algorithm
list<DAE.Exp> expl,expl1,expl2,expl3,expl4;
DAELow.WhenEquation whenEqn,whenEqn1;
DAE.ElementSource source "the origin of the element";
list<list<DAE.Exp>> explstlst;

case ({},_) then {};
case ((DAELow.ARRAY_EQUATION(indx,expl,source)::es),repl)
Expand Down Expand Up @@ -94,6 +95,11 @@ algorithm
expl3 = Util.listMap(expl2,Exp.simplify);
// remove constant expressions from inputs
(_,expl4) = Util.listSplitOnTrue(expl3,Exp.isConst);
// remove negation from symbols
expl4 = Util.listMap(expl4,Exp.abs);
// remove equal simbols
explstlst = Util.listMap(expl4,Util.listCreate);
expl4 = Util.listListUnionOnTrue(explstlst, Exp.expEqual);
es_1 = replaceEquations(es, repl);
then
(DAELow.ALGORITHM(indx,expl4,expl1,source) :: es_1);
Expand Down

0 comments on commit 4a45ac2

Please sign in to comment.