Skip to content

Commit

Permalink
implement specific classes for reference arrays accessing simvars
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25671 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Apr 22, 2015
1 parent 854821e commit 5d4fa21
Show file tree
Hide file tree
Showing 2 changed files with 366 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -6287,7 +6287,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
<%match eq case SES_LINEAR(__) then
let size = listLength(vars)
<<
typedef StatArrayDim2<double,<%size%>,<%size%>,false> AMATRIX;
typedef StatArrayDim2<double,<%size%>,<%size%>> AMATRIX;
>>
%>

Expand Down Expand Up @@ -6326,7 +6326,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then

boost::shared_ptr<AMATRIX> __A; //dense
//b vector
StatArrayDim1<double,<%size%>,false > __b;
StatArrayDim1<double,<%size%>> __b;
>>
%>

Expand Down Expand Up @@ -7174,13 +7174,13 @@ match simVar
let typeString = variableType(type_)
let array_dimensions = arrayextentDims(name, v.numArrayElement)
match dims
case "0" then
<<
<%typeString%>& <%arrayName%>;
>>
else
case "0" then
<<
<%typeString%>& <%arrayName%>;
>>
else
<<
StatArrayDim<%dims%><<%typeString%>, <%array_dimensions%>,true> <%arrayName%>;
RefArrayDim<%dims%><<%typeString%>, <%array_dimensions%>> <%arrayName%>;
>>
/*special case for variables that marked as array but are not arrays */
case SIMVAR(numArrayElement=_::_) then
Expand Down

0 comments on commit 5d4fa21

Please sign in to comment.