Skip to content

Commit

Permalink
- Reverted part of r9497 as it does something funky with the bootstra…
Browse files Browse the repository at this point in the history
…pped compiler

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9514 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jul 21, 2011
1 parent c5d445e commit 49b0dfd
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -1550,11 +1550,8 @@ protected function traverseIncidenceMatrix
input tuple<BackendDAE.IncidenceMatrixElement,Integer,BackendDAE.IncidenceMatrix,Type_a> inTpl;
output tuple<list<Integer>,BackendDAE.IncidenceMatrix,Type_a> outTpl;
end FuncType;
protected
Integer len;
algorithm
len := arrayLength(inM);
(outM,outTypeA) := traverseIncidenceMatrix1(inM,func,1,len,intGt(1,len),inTypeA);
(outM,outTypeA) := traverseIncidenceMatrix1(inM,func,1,arrayLength(inM),inTypeA);
end traverseIncidenceMatrix;

protected function traverseIncidenceMatrix1
Expand All @@ -1565,7 +1562,6 @@ protected function traverseIncidenceMatrix1
input FuncType func;
input Integer pos "iterated 1..len";
input Integer len "length of array";
input Boolean stop;
input Type_a inTypeA;
output BackendDAE.IncidenceMatrix outM;
output Type_a outTypeA;
Expand All @@ -1574,28 +1570,29 @@ protected function traverseIncidenceMatrix1
output tuple<list<Integer>,BackendDAE.IncidenceMatrix,Type_a> outTpl;
end FuncType;
algorithm
(outM,outTypeA) := match (inM,func,pos,len,stop,inTypeA)
(outM,outTypeA) := matchcontinue(inM,func,pos,len,inTypeA)
local
BackendDAE.IncidenceMatrix m,m1,m2;
Type_a extArg,extArg1,extArg2;
list<Integer> eqns,eqns1;

case(inM,func,pos,len,true,inTypeA) then (inM,inTypeA);
case(inM,func,pos,len,inTypeA) equation
true = intGt(pos,len);
then (inM,inTypeA);

case(inM,func,pos,len,false,inTypeA)
equation
((eqns,m,extArg)) = func((inM[pos],pos,inM,inTypeA));
eqns1 = Util.listRemoveOnTrue(pos,intLt,eqns);
(m1,extArg1) = traverseIncidenceMatrixList(eqns1,m,func,arrayLength(m),pos,extArg);
(m2,extArg2) = traverseIncidenceMatrix1(m1,func,pos+1,len,intGt(pos+1,len),extArg1);
then (m2,extArg2);
case(inM,func,pos,len,inTypeA) equation
((eqns,m,extArg)) = func((inM[pos],pos,inM,inTypeA));
eqns1 = Util.listRemoveOnTrue(pos,intLt,eqns);
(m1,extArg1) = traverseIncidenceMatrixList(eqns1,m,func,arrayLength(m),pos,extArg);
(m2,extArg2) = traverseIncidenceMatrix1(m1,func,pos+1,len,extArg1);
then (m2,extArg2);

else
case (_,_,_,_,_)
equation
Debug.fprintln("failtrace", "- BackendDAEOptimize.traverseIncidenceMatrix1 failed");
then
fail();
end match;
end matchcontinue;
end traverseIncidenceMatrix1;

protected function traverseIncidenceMatrixList
Expand Down

0 comments on commit 49b0dfd

Please sign in to comment.