Skip to content

Commit

Permalink
- add array information to stateset.x variable
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15251 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Feb 20, 2013
1 parent e6eec91 commit c938b16
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Compiler/BackEnd/IndexReduction.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7437,16 +7437,14 @@ protected function getSetVars
protected
DAE.ComponentRef set;
DAE.Type tp;
list<Integer> range;
algorithm
// set := ComponentReference.makeCrefIdent("$STATESET",DAE.T_COMPLEX_DEFAULT,{DAE.INDEX(DAE.ICONST(index))});
set := ComponentReference.makeCrefIdent("$STATESET" +& intString(index),DAE.T_COMPLEX_DEFAULT,{});
tp := Util.if_(intGt(setsize,1),DAE.T_ARRAY(DAE.T_REAL_DEFAULT,{DAE.DIM_INTEGER(setsize)}, DAE.emptyTypeSource),DAE.T_REAL_DEFAULT);
crstates := ComponentReference.joinCrefs(set,ComponentReference.makeCrefIdent("x",tp,{}));
range := List.intRange(setsize);
crset := Debug.bcallret3(intGt(setsize,1),List.map1r,range, ComponentReference.subscriptCrefWithInt, crstates,{crstates});
oSetVars := List.map4(crset,generateVar,BackendDAE.STATE(1,NONE()),DAE.T_REAL_DEFAULT,{},NONE());
oSetVars := generateArrayVar(crstates,BackendDAE.STATE(1,NONE()),tp,NONE());
oSetVars := List.map1(oSetVars,BackendVariable.setVarFixed,false);
crset := List.map(oSetVars,BackendVariable.varCref);
tp := Util.if_(intGt(setsize,1),DAE.T_ARRAY(DAE.T_INTEGER_DEFAULT,{DAE.DIM_INTEGER(setsize),DAE.DIM_INTEGER(nStates)}, DAE.emptyTypeSource),
DAE.T_ARRAY(DAE.T_INTEGER_DEFAULT,{DAE.DIM_INTEGER(nStates)}, DAE.emptyTypeSource));
realtp := Util.if_(intGt(setsize,1),DAE.T_ARRAY(DAE.T_REAL_DEFAULT,{DAE.DIM_INTEGER(setsize),DAE.DIM_INTEGER(nStates)}, DAE.emptyTypeSource),
Expand Down

0 comments on commit c938b16

Please sign in to comment.