Skip to content

Commit

Permalink
Handle DAE.REDUCTION in differentiateExp.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2823
  • Loading branch information
perost authored and OpenModelica-Hudson committed Dec 10, 2018
1 parent a1f95a6 commit b641911
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Compiler/BackEnd/Differentiate.mo
Expand Up @@ -741,6 +741,19 @@ algorithm
case DAE.RANGE()
then (inExp, inFunctionTree);

case DAE.REDUCTION()
algorithm
(res1, functionTree) := differentiateExp(inExp.expr, inDiffwrtCref, inInputData, inDiffType, inFunctionTree, maxIter-1);

if not referenceEq(inExp.expr, res1) then
res := DAE.REDUCTION(inExp.reductionInfo, res1, inExp.iterators);
res := ExpressionSimplify.simplify1(res);
else
res := inExp;
end if;
then
(res, functionTree);

else equation
true = Flags.isSet(Flags.FAILTRACE);
s1 = ExpressionDump.printExpStr(inExp);
Expand Down

0 comments on commit b641911

Please sign in to comment.