Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Let simple array equations pass the backend, ticket:5110
Browse files Browse the repository at this point in the history
if -d=-nfScalarize
- adapt equation count
- turn error from strongComponentsScalar to warning

Belonging to [master]:
  - #2679
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Oct 4, 2018
1 parent cc4c1bf commit 8b160f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Compiler/BackEnd/BackendDAETransform.mo
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ algorithm
then (syst, comps);

else algorithm
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
then fail();
if Flags.isSet(Flags.NF_SCALARIZE) then
Error.addInternalError("function strongComponentsScalar failed (sorting strong components)", sourceInfo());
fail();
else
Error.addCompilerWarning("BackendDAETransform.strongComponentsScalar failed (sorting strong components)");
end if;
then (inSystem, {});
end matchcontinue;
end strongComponentsScalar;

Expand Down
8 changes: 7 additions & 1 deletion Compiler/BackEnd/BackendEquation.mo
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,17 @@ public function equationArraySize "author: lochel
should correspond to the number of variables."
input BackendDAE.EquationArray equationArray;
output Integer outSize;
protected
Boolean nfScalarize = Flags.isSet(Flags.NF_SCALARIZE);
algorithm
outSize := 0;
for i in 1:ExpandableArray.getLastUsedIndex(equationArray) loop
if ExpandableArray.occupied(i, equationArray) then
outSize := outSize + equationSize(ExpandableArray.get(i, equationArray));
if nfScalarize then
outSize := outSize + equationSize(ExpandableArray.get(i, equationArray));
else
outSize := outSize + 1;
end if;
end if;
end for;
end equationArraySize;
Expand Down

0 comments on commit 8b160f9

Please sign in to comment.