Skip to content

Commit

Permalink
[BE] move transpose to a single function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Feb 16, 2018
1 parent 90b9c22 commit d874cd0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Compiler/BackEnd/Differentiate.mo
Expand Up @@ -1574,6 +1574,14 @@ algorithm
(exp_1, _) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
then (exp_1, inFuncs);

case ("transpose",_)
equation
tp = Expression.typeof(exp);
(exp_1, funcs) = differentiateExp(exp, inDiffwrtCref, inInputData,inDiffType,inFuncs, maxIter);
exp_2 = Expression.makePureBuiltinCall("transpose",{exp_1},tp);
then
(exp_2, funcs);

case ("sum",_)
equation
tp = Expression.typeof(exp);
Expand Down Expand Up @@ -1703,12 +1711,6 @@ algorithm
then
(DAE.IFEXP(res, res1, res2), funcs);

case ("transpose", expl, DAE.CALL_ATTR(ty=tp))
equation
(dexpl, funcs) = List.map3Fold(expl, function differentiateExp(maxIter=maxIter), inDiffwrtCref, inInputData, inDiffType, inFunctionTree);
then
(Expression.makePureBuiltinCall("transpose", dexpl, tp), funcs);

case ("cross", {e1,e2}, DAE.CALL_ATTR(ty=tp))
equation
(res1, funcs) = differentiateExp(e1, inDiffwrtCref, inInputData, inDiffType, inFunctionTree, maxIter);
Expand Down

0 comments on commit d874cd0

Please sign in to comment.