Class PassThroughDiffRule
- java.lang.Object
-
- com.singularsys.extensions.djep.diffRules.PassThroughDiffRule
-
- All Implemented Interfaces:
DiffRulesI,JepComponent,java.io.Serializable
public class PassThroughDiffRule extends java.lang.Object implements DiffRulesI
Rules like Sum where diff(sum(a,b,c),x) -> sum(da/dx,db/dx,dc/dx) are instance of this class.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PassThroughDiffRule(DJep djep, Operator op)PassThroughDiffRule(DJep djep, java.lang.String inName)PassThroughDiffRule(DJep djep, java.lang.String inName, PostfixMathCommandI inPfmc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Nodedifferentiate(ASTFunNode node, java.lang.String var, Node[] children, Node[] dchildren)Returns the top node of of the derivative of this function wrt to variable var.JepComponentgetLightWeightInstance()Gets a light-weight instance suitable for using in multiple threads.java.lang.StringgetName()Returns the name of the function.voidinit(Jep jep)Initialize the component.java.lang.StringtoString()Returns a string representation of the rule.
-
-
-
Constructor Detail
-
PassThroughDiffRule
public PassThroughDiffRule(DJep djep, java.lang.String inName)
-
PassThroughDiffRule
public PassThroughDiffRule(DJep djep, java.lang.String inName, PostfixMathCommandI inPfmc)
-
-
Method Detail
-
init
public void init(Jep jep)
Description copied from interface:JepComponentInitialize the component. This methods 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
public JepComponent getLightWeightInstance()
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either an new instance, null or 'this'.
-
toString
public java.lang.String toString()
Description copied from interface:DiffRulesIReturns a string representation of the rule.- Specified by:
toStringin interfaceDiffRulesI- Overrides:
toStringin classjava.lang.Object
-
getName
public java.lang.String 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, java.lang.String var, Node[] children, Node[] dchildren) throws ParseException
Description copied from interface:DiffRulesIReturns the top node of of the derivative of this function wrt to variable var.- Specified by:
differentiatein interfaceDiffRulesIvar- 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.
-
-