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

Commit 0bcaee0

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Expand tranpose better.
- Do proper expansion of transpose in ExpandExp instead of using the generic expansion. Belonging to [master]: - #2660
1 parent 232b213 commit 0bcaee0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Compiler/NFFrontEnd/NFExpandExp.mo

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ public
249249
case "der" then expandBuiltinGeneric(call);
250250
case "pre" then expandBuiltinGeneric(call);
251251
case "previous" then expandBuiltinGeneric(call);
252+
case "transpose" then expandBuiltinTranspose(listHead(args));
252253
end match;
253254
end expandBuiltinCall;
254255

@@ -286,6 +287,18 @@ public
286287
exp := Expression.promote(eexp, Expression.typeOf(eexp), n);
287288
end expandBuiltinPromote;
288289

290+
function expandBuiltinTranspose
291+
input Expression arg;
292+
output Expression outExp;
293+
output Boolean expanded;
294+
algorithm
295+
(outExp, expanded) := expand(arg);
296+
297+
if expanded then
298+
outExp := Expression.transposeArray(outExp);
299+
end if;
300+
end expandBuiltinTranspose;
301+
289302
function expandBuiltinGeneric
290303
input Call call;
291304
output Expression outExp;

0 commit comments

Comments
 (0)