Skip to content

Commit

Permalink
added differentiation rule for built-in sum call
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Feb 18, 2016
1 parent 5a950a9 commit 01caff9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Compiler/BackEnd/Differentiate.mo
Expand Up @@ -1590,6 +1590,14 @@ algorithm
(exp_1, _) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
then (exp_1, inFuncs);

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

case ("max",DAE.ARRAY(array=expl,ty=tp))
equation
tp = Types.arrayElementType(tp);
Expand Down

0 comments on commit 01caff9

Please sign in to comment.