Class ZeroDiffRule
java.lang.Object
com.singularsys.extensions.djep.diffRules.ZeroDiffRule
- All Implemented Interfaces:
DiffRulesI,JepComponent,Serializable
Rules like
diff(x > y,x) -> 0 where the derivative should be zero.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionZeroDiffRule(DJep djep, Operator op) ZeroDiffRule(DJep djep, String inName) ZeroDiffRule(DJep djep, String inName, PostfixMathCommandI inPfmc) -
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
-
ZeroDiffRule
-
ZeroDiffRule
-
ZeroDiffRule
-
-
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
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 ParseException 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:
ParseException- if there is some problem in compiling the derivative.
-