|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.nfunk.jep.Variable
org.lsmp.djep.xjep.XVariable
org.lsmp.djep.djep.DVariable
public class DVariable
Holds all info about a variable.
Has a name, an equation, a dimension (or sent of dimensions if matrix or tensor)
and also a set of 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.
| Field Summary | |
|---|---|
protected Hashtable |
derivatives
|
| Fields inherited from class org.nfunk.jep.Variable |
|---|
name |
| Constructor Summary | |
|---|---|
protected |
DVariable(String name)
The constructor is package private. |
protected |
DVariable(String name,
Object value)
|
| Method Summary | |
|---|---|
Enumeration |
allDerivatives()
Enumerate all the derivatives of this variable. |
protected PartialDerivative |
createDerivative(String[] derivnames,
Node eqn)
|
void |
invalidateAll()
makes value and values of all derivatives invalid. |
static String |
makeDerivString(String rootname,
String[] dnames)
Produces a string to represent the derivative. |
void |
setEquation(Node eqn)
sets the equation |
String |
toString(PrintVisitor bpv)
Returns a string rep of variable with its equation and value. |
| Methods inherited from class org.lsmp.djep.xjep.XVariable |
|---|
calcValue, getEquation, hasEquation |
| Methods inherited from class org.nfunk.jep.Variable |
|---|
getName, getValue, hasValidValue, isConstant, setIsConstant, setValidValue, setValue, setValueRaw, toString |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Hashtable derivatives
| Constructor Detail |
|---|
protected DVariable(String name)
protected DVariable(String name,
Object value)
| Method Detail |
|---|
protected PartialDerivative createDerivative(String[] derivnames,
Node eqn)
public void setEquation(Node eqn)
setEquation in class XVariablepublic void invalidateAll()
public static String makeDerivString(String rootname,
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.
public String toString(PrintVisitor bpv)
XVariable
toString in class XVariablepublic Enumeration allDerivatives()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||