always substitute diffs of expressions that contain leads. closes #21

parent a1c79e6a
Pipeline #938 passed with stage
in 1 minute and 52 seconds
......@@ -336,6 +336,9 @@ DataTree::AddPowerDeriv(expr_t iArg1, expr_t iArg2, int powerDerivOrder)
expr_t
DataTree::AddDiff(expr_t iArg1)
{
if (iArg1->maxLead() > 0)
// Issue #21: always substitute diffs with lags
return AddMinus(iArg1, iArg1->decreaseLeadsLags(1));
return AddUnaryOp(UnaryOpcode::diff, iArg1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment