Skip to content

Commit

Permalink
- fix tests
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12836 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Sep 7, 2012
1 parent dbd87c1 commit a6f2c21
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -502,7 +502,7 @@ algorithm

case ((l,pos,_,BackendDAE.EQUATION(exp=e1,scalar=e2),(syst,shared,repl,derrepl,deeqns,mvars,meqns,b)))
equation
true = intEq(l,0);
true = intEq(l,0);
true = Expression.isConst(e1);
true = Expression.expEqual(e1,e2);
then ((syst,shared,repl,derrepl,deeqns,pos::meqns,b));
Expand Down Expand Up @@ -1087,7 +1087,7 @@ protected function traverseComponents
input BackendDAE.StrongComponents inComps;
input FuncType inFunc;
input Type_a inTypeA;
input array<Integer> compflag;
input array<Integer> icompflag;
input Integer mark;
output Type_a outTypeA;
partial function FuncType
Expand All @@ -1096,24 +1096,25 @@ protected function traverseComponents
end FuncType;
algorithm
outTypeA :=
matchcontinue (inComps,inFunc,inTypeA,compflag,mark)
matchcontinue (inComps,inFunc,inTypeA,icompflag,mark)
local
Integer e;
list<Integer> elst,elst1;
BackendDAE.StrongComponent comp;
BackendDAE.StrongComponents rest;
Type_a arg;
FuncType func;
array<Integer> compflag;
case ({},_,_,_,_) then inTypeA;
case (BackendDAE.SINGLEEQUATION(eqn=e)::rest,_,_,_,_)
equation
((_,arg)) = inFunc((e,compflag,mark,inTypeA));
((_,arg)) = inFunc((e,icompflag,mark,inTypeA));
then
traverseComponents(rest,inFunc,arg,compflag,mark);
traverseComponents(rest,inFunc,arg,icompflag,mark);
case (BackendDAE.MIXEDEQUATIONSYSTEM(condSystem=comp,disc_eqns=elst)::rest,_,_,_,_)
equation
(elst1,_) = BackendDAETransform.getEquationAndSolvedVarIndxes(comp);
compflag = List.fold1r(elst,arrayUpdate,mark,compflag);
compflag = List.fold1r(elst,arrayUpdate,mark,icompflag);
compflag = List.fold1r(elst1,arrayUpdate,mark,compflag);
elst = listAppend(elst,elst1);
elst = List.sort(elst,intGt);
Expand All @@ -1122,32 +1123,32 @@ algorithm
traverseComponents(rest,inFunc,arg,compflag,mark+1);
case (BackendDAE.EQUATIONSYSTEM(eqns=elst)::rest,_,_,_,_)
equation
compflag = List.fold1r(elst,arrayUpdate,mark,compflag);
compflag = List.fold1r(elst,arrayUpdate,mark,icompflag);
elst = List.sort(elst,intGt);
arg = traverseComponents1(elst,inFunc,inTypeA,compflag,mark);
then
traverseComponents(rest,inFunc,arg,compflag,mark+1);
case (BackendDAE.SINGLEARRAY(eqn=e)::rest,_,_,_,_)
// ToDo: check also this one
then
traverseComponents(rest,inFunc,inTypeA,compflag,mark);
traverseComponents(rest,inFunc,inTypeA,icompflag,mark);
case (BackendDAE.SINGLEALGORITHM(eqn=e)::rest,_,_,_,_)
// ToDo: check also this one
then
traverseComponents(rest,inFunc,inTypeA,compflag,mark);
traverseComponents(rest,inFunc,inTypeA,icompflag,mark);
case (BackendDAE.SINGLECOMPLEXEQUATION(eqn=e)::rest,_,_,_,_)
// ToDo: check also this one
then
traverseComponents(rest,inFunc,inTypeA,compflag,mark);
traverseComponents(rest,inFunc,inTypeA,icompflag,mark);
case (_::rest,_,_,_,_)
equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("BackendDAEOptimize.traverseComponents failed!");
then
traverseComponents(rest,inFunc,inTypeA,compflag,mark);
traverseComponents(rest,inFunc,inTypeA,icompflag,mark);
case (_::rest,func,arg,_,_)
then
traverseComponents(rest,inFunc,inTypeA,compflag,mark);
traverseComponents(rest,inFunc,inTypeA,icompflag,mark);
end matchcontinue;
end traverseComponents;

Expand Down

0 comments on commit a6f2c21

Please sign in to comment.