[poincare] Added method didDerivate to Expression and ExpressionNode

This method is to be implemented by derivable expression subclasses, for use in Derivative::shallowReduce. It performs the calculation for the derivative, and returns whether calculations happened.

Change-Id: I13cdb131e2044578392f5178a9f389314c1c4c8a
This commit is contained in:
Gabriel Ozouf
2020-05-19 11:25:59 +02:00
committed by Émilie Feral
parent eed1648363
commit 051e608835
7 changed files with 54 additions and 5 deletions

View File

@@ -127,6 +127,10 @@ Expression ExpressionNode::shallowBeautify(ReductionContext reductionContext) {
return Expression(this).defaultShallowBeautify();
}
bool ExpressionNode::didDerivate(ReductionContext reductionContext, Expression symbol, Expression symbolValue) {
return Expression(this).defaultDidDerivate();
}
bool ExpressionNode::isOfType(Type * types, int length) const {
for (int i = 0; i < length; i++) {
if (type() == types[i]) {