Skip to content

Commit

Permalink
added rule for derive DAE.RECORD
Browse files Browse the repository at this point in the history
  • Loading branch information
vruge committed Mar 25, 2016
1 parent 41a0601 commit 9f902c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Compiler/BackEnd/Differentiate.mo
Expand Up @@ -555,6 +555,7 @@ algorithm
DAE.Type tp;
Integer i;
String s1, s2;
list<String> strLst;
//String se1;
list<DAE.Exp> sub, expl;
list<list<DAE.Exp>> matrix, dmatrix;
Expand All @@ -565,6 +566,17 @@ algorithm
case DAE.RCONST() then (DAE.RCONST(0.0), inFunctionTree);
case DAE.SCONST() then (inExp, inFunctionTree);


case DAE.RECORD(path = p, exps = expl, comp = strLst, ty=tp)
algorithm
sub := {};
functionTree := inFunctionTree;
for e in expl loop
(e1, functionTree) := differentiateExp(e,inDiffwrtCref, inInputData, inDiffType, functionTree, maxIter, inExpStack);
sub := e1 :: sub;
end for;
then (DAE.RECORD(p, listReverse(sub), strLst, tp), functionTree);

// differentiate cref
case DAE.CREF() equation
//se1 = ExpressionDump.printExpStr(inExp);
Expand Down

0 comments on commit 9f902c3

Please sign in to comment.