Skip to content

Commit

Permalink
- Reverted r25682 and r25683 until the bootstrapping tarball is updated
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25685 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Apr 22, 2015
1 parent d62f8e8 commit c0ea844
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
8 changes: 5 additions & 3 deletions Compiler/BackEnd/Initialization.mo
Expand Up @@ -778,6 +778,7 @@ protected
list<Integer> flatComps;
Integer nParam;
array<Integer> secondary;
Integer i, j;
BackendDAE.Var p;
DAE.Exp bindExp;
algorithm
Expand Down Expand Up @@ -822,9 +823,10 @@ algorithm
//BackendDump.dumpMatchingVars(secondary);

// get primary and secondary parameters
for i in flatComps loop
p := BackendVariable.getVarAt(allParameters, i);
if 1 == secondary[i] then
for i in 1:nParam loop // for i in flatComps loop
j := listGet(flatComps, i) "workaround since 'for i in flatComps loop' does not work properly" ;
p := BackendVariable.getVarAt(allParameters, j);
if 1 == secondary[j] then
outVars := BackendVariable.addVar(p, outVars);
else
outAllPrimaryParameters := p::outAllPrimaryParameters;
Expand Down
12 changes: 6 additions & 6 deletions Compiler/BackEnd/Matching.mo
Expand Up @@ -196,7 +196,7 @@ algorithm

for j in m[i] loop
// negative entries in adjacence matrix belong to states!!!
if (j>0 and assign_v_e[j] <= 0) then
if (j>0 and arrayGet(assign_v_e, j) <= 0) then
success := true;
arrayUpdate(assign_v_e, j, i);
arrayUpdate(assign_e_v, i, j);
Expand All @@ -206,9 +206,9 @@ algorithm

for j in m[i] loop
// negative entries in adjacence matrix belong to states!!!
if (j>0 and not vMark[j]) then
if (j>0 and not arrayGet(vMark, j)) then
arrayUpdate(vMark, j, true);
success := BBPathFound(assign_v_e[j], m, eMark, vMark, assign_v_e, assign_e_v);
success := BBPathFound(arrayGet(assign_v_e, j), m, eMark, vMark, assign_v_e, assign_e_v);
if success then
arrayUpdate(assign_v_e, j, i);
arrayUpdate(assign_e_v, i, j);
Expand Down Expand Up @@ -252,9 +252,9 @@ protected
algorithm
outAss := arrayCreate(N, -1);
for i in 1:N loop
j := inAss[i];
j := arrayGet(inAss, i);
if j > 0 then
outAss[inAss[i]] := i;
arrayUpdate(outAss, inAss[i], i);
end if;
end for;
end invertMatching;
Expand Down Expand Up @@ -5676,7 +5676,7 @@ protected
list<Integer> vars;
algorithm
vars := List.select(m[eqn], Util.intGreaterZero) "just keep positive integers";
outEqNodes := list(ass1[var] for var guard(ass1[var] > 0) in vars);
outEqNodes := list(arrayGet(ass1, var) for var guard(arrayGet(ass1, var) > 0) in vars);
outEqNodes := List.removeOnTrue(eqn, intEq, outEqNodes);
end incomingEquations;

Expand Down
16 changes: 8 additions & 8 deletions Compiler/BackEnd/Sorting.mo
Expand Up @@ -102,13 +102,13 @@ algorithm

// Consider successors of eqn
for eqn2 in Matching.incomingEquations(eqn, m, ass1) loop
if number[eqn2] == -1 then
if arrayGet(number, eqn2) == -1 then
// Successor eqn2 has not yet been visited; recurse on it
(outStack, outIndex, outComponents) := StrongConnect(m, ass1, eqn2, outStack, outIndex, number, lowlink, onStack, outComponents);
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], lowlink[eqn2]));
elseif onStack[eqn2] then
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], arrayGet(lowlink, eqn2)));
elseif arrayGet(onStack, eqn2) then
// Successor eqn2 is in the stack and hence in the current SCC
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], number[eqn2]));
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], arrayGet(number, eqn2)));
end if;
end for;

Expand Down Expand Up @@ -179,13 +179,13 @@ algorithm

// Consider successors of eqn
for eqn2 in Matching.reachableEquations(eqn, mT, ass2) loop
if number[eqn2] == -1 then
if arrayGet(number, eqn2) == -1 then
// Successor eqn2 has not yet been visited; recurse on it
(outStack, outIndex, outComponents) := StrongConnectTransposed(mT, ass2, eqn2, outStack, outIndex, number, lowlink, onStack, outComponents);
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], lowlink[eqn2]));
elseif onStack[eqn2] then
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], arrayGet(lowlink, eqn2)));
elseif arrayGet(onStack, eqn2) then
// Successor eqn2 is in the stack and hence in the current SCC
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], number[eqn2]));
arrayUpdate(lowlink, eqn, intMin(lowlink[eqn], arrayGet(number, eqn2)));
end if;
end for;

Expand Down

0 comments on commit c0ea844

Please sign in to comment.