Class MultiplyDiffRule
java.lang.Object
com.singularsys.extensions.djep.diffRules.MultiplyDiffRule
- All Implemented Interfaces:
DiffRulesI,JepComponent,Serializable
Differentiates a product with respect to a variable. diff(y*z,x) ->
diff(y,x)*z+y*diff(z,x)
- Since:
- Extensions 1.0 now works when multiply has more than two arguments.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMultiplyDiffRule(DJep djep, Operator op) MultiplyDiffRule(DJep djep, Operator mulop, Operator addop) -
Method Summary
Modifier and TypeMethodDescriptiondifferentiate(ASTFunNode node, String var, Node[] children, Node[] dchildren) Returns the top node of the derivative of this function wrt to variable var.Returns nullgetName()Returns the name of the function.voidInitialize the component.toString()Returns a string representation of the rule.
-
Constructor Details
-
MultiplyDiffRule
-
MultiplyDiffRule
-
-
Method Details
-
init
Description copied from interface:JepComponentInitialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Returns null- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-
toString
Description copied from interface:DiffRulesIReturns a string representation of the rule.- Specified by:
toStringin interfaceDiffRulesI- Overrides:
toStringin classObject
-
getName
Description copied from interface:DiffRulesIReturns 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:
getNamein interfaceDiffRulesI
-
differentiate
public Node differentiate(ASTFunNode node, String var, Node[] children, Node[] dchildren) throws JepException Description copied from interface:DiffRulesIReturns the top node of the derivative of this function wrt to variable var.- Specified by:
differentiatein 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:
JepException
-