From d874cd0ea7f61008216af373d25f1b1a8f794ca4 Mon Sep 17 00:00:00 2001 From: Willi Braun Date: Thu, 15 Feb 2018 08:02:15 +0100 Subject: [PATCH] [BE] move transpose to a single function calls Belonging to [master]: - OpenModelica/OMCompiler#2203 - OpenModelica/OpenModelica-testsuite#856 --- Compiler/BackEnd/Differentiate.mo | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Compiler/BackEnd/Differentiate.mo b/Compiler/BackEnd/Differentiate.mo index ff94f5b379c..2fbaa00d17c 100644 --- a/Compiler/BackEnd/Differentiate.mo +++ b/Compiler/BackEnd/Differentiate.mo @@ -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); @@ -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);