Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25808 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Apr 29, 2015
1 parent 2f771a1 commit 8b738d6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -1556,7 +1556,7 @@ algorithm
Option<SimCode.FmiModelStructure> modelStruct;
list<SimCodeVar.SimVar> mixedArrayVars;
HashTableCrIListArray.HashTable varToArrayIndexMapping; //maps each variable to an array position

case (dlow, class_, _, fileDir, _,_, _, _, _, _, _, _, _) equation
System.tmpTickReset(0);
uniqueEqIndex = 1;
Expand Down Expand Up @@ -1720,7 +1720,7 @@ algorithm
//print("HASHTABLE MAPPING\n\n");
//BaseHashTable.dumpHashTable(varToArrayIndexMapping);
//print("\n\n");

simCode = SimCode.SIMCODE(modelInfo,
{}, // Set by the traversal below...
recordDecls,
Expand Down Expand Up @@ -12530,16 +12530,16 @@ algorithm
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(boolParamVars, function createVarToArrayIndexMapping1(iVarType=3), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(inputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(outputVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(constVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(constVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(realOptimizeConstraintsVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(realOptimizeFinalConstraintsVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));

((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(aliasVars, function createVarToArrayIndexMapping1(iVarType=1), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(intAliasVars, function createVarToArrayIndexMapping1(iVarType=2), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(boolAliasVars, function createVarToArrayIndexMapping1(iVarType=3), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
then varArrayIndexMappingHashTable;
else
then HashTableCrIListArray.emptyHashTable();
then HashTableCrIListArray.emptyHashTable();
end match;
end createVarToArrayIndexMapping;

Expand All @@ -12554,7 +12554,7 @@ protected
DAE.ComponentRef arrayCref, varName, name, arrayName;
Integer varIdx, arrayIndex;
array<Integer> varIndices;
list<Integer> arrayDimensions;
list<Integer> arrayDimensions;
list<String> numArrayElement;
list<DAE.ComponentRef> expandedCrefs;
list<String> numArrayElement;
Expand All @@ -12569,9 +12569,9 @@ algorithm
(tmpCurrentVarIndices,varIdx) = getArrayIdxByVar(iVar, iVarType, tmpVarToIndexMapping, tmpCurrentVarIndices);
//print("Adding variable " + ComponentReference.printComponentRefStr(name) + " to map with index " + intString(varIdx) + "\n");
tmpVarToIndexMapping = BaseHashTable.add((name, {varIdx}), tmpVarToIndexMapping);
arraySubscripts = ComponentReference.crefLastSubs(name);
arraySubscripts = ComponentReference.crefLastSubs(name);
arrayName = ComponentReference.crefStripLastSubs(name); // removeSubscripts(name);

if(ComponentReference.crefEqual(arrayName, name)) then
//print("Array not found\n");
varIndices = arrayCreate(1, varIdx);
Expand Down Expand Up @@ -12619,20 +12619,20 @@ algorithm
then (tmpCurrentVarIndices, varIdx);
case(SimCodeVar.SIMVAR(name=name, aliasvar=SimCodeVar.NEGATEDALIAS(varName)),_,_)
equation
if(BaseHashTable.hasKey(varName, iVarToIndexMapping)) then
if(BaseHashTable.hasKey(varName, iVarToIndexMapping)) then
varIdx::_ = BaseHashTable.get(varName, iVarToIndexMapping);
varIdx = intMul(varIdx,-1);
else
Error.addMessage(Error.INTERNAL_ERROR, {"Negated alias to unknown variable given."});
end if;
end if;
then (iCurrentVarIndices, varIdx);
case(SimCodeVar.SIMVAR(name=name, aliasvar=SimCodeVar.ALIAS(varName)),_,_)
equation
if(BaseHashTable.hasKey(varName, iVarToIndexMapping)) then
varIdx::_ = BaseHashTable.get(varName, iVarToIndexMapping);
else
Error.addMessage(Error.INTERNAL_ERROR, {"Alias to unknown variable given."});
end if;
end if;
then (iCurrentVarIndices, varIdx);
end match;
end getArrayIdxByVar;
Expand Down Expand Up @@ -12674,7 +12674,7 @@ protected
algorithm
varName := ComponentReference.crefStripLastSubs(varName);//removeSubscripts(varName);
if(BaseHashTable.hasKey(varName, iVarToArrayIndexMapping)) then
((_,varIndices)) := BaseHashTable.get(varName, iVarToArrayIndexMapping);
((_,varIndices)) := BaseHashTable.get(varName, iVarToArrayIndexMapping);
arraySize := arrayLength(varIndices);
for arrayIdx in 0:(arraySize-1) loop
idx := arrayGet(varIndices, arraySize-arrayIdx);
Expand Down
6 changes: 3 additions & 3 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -15,11 +15,11 @@ template translateModel(SimCode simCode)
let target = simulationCodeTarget()
let &extraFuncs = buffer "" /*BUFD*/
let &extraFuncsDecl = buffer "" /*BUFD*/

let numRealVars = numRealvars(modelInfo)
let numIntVars = numIntvars(modelInfo)
let numBoolVars = numBoolvars(modelInfo)

let()= textFile(simulationMainFile(target, simCode , &extraFuncs , &extraFuncsDecl, "", "", "", "", numRealVars, numIntVars, numBoolVars, getPreVarsCount(modelInfo)), 'OMCpp<%fileNamePrefix%>Main.cpp')
let()= textFile(simulationCppFile(simCode, contextOther, stringInt(numRealVars), stringInt(numIntVars), stringInt(numBoolVars), &extraFuncs, &extraFuncsDecl, '<%lastIdentOfPath(modelInfo.name)%>', stateDerVectorName, false), 'OMCpp<%fileNamePrefix%>.cpp')
let()= textFile(simulationHeaderFile(simCode , contextOther,&extraFuncs , &extraFuncsDecl, '<%lastIdentOfPath(modelInfo.name)%>', "", "", "", MemberVariable(modelInfo, false), MemberVariablePreVariables(modelInfo,false), false), 'OMCpp<%fileNamePrefix%>.h')
Expand Down Expand Up @@ -6878,7 +6878,7 @@ match simVar
var_init
else
let size = Util.mulStringDelimit2Int(array_num_elem,",")
let var_init =
let var_init =
<<
>>
let arrayIndices = SimCodeUtil.getVarIndexListByMapping(varToArrayIndexMapping,name,indexForUndefinedReferences) |> idx => '(<%idx%>)'; separator=""
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenCppHpcom.tpl
Expand Up @@ -22,7 +22,7 @@ template translateModel(SimCode simCode)
let &extraFuncsDecl = buffer "" /*BUFD*/
let stateDerVectorName = "__zDot"
let useMemoryOptimization = Flags.isSet(Flags.HPCOM_MEMORY_OPT)

let numRealVars = numRealvars(modelInfo, hpcomData.hpcOmMemory)
let numIntVars = numIntvars(modelInfo, hpcomData.hpcOmMemory)
let numBoolVars = numBoolvars(modelInfo, hpcomData.hpcOmMemory)
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Template/SimCodeTV.mo
Expand Up @@ -157,7 +157,7 @@ package builtin
input Integer index;
output Integer ch;
end stringGet;

function listHead
replaceable type TypeVar subtypeof Any;
input list<TypeVar> lst;
Expand Down

0 comments on commit 8b738d6

Please sign in to comment.