public class DVariable extends XVariable
PartialDerivative
.
The derivatives are stored in a hashtable index by
the sorted names of derivatives.
i.e. d^2f/dxdy, and d^2f/dydx will both be indexed by {"x","y"}.
df/dx is indexed by {"x"}, d^2f/dx^2 is index by {"x","x"}.
Partial derivatives are calculated as required by the
findDerivative method.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,PartialDerivative> |
derivatives |
Modifier | Constructor and Description |
---|---|
protected |
DVariable(java.lang.String name)
The constructor is package private.
|
protected |
DVariable(java.lang.String name,
java.lang.Object value) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<PartialDerivative> |
allDerivatives()
Enumerate all the derivatives of this variable.
|
protected PartialDerivative |
calculateDerivative(java.lang.String[] derivnames,
DJep jep)
calculate a derivative.
|
protected PartialDerivative |
createDerivative(java.lang.String[] derivnames,
Node eqn) |
boolean |
derivativeIsTrivallyZero() |
void |
invalidateAll()
makes value and values of all derivatives invalid.
|
static java.lang.String |
makeDerivString(java.lang.String rootname,
java.lang.String[] dnames)
Produces a string to represent the derivative.
|
void |
setEquation(Node eqn)
sets the equation
|
java.lang.String |
toString(PrintVisitor bpv)
Returns a string rep of variable with its equation and value.
|
calcValue, getEquation, hasEquation, toString
getHook, getName, getValue, hasValidValue, hookKeys, isConstant, removeHook, setHook, setIsConstant, setValidValue, setValue, setValue, setValueRaw
protected java.util.Map<java.lang.String,PartialDerivative> derivatives
protected DVariable(java.lang.String name)
protected DVariable(java.lang.String name, java.lang.Object value)
protected PartialDerivative createDerivative(java.lang.String[] derivnames, Node eqn)
public void setEquation(Node eqn)
setEquation
in class XVariable
public void invalidateAll()
public static java.lang.String makeDerivString(java.lang.String rootname, java.lang.String[] dnames)
rootname
- name of the variable we are calculating the derivative of.dnames
- An array of the names of each of the partial derivatives.protected PartialDerivative calculateDerivative(java.lang.String[] derivnames, DJep jep) throws ParseException
ParseException
public java.lang.String toString(PrintVisitor bpv)
XVariable
public java.lang.Iterable<PartialDerivative> allDerivatives()
public boolean derivativeIsTrivallyZero()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep