|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lsmp.djep.djep.diffRules.ChainRuleDiffRules
Common methods used when the rules are specified by node trees or strings. All subclasses use the chain rule to differentiate. df(g(x),h(x))/dx -> df/dg * dg/dx + df/dh * dh/dx Variable names MUST be x,y for 1 to 2 variables or x1,x2,x3 for 3 for more variables.
Field Summary | |
protected java.lang.String |
name
|
protected PostfixMathCommandI |
pfmc
|
protected Node[] |
rules
|
Constructor Summary | |
ChainRuleDiffRules()
Cannot construct outside the context of a differentation visitor. |
Method Summary | |
Node |
differentiate(ASTFunNode node,
java.lang.String var,
Node[] children,
Node[] dchildren,
DJep djep)
Use the chain rule to differentiate. |
java.lang.String |
getName()
returns the name of the function |
int |
getNumRules()
Returns the number of rules which should be number of arguments of function |
PostfixMathCommandI |
getPfmc()
returns the PostfixMathCommandI for the function. |
Node |
getRule(int i)
returns the i-th rule as an expression tree. |
java.lang.String |
toString()
Returns a string representation of the rule. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String name
protected PostfixMathCommandI pfmc
protected Node[] rules
Constructor Detail |
public ChainRuleDiffRules()
Method Detail |
public java.lang.String getName()
getName
in interface DiffRulesI
public PostfixMathCommandI getPfmc()
public int getNumRules()
public Node getRule(int i)
public Node differentiate(ASTFunNode node, java.lang.String var, Node[] children, Node[] dchildren, DJep djep) throws ParseException
differentiate
in interface DiffRulesI
var
- The name of variable to differentiate wrt to.
ParseException
- if there is some problem in compiling the derivative.public java.lang.String toString()
DiffRulesI
toString
in interface DiffRulesI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |