Skip to content

Commit

Permalink
-Fixed bug in DAEUtil.addEquationBoundString
Browse files Browse the repository at this point in the history
-Fixed bugs in Exp.typeof and Exp.simplifyAsub
-Fixed bug with functions not picked up in if-equations (all multibody examples affected).
-Added boolean to crefVectorize to decide if limits on dimensions should be checked against or not.
-Changed so UnitAbsynBuilder.registerUnits only performs work if unitChecking flag is set.
-Added Util.listPartition

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5482 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed May 10, 2010
1 parent 4e0e2ac commit 369459d
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 61 deletions.
21 changes: 15 additions & 6 deletions Compiler/DAEUtil.mo
Expand Up @@ -97,7 +97,9 @@ algorithm
end matchcontinue;
end expTypeComplex;

public function expTypeArray "returns true if type is array type"
public function expTypeArray "returns true if type is array type
Alternative names: isArrayType, isExpTypeArray
"
input DAE.ExpType tp;
output Boolean isArray;
algorithm
Expand Down Expand Up @@ -167,13 +169,20 @@ matchcontinue (bindExp,attr)
Option<Boolean> ip,fn;
String s;
case (bindExp,SOME(DAE.VAR_ATTR_REAL(e1,e2,e3,min,e4,e5,e6,sSelectOption,_,ip,fn)))
then (SOME(DAE.VAR_ATTR_REAL(e1,e2,e3,min,e4,e5,e6,sSelectOption,SOME(bindExp),ip,fn)));
then (SOME(DAE.VAR_ATTR_REAL(e1,e2,e3,min,e4,e5,e6,sSelectOption,SOME(bindExp),ip,fn)));

case (bindExp,SOME(DAE.VAR_ATTR_INT(e1,min,e2,e3,_,ip,fn)))
then SOME(DAE.VAR_ATTR_INT(e1,min,e2,e3,SOME(bindExp),ip,fn));
then SOME(DAE.VAR_ATTR_INT(e1,min,e2,e3,SOME(bindExp),ip,fn));

case (bindExp,SOME(DAE.VAR_ATTR_BOOL(e1,e2,e3,_,ip,fn)))
then SOME(DAE.VAR_ATTR_BOOL(e1,e2,e3,SOME(bindExp),ip,fn));
then SOME(DAE.VAR_ATTR_BOOL(e1,e2,e3,SOME(bindExp),ip,fn));

case (bindExp,SOME(DAE.VAR_ATTR_STRING(e1,e2,_,ip,fn)))
then SOME(DAE.VAR_ATTR_STRING(e1,e2,SOME(bindExp),ip,fn));
then SOME(DAE.VAR_ATTR_STRING(e1,e2,SOME(bindExp),ip,fn));

case (bindExp,SOME(DAE.VAR_ATTR_ENUMERATION(e1,min,e2,e3,_,ip,fn)))
then SOME(DAE.VAR_ATTR_ENUMERATION(e1,min,e2,e3,SOME(bindExp),ip,fn));

case(_,_) equation print("-failure in DAEUtil.addEquationBoundString\n"); then fail();
end matchcontinue;
end addEquationBoundString;
Expand Down Expand Up @@ -643,7 +652,7 @@ algorithm
end matchcontinue;
end dumpFunctionNamesStr;

protected function functionNameStr
public function functionNameStr
"return the name of a function, if element is not function return empty string"
input DAE.Element inElement;
output String res;
Expand Down
6 changes: 5 additions & 1 deletion Compiler/Exp.mo
Expand Up @@ -3717,6 +3717,8 @@ algorithm
e1_1 = simplifyAsub(e1, indx);
e2_1 = simplifyAsub(e2, indx);
then DAE.IFEXP(cond,e1_1,e2_1);

case(e,indx) then DAE.ASUB(e, {DAE.ICONST(indx)});
end matchcontinue;
end simplifyAsub;

Expand Down Expand Up @@ -4734,7 +4736,9 @@ algorithm
case (DAE.MATRIX(ty = tp)) then tp;
case (DAE.RANGE(ty = tp)) then tp;
case (DAE.CAST(ty = tp)) then tp;
case (DAE.ASUB(exp = e)) then typeof(e);
case (DAE.ASUB(exp = e,sub=explist)) equation
tp = unliftArrayTypeWithSubs(Util.listMap(explist,makeIndexSubscript) ,typeof(e));
then tp;
case (DAE.CODE(ty = tp)) then tp;
case (DAE.REDUCTION(expr = e)) then typeof(e);
case (DAE.END()) then DAE.ET_OTHER(); /* Can be any type. */
Expand Down
46 changes: 25 additions & 21 deletions Compiler/Inst.mo
Expand Up @@ -10835,8 +10835,8 @@ algorithm
DAE.ElementSource source "the origin of the element";
list<DAE.Element> daeElts1,daeElts2;
list<list<DAE.Element>> daeLLst;
DAE.DAElist fdae,fdae1,fdae11,fdae2,fdae3;
DAE.FunctionTree funcs;
DAE.DAElist fdae,fdae1,fdae11,fdae2,fdae3,dae2;
DAE.FunctionTree funcs,funcs1;
DAE.Const cnst;
Boolean unrollForLoops;

Expand Down Expand Up @@ -10966,9 +10966,9 @@ algorithm
// set the source of this element
source = DAEUtil.createElementSource(Env.getEnvPath(env), PrefixUtil.prefixToCrefOpt(pre), NONE(), NONE());

(cache,env_1,ih,daeLLst,_,ci_state_1,graph) = instIfTrueBranches(cache,env,ih, mod, pre, csets, ci_state,tb, false, impl, graph);
(cache,env_2,ih,DAE.DAE(daeElts2,_),_,ci_state_2,graph) = instList(cache,env_1,ih, mod, pre, csets, ci_state, instEEquation, fb, impl, alwaysUnroll, graph) "There are no connections inside if-clauses." ;
funcs = DAEUtil.avlTreeNew();
(cache,env_1,ih,daeLLst,funcs1,_,ci_state_1,graph) = instIfTrueBranches(cache,env,ih, mod, pre, csets, ci_state,tb, false, impl, graph);
(cache,env_2,ih,DAE.DAE(daeElts2,funcs),_,ci_state_2,graph) = instList(cache,env_1,ih, mod, pre, csets, ci_state, instEEquation, fb, impl, alwaysUnroll, graph) "There are no connections inside if-clauses." ;
funcs = DAEUtil.joinAvlTrees(funcs1,funcs);
dae = DAEUtil.joinDaes(DAE.DAE({DAE.IF_EQUATION(expl1,daeLLst,daeElts2,source)},funcs),fdae1);
then
(cache,env_1,ih,dae,csets,ci_state_1,graph);
Expand All @@ -10983,9 +10983,9 @@ algorithm
// set the source of this element
source = DAEUtil.createElementSource(Env.getEnvPath(env), PrefixUtil.prefixToCrefOpt(pre), NONE(), NONE());

(cache,env_1,ih,daeLLst,_,ci_state_1,graph) = instIfTrueBranches(cache,env,ih, mod, pre, csets, ci_state, tb, true, impl, graph);
(cache,env_2,ih,DAE.DAE(daeElts2,_),_,ci_state_2,graph) = instList(cache,env_1,ih, mod, pre, csets, ci_state, instEInitialequation, fb, impl, alwaysUnroll, graph) "There are no connections inside if-clauses." ;
funcs = DAEUtil.avlTreeNew(); /* No functions instantiated from equation sections */
(cache,env_1,ih,daeLLst,funcs1,_,ci_state_1,graph) = instIfTrueBranches(cache,env,ih, mod, pre, csets, ci_state, tb, true, impl, graph);
(cache,env_2,ih,DAE.DAE(daeElts2,funcs),_,ci_state_2,graph) = instList(cache,env_1,ih, mod, pre, csets, ci_state, instEInitialequation, fb, impl, alwaysUnroll, graph) "There are no connections inside if-clauses." ;
funcs = DAEUtil.joinAvlTrees(funcs1,funcs);
dae = DAEUtil.joinDaes(DAE.DAE({DAE.INITIAL_IF_EQUATION(expl1,daeLLst,daeElts2,source)},funcs),fdae1);
then
(cache,env_1,ih,dae,csets,ci_state_1,graph);
Expand Down Expand Up @@ -13939,8 +13939,7 @@ algorithm
cache = Env.addCachedInstFunc(cache,fpath1);
(cache,env,ih,equalityConstraintDAE) =
implicitFunctionInstantiation(cache,env,ih,DAE.NOMOD(),pre,sets_1,equalityConstraintFunction,{});
equalityConstraintDAE = DAEUtil.addDaeFunction(equalityConstraintDAE);

equalityConstraintDAE = DAEUtil.addDaeFunction(equalityConstraintDAE);
dae = DAEUtil.joinDaes(dae, equalityConstraintDAE);
then
(cache,env,ih,sets_1,dae,graph);
Expand Down Expand Up @@ -16549,11 +16548,12 @@ protected function instIfTrueBranches
output Env outEnv;
output InstanceHierarchy outIH;
output list<list<DAE.Element>> outDaeLst;
output DAE.FunctionTree funcs "functions collected from the branches";
output Connect.Sets outSets;
output ClassInf.State outState;
output ConnectionGraph.ConnectionGraph outGraph;
algorithm
(outCache,outEnv,outIH,outDaeLst,outSets,outState,outGraph):=
(outCache,outEnv,outIH,outDaeLst,funcs,outSets,outState,outGraph):=
matchcontinue (inCache,inEnv,inIH,inMod,inPrefix,inSets,inState,inTypeALst,IE,inBoolean,inGraph)
local
list<Env.Frame> env,env_1,env_2;
Expand All @@ -16571,27 +16571,31 @@ algorithm
InstanceHierarchy ih;
SCode.EEquation eee;
list<DAE.Element> elts;
DAE.FunctionTree funcs1,funcs2;

case (cache,env,ih,mod,pre,csets,ci_state,{},_,impl,graph)
case (cache,env,ih,mod,pre,csets,ci_state,{},_,impl,graph) equation
funcs = DAEUtil.avlTreeNew() "new functiontree";
then
(cache,env,ih,{},csets,ci_state,graph);
(cache,env,ih,{},funcs,csets,ci_state,graph);
case (cache,env,ih,mod,pre,csets,ci_state,(e :: es),false,impl,graph)
equation
(cache,env_1,ih,DAE.DAE(elts,_),csets_1,ci_state_1,graph) =
(cache,env_1,ih,DAE.DAE(elts,funcs1),csets_1,ci_state_1,graph) =
instList(cache, env, ih, mod, pre, csets, ci_state, instEEquation, e, impl, alwaysUnroll, graph);
(cache,env_2,ih,llb,csets_2,ci_state_2,graph) =
instIfTrueBranches(cache, env_1, ih, mod, pre, csets_1, ci_state_1, es, false, impl, graph);
(cache,env_2,ih,llb,funcs2,csets_2,ci_state_2,graph) =
instIfTrueBranches(cache, env_1, ih, mod, pre, csets_1, ci_state_1, es, false, impl, graph);
funcs = DAEUtil.joinAvlTrees(funcs1,funcs2);
then
(cache,env_2,ih,elts::llb,csets_2,ci_state_2,graph);
(cache,env_2,ih,elts::llb,funcs,csets_2,ci_state_2,graph);

case (cache,env,ih,mod,pre,csets,ci_state,(e :: es),true,impl,graph)
equation
(cache,env_1,ih,DAE.DAE(elts,_),csets_1,ci_state_1,graph) =
(cache,env_1,ih,DAE.DAE(elts,funcs1),csets_1,ci_state_1,graph) =
instList(cache, env, ih, mod, pre, csets, ci_state, instEInitialequation, e, impl, alwaysUnroll, graph);
(cache,env_2,ih,llb,csets_2,ci_state_2,graph) =
instIfTrueBranches(cache, env_1, ih, mod, pre, csets_1, ci_state_1, es, true, impl, graph);
(cache,env_2,ih,llb,funcs2,csets_2,ci_state_2,graph) =
instIfTrueBranches(cache, env_1, ih, mod, pre, csets_1, ci_state_1, es, true, impl, graph);
funcs = DAEUtil.joinAvlTrees(funcs1,funcs2);
then
(cache,env_2,ih,elts::llb,csets_2,ci_state_2,graph);
(cache,env_2,ih,elts::llb,funcs,csets_2,ci_state_2,graph);

case (cache,env,ih,mod,pre,csets,ci_state,(e :: es),_,impl,graph)
equation
Expand Down
63 changes: 32 additions & 31 deletions Compiler/Static.mo
@@ -1,9 +1,9 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Link�ping University,
* Copyright (c) 1998-CurrentYear, Linköping University,
* Department of Computer and Information Science,
* SE-58183 Link�ping, Sweden.
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
Expand All @@ -14,7 +14,7 @@
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Link�ping University, either from the above address,
* from Linköping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
Expand Down Expand Up @@ -6098,7 +6098,7 @@ algorithm
etp = Exp.typeof(e1);
eltTp = Types.arrayElementType(tp1);
dae = DAEUtil.joinDaes(dae1,dae2);
then (cache,DAE.CALL(Absyn.IDENT("cross"),{e1,e2},false,true,DAE.ET_ARRAY(etp,{SOME(3)}),DAE.NO_INLINE),
then (cache,DAE.CALL(Absyn.IDENT("cross"),{e1,e2},false,true,etp,DAE.NO_INLINE),
DAE.PROP((DAE.T_ARRAY(DAE.DIM(SOME(3)),eltTp),NONE),DAE.C_VAR()),dae);
end matchcontinue;
end elabBuiltinCross;
Expand Down Expand Up @@ -10271,7 +10271,7 @@ algorithm
expTy = Types.elabType(tt);
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e = crefVectorize(doVect, DAE.CREF(cr_1,expTy), tt, sexp,expIdTy);
e = crefVectorize(doVect, DAE.CREF(cr_1,expTy), tt, sexp,expIdTy,true);
then
(cache,e,DAE.C_VAR(),acc);

Expand All @@ -10281,7 +10281,7 @@ algorithm
expTy = Types.elabType(tt);
cr_1 = fillCrefSubscripts(cr, tt);
expIdTy = Types.elabType(idTp);
e = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
then
(cache,e,DAE.C_VAR(),acc);

Expand All @@ -10302,7 +10302,7 @@ algorithm
expTy = Types.elabType(tt);
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
(cache,v,_) = Ceval.ceval(cache,env,e_1,false,NONE,NONE,Ceval.MSG());
e = valueExp(v);
et = Types.typeOfValue(v);
Expand All @@ -10320,7 +10320,7 @@ algorithm
This must be caught later on.";
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
(cache,v,_) = Ceval.ceval(cache,env,e_1,false,NONE,NONE,Ceval.MSG());
e = valueExp(v);
et = Types.typeOfValue(v);
Expand All @@ -10334,7 +10334,7 @@ algorithm
expTy = Types.elabType(tt);
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
then
(cache,e_1,DAE.C_PARAM(),acc);

Expand All @@ -10346,7 +10346,7 @@ algorithm
This must be caught later on." ;
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
then
(cache,e_1,const,acc);

Expand All @@ -10356,7 +10356,7 @@ algorithm
expTy = Types.elabType(tt) "parameters with equal binding becomes C_PARAM" ;
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt,sexp,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt,sexp,expIdTy,true);
then
(cache,e_1,DAE.C_PARAM(),acc);

Expand All @@ -10366,7 +10366,7 @@ algorithm
expTy = Types.elabType(tt) "..the rest should be non constant, even if they have a constant binding." ;
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt, NONE,expIdTy,true);
then
(cache,e_1,DAE.C_VAR(),acc);

Expand Down Expand Up @@ -10436,7 +10436,7 @@ algorithm
expTy = Types.elabType(tt);
expIdTy = Types.elabType(idTp);
cr_1 = fillCrefSubscripts(cr, tt);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt,NONE,expIdTy);
e_1 = crefVectorize(doVect,DAE.CREF(cr_1,expTy), tt,NONE,expIdTy,true);
then
(cache,e_1,DAE.C_PARAM(),acc);

Expand All @@ -10450,7 +10450,7 @@ algorithm
end matchcontinue;
end elabCref2;

protected function crefVectorize
public function crefVectorize
"function: crefVectorize
This function takes a DAE.Exp and a DAE.Type and if the expression
is a ComponentRef and the type is an array it returns an array of
Expand All @@ -10464,10 +10464,11 @@ protected function crefVectorize
input DAE.Exp inExp;
input DAE.Type inType;
input Option<DAE.Exp> splicedExp;
input DAE.ExpType crefIdType "the type of the last cref ident, without considering subscripts. picked up from splicedExpData and used for crefs in vectorized exp";
input DAE.ExpType crefIdType "the type of the last cref ident, without considering subscripts. picked up from splicedExpData and used for crefs in vectorized exp";
input Boolean applyLimits "if true, only perform for small sized arrays (dimsize <20)";
output DAE.Exp outExp;
algorithm
outExp := matchcontinue (performVectorization,inExp,inType,splicedExp,crefIdType)
outExp := matchcontinue (performVectorization,inExp,inType,splicedExp,crefIdType,applyLimits)
local
Boolean b1,b2,doVect;
DAE.ExpType elt_tp,exptp,t2;
Expand All @@ -10483,55 +10484,55 @@ algorithm
DAE.ComponentRef testCREF;

// no vectorization
case(false, e, _, _,_) then e;
case(false, e, _, _,_,_) then e;

// types extending basictype
case (doVect,e,(DAE.T_COMPLEX(_,_,SOME(t),_),_),_,crefIdType)
case (doVect,e,(DAE.T_COMPLEX(_,_,SOME(t),_),_),_,crefIdType,applyLimits)
equation
e = crefVectorize(doVect,e,t,NONE,crefIdType);
e = crefVectorize(doVect,e,t,NONE,crefIdType,applyLimits);
then e;

// component reference and an array type with dimensions less than 20
case (_,DAE.CREF(componentRef = cr_2,ty = t2),
(tOrg as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType =
(t as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds2))),_))),_)),
SOME(exp1 as DAE.CREF(componentRef = cr,ty = exptp)),crefIdType)
SOME(exp1 as DAE.CREF(componentRef = cr,ty = exptp)),crefIdType,applyLimits)
equation
b1 = (ds < 20);
b2 = (ds2 < 20);
true = boolAnd(b1, b2);
true = boolAnd(b1, b2) or not applyLimits;
e = elabCrefSlice(cr,crefIdType);
e = tryToConvertArrayToMatrix(e);
then
e;

case(_, exp2 as (DAE.CREF(componentRef = cr_2,ty = t2)), (tOrg as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = t),_)), SOME(exp1 as DAE.CREF(componentRef = cr,ty = exptp)),crefIdType)
case(_, exp2 as (DAE.CREF(componentRef = cr_2,ty = t2)), (tOrg as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = t),_)), SOME(exp1 as DAE.CREF(componentRef = cr,ty = exptp)),crefIdType,applyLimits)
equation
false = Types.isArray(t);
(ds < 20) = true;
true = (ds < 20) or not applyLimits;
e = elabCrefSlice(cr,crefIdType);
then
e;

/* matrix sizes > 20 is not vectorized */
case (_,DAE.CREF(componentRef = cr,ty = exptp),(DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = (t as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds2))),_))),_),_,crefIdType)
case (_,DAE.CREF(componentRef = cr,ty = exptp),(DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = (t as (DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds2))),_))),_),_,crefIdType,applyLimits)
equation
b1 = (ds < 20);
b2 = (ds2 < 20);
true = boolAnd(b1, b2);
true = boolAnd(b1, b2) or not applyLimits;
e = createCrefArray2d(cr, 1, ds, ds2, exptp, t,crefIdType);
then
e;

/* vectorsizes > 20 is not vectorized */
case (_,DAE.CREF(componentRef = cr,ty = exptp),(DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = t),_),_,crefIdType)
case (_,DAE.CREF(componentRef = cr,ty = exptp),(DAE.T_ARRAY(arrayDim = DAE.DIM(integerOption = SOME(ds)),arrayType = t),_),_,crefIdType,applyLimits)
equation
false = Types.isArray(t);
(ds < 20) = true;
true = (ds < 20) or not applyLimits;
e = createCrefArray(cr, 1, ds, exptp, t,crefIdType);
then
e;
case (_,e,_,_,_) then e;
case (_,e,_,_,_,_) then e;
end matchcontinue;
end crefVectorize;

Expand Down Expand Up @@ -11032,7 +11033,7 @@ algorithm
cr_1 = Exp.crefStripLastSubs(cr);
cr_1 = Exp.subscriptCref(cr_1, DAE.INDEX(DAE.ICONST(indx))::ss);
elt_tp = Exp.unliftArray(et);
e_1 = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType);
e_1 = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType,true);
then
DAE.ARRAY(et,true,(e_1 :: expl));
// no subscript
Expand All @@ -11043,7 +11044,7 @@ algorithm
DAE.ARRAY(_,_,expl) = createCrefArray(cr, indx_1, ds, et, t,crefIdType);
cr_1 = Exp.subscriptCref(cr, {DAE.INDEX(DAE.ICONST(indx))});
elt_tp = Exp.unliftArray(et);
e_1 = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType);
e_1 = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType,true);
then
DAE.ARRAY(et,true,(e_1 :: expl));
// index
Expand Down Expand Up @@ -11102,7 +11103,7 @@ algorithm
DAE.MATRIX(_,_,ms) = createCrefArray2d(cr, indx_1, ds, ds2, et, t,crefIdType);
cr_1 = Exp.subscriptCref(cr, {DAE.INDEX(DAE.ICONST(indx))});
elt_tp = Exp.unliftArray(et);
DAE.ARRAY(tp,sc,expl) = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType);
DAE.ARRAY(tp,sc,expl) = crefVectorize(true,DAE.CREF(cr_1,elt_tp), t,NONE,crefIdType,true);
scs = Util.listFill(sc, ds2);
row = Util.listThreadTuple(expl, scs);
then
Expand Down

0 comments on commit 369459d

Please sign in to comment.