Class MacroDiffRules
java.lang.Object
com.singularsys.extensions.djep.diffRules.ChainRuleDiffRules
com.singularsys.extensions.djep.diffRules.MacroDiffRules
- All Implemented Interfaces:
DiffRulesI,JepComponent,Serializable
Rules are specified by an expression string or a trees of nodes. The standard
chain rule is applied
diff(f(g(x),h(x)),x) -> df/dg dg/dx + df/dh dh/dxfor example
DifferentiationVisitor dv = new DifferentiationVisitor(new TreeUtils(jep)); DiffRulesI rule = new MacroDiffRules(dv, "sin", "cos(x)");
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMacroDiffRules(DJep djep, String funName, Node node) Create a differentiation rule for function with 1 argumentMacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String rule) Create a differentiation rule for function with 1 argumentMacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String[] inRules) Create a differentiation rule for function with n arguments.MacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String rule1, String rule2) Create a differentiation rule for function with 2 arguments.MacroDiffRules(DJep djep, String funName, String rule) Create a differentiation rule for function with 1 argumentMacroDiffRules(DJep djep, String funName, String[] inRules) Create a differentiation rule for function with n arguments.MacroDiffRules(DJep djep, String funName, String rule1, String rule2) Create a differentiation rule for function with 2 arguments. -
Method Summary
Methods inherited from class com.singularsys.extensions.djep.diffRules.ChainRuleDiffRules
differentiate, getArgNames, getDescriptions, getLightWeightInstance, getName, getNumRules, getPfmc, getRule, init, setup, setup, setup, toString
-
Constructor Details
-
MacroDiffRules
Create a differentiation rule for function with 1 argument- Parameters:
djep- djep instancefunName- name of functionnode- a tree representing differentiation of function wrt "x"- Throws:
ParseException
-
MacroDiffRules
Create a differentiation rule for function with 1 argument- Parameters:
djep- djep instancefunName- name of functionrule- a string representing differentiation of a function wrt "x"- Throws:
ParseException
-
MacroDiffRules
public MacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String rule) throws ParseException Create a differentiation rule for function with 1 argument- Parameters:
djep- djep instancefunName- name of functionpfmc- PostfixMathCommandI for functionrule- a string representing differentiation of function wrt "x"- Throws:
ParseException
-
MacroDiffRules
public MacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String rule1, String rule2) throws ParseException Create a differentiation rule for function with 2 arguments. The rules must be in terms of "x" and "y"- Parameters:
djep- djep instancefunName- name of functionpfmc- PostfixMathCommandI for functionrule1- a string representing differentiation of function wrt "x"rule2- a string representing differentiation of function wrt "y"- Throws:
ParseException
-
MacroDiffRules
Create a differentiation rule for function with 2 arguments. The rules must be in terms of "x" and "y"- Parameters:
funName- name of functionrule1- a string representing differentiation of function wrt "x"rule2- a string representing differentiation of function wrt "y"- Throws:
ParseException
-
MacroDiffRules
public MacroDiffRules(DJep djep, String funName, PostfixMathCommandI pfmc, String[] inRules) throws ParseException Create a differentiation rule for function with n arguments. The rules must be in terms of "x1", "x2", ... "xn"- Parameters:
djep- djep instancefunName- name of functionpfmc- PostfixMathCommandI for function- Throws:
ParseException
-
MacroDiffRules
Create a differentiation rule for function with n arguments. The rules must be in terms of "x1", "x2", ... "xn"- Parameters:
funName- name of functioninRules- an array of strings representing differentiation of function wrt "x1",...- Throws:
ParseException
-