Skip to content

Commit

Permalink
Take variable size into account in checkModel (#9959)
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Jan 16, 2023
1 parent afb9c37 commit 1298f85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions OMCompiler/Compiler/FrontEnd/CheckModel.mo
Expand Up @@ -110,7 +110,7 @@ algorithm
(varSize, eqnSize, eqns, hs) = inArg;
b = DAEUtil.isInput(element) and DAEUtil.isPublicVar(element);
ce = Expression.crefExp(cr);
size = if b then 0 else 1;
size = if b then 0 else Expression.sizeOf(element.ty);
eqns = List.consOnTrue(not b, DAE.EQUATION(ce, e, source), eqns);
hs = if not b then BaseHashSet.add(cr, hs) else hs;
then (varSize+size, eqnSize+size, eqns, hs);
Expand All @@ -121,7 +121,7 @@ algorithm
(varSize, eqnSize, eqns, hs) = inArg;
b = DAEUtil.isInput(element) and DAEUtil.isPublicVar(element);
ce = Expression.crefExp(cr);
size = if b then 0 else 1;
size = if b then 0 else Expression.sizeOf(element.ty);
eqns = List.consOnTrue(not b, DAE.EQUATION(ce, e, source), eqns);
hs = if not b then BaseHashSet.add(cr, hs) else hs;
then (varSize+size, eqnSize+size, eqns, hs);
Expand All @@ -131,7 +131,7 @@ algorithm
equation
(varSize, eqnSize, eqns, hs) = inArg;
b = DAEUtil.isInput(element) and DAEUtil.isPublicVar(element);
size = if b then 0 else 1;
size = if b then 0 else Expression.sizeOf(element.ty);
hs = if not b then BaseHashSet.add(cr, hs) else hs;
then (varSize+size, eqnSize, eqns, hs);

Expand All @@ -140,7 +140,7 @@ algorithm
equation
(varSize, eqnSize, eqns, hs) = inArg;
b = DAEUtil.isInput(element) and DAEUtil.isPublicVar(element);
size = if b then 0 else 1;
size = if b then 0 else Expression.sizeOf(element.ty);
hs = if not b then BaseHashSet.add(cr, hs) else hs;
then (varSize+size, eqnSize, eqns, hs);

Expand Down

0 comments on commit 1298f85

Please sign in to comment.