Class DivideDiffRule
java.lang.Object
com.singularsys.extensions.djep.diffRules.DivideDiffRule
- All Implemented Interfaces:
DiffRulesI,JepComponent,Serializable
Differentiates a division with respect to a variable.
diff(y/z,x) -> (diff(y,x)*z-y*diff(z,x))/(z*z)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDivideDiffRule(DJep djep, Operator op) DivideDiffRule(DJep djep, Operator divide, Operator multiply, Operator subtract) -
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.Gets a light-weight instance suitable for using in multiple threads.getName()Returns the name of the function.voidInitialize the component.toString()Returns a string representation of the rule.
-
Constructor Details
-
DivideDiffRule
-
DivideDiffRule
-
-
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:
djep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- 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
-