Skip to content

Commit

Permalink
- Renamed following auxiliary functions:
Browse files Browse the repository at this point in the history
  - BackendDAEUtil.traverseArrayNoCopyWithUpdate (from BackendDAEUtil.traverseBackendDAEArrayNoCopyWithUpdate)
  - BackendDAEUtil.traverseArrayNoCopyWithStop (from BackendDAEUtil.traverseBackendDAEArrayNoCopyWithStop)
  - BackendDAEUtil.traverseArrayNoCopy (from BackendDAEUtil.traverseBackendDAEArrayNoCopy)


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23466 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Nov 20, 2014
1 parent 6384b9c commit f468a6e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -6209,7 +6209,7 @@ algorithm
Type_a ext_arg_1;
case BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY(varOptArr=varOptArr))
equation
ext_arg_1 = traverseBackendDAEArrayNoCopy(varOptArr,func,traverseBackendDAEExpsVar,inTypeA);
ext_arg_1 = traverseArrayNoCopy(varOptArr,func,traverseBackendDAEExpsVar,inTypeA);
then
ext_arg_1;
else
Expand Down Expand Up @@ -6241,7 +6241,7 @@ algorithm
Type_a ext_arg_1;
case BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY(varOptArr=varOptArr))
equation
(_,ext_arg_1) = traverseBackendDAEArrayNoCopyWithUpdate(varOptArr,func,traverseBackendDAEExpsVarWithUpdate,inTypeA);
(_,ext_arg_1) = traverseArrayNoCopyWithUpdate(varOptArr,func,traverseBackendDAEExpsVarWithUpdate,inTypeA);
then
ext_arg_1;
else
Expand All @@ -6252,7 +6252,7 @@ algorithm
end matchcontinue;
end traverseBackendDAEExpsVarsWithUpdate;

public function traverseBackendDAEArrayNoCopy<ArrT, ElemT, ArgT>
public function traverseArrayNoCopy<ArrT, ElemT, ArgT>
"Help function to traverseBackendDAEExps."
input array<ArrT> inArray;
input ElemFuncType inElemFunc;
Expand Down Expand Up @@ -6280,10 +6280,10 @@ algorithm
for i in 1:inLength loop
outArg := inArrayFunc(inArray[i], inElemFunc, outArg);
end for;
end traverseBackendDAEArrayNoCopy;
end traverseArrayNoCopy;

public function traverseBackendDAEArrayNoCopyWithStop<ArrT, ElemT, ArgT>
"Same as traverseBackendDAEArrayNoCopy, but with an additional parameter to
public function traverseArrayNoCopyWithStop<ArrT, ElemT, ArgT>
"Same as traverseArrayNoCopy, but with an additional parameter to
stop the traversal."
input array<ArrT> inArray;
input ElemFuncType inElemFunc;
Expand Down Expand Up @@ -6316,9 +6316,9 @@ algorithm
(cont, outArg) := inArrayFunc(inArray[i], inElemFunc, outArg);
if not cont then break; end if;
end for;
end traverseBackendDAEArrayNoCopyWithStop;
end traverseArrayNoCopyWithStop;

public function traverseBackendDAEArrayNoCopyWithUpdate<ArrT, ElemT, ArgT>
public function traverseArrayNoCopyWithUpdate<ArrT, ElemT, ArgT>
input array<ArrT> inArray;
input ElemFuncType inElemFunc;
input ArrayFuncType inArrayFunc;
Expand Down Expand Up @@ -6353,7 +6353,7 @@ algorithm
arrayUpdate(outArray, i, new_e);
end if;
end for;
end traverseBackendDAEArrayNoCopyWithUpdate;
end traverseArrayNoCopyWithUpdate;

protected function traverseBackendDAEExpsVar "author: Frenkel TUD
Helper traverseBackendDAEExpsVar. Get all exps from a Var.
Expand Down Expand Up @@ -6558,7 +6558,7 @@ algorithm
local
array<Option<BackendDAE.Equation>> equOptArr;
case ((BackendDAE.EQUATION_ARRAY(equOptArr = equOptArr)),_,_)
then traverseBackendDAEArrayNoCopy(equOptArr,func,traverseBackendDAEExpsOptEqn,inTypeA);
then traverseArrayNoCopy(equOptArr,func,traverseBackendDAEExpsOptEqn,inTypeA);
else
equation
true = Flags.isSet(Flags.FAILTRACE);
Expand Down Expand Up @@ -6588,7 +6588,7 @@ algorithm
local
array<Option<BackendDAE.Equation>> equOptArr;
case ((BackendDAE.EQUATION_ARRAY(equOptArr = equOptArr)),_,_)
then traverseBackendDAEArrayNoCopyWithStop(equOptArr,func,traverseBackendDAEExpsOptEqnWithStop,inTypeA);
then traverseArrayNoCopyWithStop(equOptArr,func,traverseBackendDAEExpsOptEqnWithStop,inTypeA);
else
equation
true = Flags.isSet(Flags.FAILTRACE);
Expand Down Expand Up @@ -6620,7 +6620,7 @@ algorithm
array<Option<BackendDAE.Equation>> equOptArr;
case ((BackendDAE.EQUATION_ARRAY(equOptArr = equOptArr)),_,_)
equation
(_,outTypeA) = traverseBackendDAEArrayNoCopyWithUpdate(equOptArr,func,traverseBackendDAEExpsOptEqnWithUpdate,inTypeA);
(_,outTypeA) = traverseArrayNoCopyWithUpdate(equOptArr,func,traverseBackendDAEExpsOptEqnWithUpdate,inTypeA);
then outTypeA;
else
equation
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -914,7 +914,7 @@ algorithm
array<Option<BackendDAE.Equation>> equOptArr;

case ((BackendDAE.EQUATION_ARRAY(equOptArr = equOptArr)), _, _)
then BackendDAEUtil.traverseBackendDAEArrayNoCopy(equOptArr, func, traverseBackendDAEOptEqn, inTypeA);
then BackendDAEUtil.traverseArrayNoCopy(equOptArr, func, traverseBackendDAEOptEqn, inTypeA);

else
equation
Expand Down Expand Up @@ -979,7 +979,7 @@ algorithm
array<Option<BackendDAE.Equation>> equOptArr;

case ((BackendDAE.EQUATION_ARRAY(equOptArr = equOptArr)), _, _)
then BackendDAEUtil.traverseBackendDAEArrayNoCopyWithStop(equOptArr, func, traverseBackendDAEOptEqnWithStop, inTypeA);
then BackendDAEUtil.traverseArrayNoCopyWithStop(equOptArr, func, traverseBackendDAEOptEqnWithStop, inTypeA);

else
equation
Expand Down Expand Up @@ -1049,7 +1049,7 @@ algorithm

case ((BackendDAE.EQUATION_ARRAY(size=size, numberOfElement=numberOfElement, arrSize=arrSize, equOptArr = equOptArr)), _, _)
equation
(equOptArr, ext_arg) = BackendDAEUtil.traverseBackendDAEArrayNoCopyWithUpdate(equOptArr, func, traverseBackendDAEOptEqnWithUpdate, inTypeA);
(equOptArr, ext_arg) = BackendDAEUtil.traverseArrayNoCopyWithUpdate(equOptArr, func, traverseBackendDAEOptEqnWithUpdate, inTypeA);
then (BackendDAE.EQUATION_ARRAY(size, numberOfElement, arrSize, equOptArr), ext_arg);

else
Expand Down
6 changes: 3 additions & 3 deletions Compiler/BackEnd/BackendVariable.mo
Expand Up @@ -3299,7 +3299,7 @@ protected
algorithm
BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY(
numberOfElements = num_vars, varOptArr = vars)) := inVariables;
outArg := BackendDAEUtil.traverseBackendDAEArrayNoCopy(vars, inFunc,
outArg := BackendDAEUtil.traverseArrayNoCopy(vars, inFunc,
traverseBackendDAEVars2, inArg, num_vars);
end traverseBackendDAEVars;

Expand Down Expand Up @@ -3350,7 +3350,7 @@ protected
algorithm
BackendDAE.VARIABLES(varArr = BackendDAE.VARIABLE_ARRAY(
numberOfElements = num_vars, varOptArr = vars)) := inVariables;
outArg := BackendDAEUtil.traverseBackendDAEArrayNoCopyWithStop(vars, inFunc,
outArg := BackendDAEUtil.traverseArrayNoCopyWithStop(vars, inFunc,
traverseBackendDAEVarsWithStop2, inArg, num_vars);
end traverseBackendDAEVarsWithStop;

Expand Down Expand Up @@ -3405,7 +3405,7 @@ protected
algorithm
BackendDAE.VARIABLES(indices, BackendDAE.VARIABLE_ARRAY(
num_vars, arr_size, vars), buckets, num_vars) := inVariables;
(vars, outArg) := BackendDAEUtil.traverseBackendDAEArrayNoCopyWithUpdate(vars, inFunc,
(vars, outArg) := BackendDAEUtil.traverseArrayNoCopyWithUpdate(vars, inFunc,
traverseBackendDAEVarsWithUpdate2, inArg, num_vars);
outVariables := BackendDAE.VARIABLES(indices,
BackendDAE.VARIABLE_ARRAY(num_vars, arr_size, vars), buckets, num_vars);
Expand Down

0 comments on commit f468a6e

Please sign in to comment.