Skip to content

Commit

Permalink
[NF] Expand transpose during simplification.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2735
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 23, 2018
1 parent f66e5ac commit 5e59184
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Compiler/NFFrontEnd/NFSimplifyExp.mo
Expand Up @@ -273,11 +273,15 @@ function simplifyTranspose
input Expression arg;
input Call call;
output Expression exp;
protected
Expression e;
algorithm
exp := match arg
e := if Expression.hasArrayCall(arg) then arg else ExpandExp.expand(arg);

exp := match e
case Expression.ARRAY()
guard List.all(arg.elements, Expression.isArray)
then Expression.transposeArray(arg);
guard List.all(e.elements, Expression.isArray)
then Expression.transposeArray(e);

else Expression.CALL(call);
end match;
Expand Down

0 comments on commit 5e59184

Please sign in to comment.