Package org.lsmp.djep.djep.diffRules
Class AdditionDiffRule
java.lang.Object
org.lsmp.djep.djep.diffRules.AdditionDiffRule
- All Implemented Interfaces:
DiffRulesI
Differentiates a addition with respect to var.
diff(y+z,x) -> diff(y,x)+diff(z,x)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondifferentiate
(ASTFunNode node, String var, Node[] children, Node[] dchildren, DJep djep) Returns the top node of of the derivative of this function wrt to variable var.getName()
Returns the name of the function.toString()
Returns a string representation of the rule.
-
Constructor Details
-
AdditionDiffRule
-
-
Method Details
-
toString
Description copied from interface:DiffRulesI
Returns a string representation of the rule.- Specified by:
toString
in interfaceDiffRulesI
- Overrides:
toString
in classObject
-
getName
Description copied from interface:DiffRulesI
Returns the name of the function. Used as index in hashtable and as way of linking with standard JEP functions. You probably want to specify the in the constructors.- Specified by:
getName
in interfaceDiffRulesI
-
differentiate
public Node differentiate(ASTFunNode node, String var, Node[] children, Node[] dchildren, DJep djep) throws ParseException Description copied from interface:DiffRulesI
Returns the top node of of the derivative of this function wrt to variable var.- Specified by:
differentiate
in interfaceDiffRulesI
- Parameters:
var
- The name of variable to differentiate wrt to.children
- the arguments of the functiondchildren
- the derivatives of each argument of the function.- Returns:
- top node of and expression tree for the derivative.
- Throws:
ParseException
- if there is some problem in compiling the derivative.
-