Skip to content

Commit

Permalink
- improved names for some auxiliary functions
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23501 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Nov 21, 2014
1 parent 64f76ac commit bf2c9f5
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 177 deletions.
28 changes: 14 additions & 14 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -1965,7 +1965,7 @@ protected
BackendDAE.EquationArray eqs;
algorithm
BackendDAE.EQSYSTEM(orderedEqs=eqs) := syst;
(_,_) := BackendEquation.traverseEquationArrayWithUpdate(eqs, residualForm2, 1);
(_,_) := BackendEquation.traverseEquationArray_WithUpdate(eqs, residualForm2, 1);
osyst := syst;
oshared := shared;
end residualForm1;
Expand Down Expand Up @@ -2060,7 +2060,7 @@ algorithm
equation
eqns = BackendEquation.getEqnsFromEqSystem(isyst);
eqn = BackendEquation.equationNth1(eqns, e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case ((comp as BackendDAE.EQUATIONSYSTEM(jac=jac,jacType=BackendDAE.JAC_LINEAR()))::rest,_,BackendDAE.SHARED(functionTree=funcs),_)
Expand All @@ -2081,31 +2081,31 @@ algorithm
case (BackendDAE.SINGLEARRAY(eqn=e)::rest,_,_,_)
equation
eqn = BackendEquation.equationNth1(BackendEquation.getEqnsFromEqSystem(isyst), e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case (BackendDAE.SINGLEIFEQUATION(eqn=e)::rest,_,_,_)
equation
eqn = BackendEquation.equationNth1(BackendEquation.getEqnsFromEqSystem(isyst), e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case (BackendDAE.SINGLEALGORITHM(eqn=e)::rest,_,_,_)
equation
eqn = BackendEquation.equationNth1(BackendEquation.getEqnsFromEqSystem(isyst), e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case (BackendDAE.SINGLECOMPLEXEQUATION(eqn=e)::rest,_,_,_)
equation
eqn = BackendEquation.equationNth1(BackendEquation.getEqnsFromEqSystem(isyst), e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case (BackendDAE.SINGLEWHENEQUATION(eqn=e)::rest,_,_,_)
equation
eqn = BackendEquation.equationNth1(BackendEquation.getEqnsFromEqSystem(isyst), e);
(_,tpl) = BackendEquation.traverseBackendDAEExpsEqn(eqn,countOperationsExp,inTpl);
(_,tpl) = BackendEquation.traverseExpsOfEquation(eqn,countOperationsExp,inTpl);
then
countOperationstraverseComps(rest,isyst,ishared,tpl);
case ((comp as BackendDAE.TORNSYSTEM(tearingvars=vlst, linear=true))::rest,_,BackendDAE.SHARED(functionTree=funcs),_)
Expand Down Expand Up @@ -2161,7 +2161,7 @@ protected function countOperationsJac1
input tuple<Integer,Integer,Integer,Integer> inTpl;
output tuple<Integer,Integer,Integer,Integer> outTpl;
algorithm
(_,outTpl) := BackendEquation.traverseBackendDAEExpsEqn(Util.tuple33(inJac),countOperationsExp,inTpl);
(_,outTpl) := BackendEquation.traverseExpsOfEquation(Util.tuple33(inJac),countOperationsExp,inTpl);
end countOperationsJac1;

protected function addJacSpecificOperations
Expand Down Expand Up @@ -2392,7 +2392,7 @@ algorithm

case (eqn,knvars,(acc,asserts,b))
equation
(eqn,(_,b)) = BackendEquation.traverseBackendDAEExpsEqn(eqn, simplifyIfExpevaluatedParamter, (knvars,b));
(eqn,(_,b)) = BackendEquation.traverseExpsOfEquation(eqn, simplifyIfExpevaluatedParamter, (knvars,b));
then
((eqn::acc,asserts,b));
end matchcontinue;
Expand Down Expand Up @@ -3055,7 +3055,7 @@ algorithm
case (BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns,stateSets=stateSets,partitionKind=partitionKind),shared)
equation
// traverse the equations and collect all semiLinear calls y=semiLinear(x,sa,sb)
(eqns,(eqnslst,_,true)) = BackendEquation.traverseEquationArrayWithUpdate(eqns,simplifysemiLinearFinder,({},0,false));
(eqns,(eqnslst,_,true)) = BackendEquation.traverseEquationArray_WithUpdate(eqns,simplifysemiLinearFinder,({},0,false));
// sort for (y,x) pairs
eqnsarray = arrayCreate(5,{});
ht = HashTableExpToIndex.emptyHashTable();
Expand Down Expand Up @@ -3728,7 +3728,7 @@ algorithm
BackendDAE.EqSystem eqs;
case(eqs as BackendDAE.EQSYSTEM(orderedVars=ordvars, orderedEqs=ordeqns), _)
equation
(ordeqns, _) = BackendEquation.traverseEquationArrayWithUpdate(ordeqns, eaddInitialStmtsToAlgorithms1Helper, ordvars);
(ordeqns, _) = BackendEquation.traverseEquationArray_WithUpdate(ordeqns, eaddInitialStmtsToAlgorithms1Helper, ordvars);
then(eqs, shared);
end match;
end addInitialStmtsToAlgorithms1;
Expand Down Expand Up @@ -3841,8 +3841,8 @@ algorithm

case (BackendDAE.EQSYSTEM(vars, eqns, m, mT, matching, stateSets, partitionKind), BackendDAE.SHARED(knvars, exobj, av, inieqns, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs,ei))
equation
(eqns1, (vars1, _)) = BackendEquation.traverseEquationArrayWithUpdate(eqns, traverserexpandDerEquation, (vars, shared));
(inieqns1, (vars2, _)) = BackendEquation.traverseEquationArrayWithUpdate(inieqns, traverserexpandDerEquation, (vars1, shared));
(eqns1, (vars1, _)) = BackendEquation.traverseEquationArray_WithUpdate(eqns, traverserexpandDerEquation, (vars, shared));
(inieqns1, (vars2, _)) = BackendEquation.traverseEquationArray_WithUpdate(inieqns, traverserexpandDerEquation, (vars1, shared));
then
(BackendDAE.EQSYSTEM(vars2, eqns1, m, mT, matching, stateSets, partitionKind), BackendDAE.SHARED(knvars, exobj, av, inieqns1, remeqns, constrs, clsAttrs, cache, graph, funcs, einfo, eoc, btp, symjacs,ei));
end match;
Expand All @@ -3865,7 +3865,7 @@ protected
algorithm
e := inEq;
(vars, shared) := tpl;
(e1, (vars, shared, ops)) := BackendEquation.traverseBackendDAEExpsEqn(e, traverserexpandDerExp, (vars, shared, {}));
(e1, (vars, shared, ops)) := BackendEquation.traverseExpsOfEquation(e, traverserexpandDerExp, (vars, shared, {}));
e1 := List.foldr(ops, BackendEquation.addOperation, e1);
outEq := e1;
outTpl := (vars, shared);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -1106,7 +1106,7 @@ end checkStack;
traverseBackendDAEExps stuff
*****************************************/

public function traverseBackendDAEExpsEqn
public function traverseExpsOfEquation
"author: Frenkel TUD 2010-11
Traverse all expressions of a list of Equations. It is possible to change the equations
and the multidim equations and the algorithms."
Expand All @@ -1124,7 +1124,7 @@ public function traverseBackendDAEExpsEqn
end FuncExpType;
algorithm
(outEquation,(_,outTypeA)) := traverseBackendDAEExpsEqnWithSymbolicOperation(inEquation,traverseBackendDAEExpsEqnWithoutSymbolicOperationHelper,(func,inTypeA));
end traverseBackendDAEExpsEqn;
end traverseExpsOfEquation;

protected function traverseBackendDAEExpsEqnWithoutSymbolicOperationHelper
replaceable type Type_a subtypeof Any;
Expand Down Expand Up @@ -1471,7 +1471,7 @@ public function traverseExpsOfEquationList<ArgT> "author: Frenkel TUD 2010-11
end FuncExpType;
algorithm
for eq in inEquations loop
(eq, outArg) := traverseBackendDAEExpsEqn(eq, func, outArg);
(eq, outArg) := traverseExpsOfEquation(eq, func, outArg);
outEquations := eq :: outEquations;
end for;

Expand Down
10 changes: 5 additions & 5 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -6043,7 +6043,7 @@ algorithm
end matchcontinue;
end traverseStrongComponentsJacobiansExp;

protected function traverseBackendDAEExpsJacobianEqn "Helper for traverseBackendDAEExpsEqn."
protected function traverseBackendDAEExpsJacobianEqn "Helper for traverseExpsOfEquation."
replaceable type Type_a subtypeof Any;
input list<tuple<Integer, Integer, BackendDAE.Equation>> inJacEntry;
input FuncExpType func;
Expand Down Expand Up @@ -6631,7 +6631,7 @@ algorithm
end traverseBackendDAEExpsEqnsWithUpdate;

public function traverseBackendDAEExpsOptEqn "author: Frenkel TUD 2010-11
Helper for traverseBackendDAEExpsEqn."
Helper for traverseExpsOfEquation."
replaceable type Type_a subtypeof Any;
input Option<BackendDAE.Equation> inEquation;
input FuncExpType func;
Expand Down Expand Up @@ -6671,14 +6671,14 @@ algorithm
case (NONE(),_,_) then (true,inTypeA);
case (SOME(eqn),_,_)
equation
(b,ext_arg_1) = BackendEquation.traverseBackendDAEExpsEqnWithStop(eqn,func,inTypeA);
(b,ext_arg_1) = BackendEquation.traverseExpsOfEquation_WithStop(eqn,func,inTypeA);
then
(b,ext_arg_1);
end match;
end traverseBackendDAEExpsOptEqnWithStop;

protected function traverseBackendDAEExpsOptEqnWithUpdate "author: Frenkel TUD 2010-11
Helper for traverseBackendDAEExpsEqn."
Helper for traverseExpsOfEquation."
replaceable type Type_a subtypeof Any;
input Option<BackendDAE.Equation> inEquation;
input FuncExpType func;
Expand All @@ -6699,7 +6699,7 @@ algorithm
case (NONE(),_,_) then (NONE(),inTypeA);
case (SOME(eqn),_,_)
equation
(eqn,ext_arg_1) = BackendEquation.traverseBackendDAEExpsEqn(eqn,func,inTypeA);
(eqn,ext_arg_1) = BackendEquation.traverseExpsOfEquation(eqn,func,inTypeA);
then
(SOME(eqn),ext_arg_1);
end match;
Expand Down

0 comments on commit bf2c9f5

Please sign in to comment.