org.lsmp.djep.matrixJep
Class MatrixVariable

java.lang.Object
  extended by java.util.Observable
      extended by org.nfunk.jep.Variable
          extended by org.lsmp.djep.xjep.XVariable
              extended by org.lsmp.djep.djep.DVariable
                  extended by org.lsmp.djep.matrixJep.MatrixVariable
All Implemented Interfaces:
MatrixVariableI

public class MatrixVariable
extends DVariable
implements MatrixVariableI

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 MatrixPartialDerivative. 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.

Since:
2.3.2 Added a setValue method overriding
Author:
Rich Morris Created on 26-Oct-2003

Field Summary
 
Fields inherited from class org.lsmp.djep.djep.DVariable
derivatives
 
Fields inherited from class org.nfunk.jep.Variable
name
 
Method Summary
protected  PartialDerivative createDerivative(java.lang.String[] derivnames, Node eqn)
           
 Dimensions getDimensions()
          The dimension of the variable.
 MatrixValueI getMValue()
          returns the value, uses the Scaler type.
 java.lang.Object getValue()
          returns the value, unpacks Scalers so they just return its elements.
 void print(PrintVisitor bpv)
           
 void setDimensions(Dimensions dims)
          Sets the dimension of the variable.
 void setMValue(MatrixValueI val)
          Sets the value of the variable (matrix aware).
protected  boolean setValueRaw(java.lang.Object val)
          Sets the value of this variable.
 
Methods inherited from class org.lsmp.djep.djep.DVariable
allDerivatives, invalidateAll, makeDerivString, setEquation, toString
 
Methods inherited from class org.lsmp.djep.xjep.XVariable
calcValue, getEquation, hasEquation
 
Methods inherited from class org.nfunk.jep.Variable
getName, hasValidValue, isConstant, setIsConstant, setValidValue, setValue, 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
 
Methods inherited from interface org.lsmp.djep.matrixJep.MatrixVariableI
getEquation, getName, hasEquation, hasValidValue, isConstant, setValidValue
 

Method Detail

createDerivative

protected PartialDerivative createDerivative(java.lang.String[] derivnames,
                                             Node eqn)
Overrides:
createDerivative in class DVariable

getDimensions

public Dimensions getDimensions()
Description copied from interface: MatrixVariableI
The dimension of the variable.

Specified by:
getDimensions in interface MatrixVariableI

setDimensions

public void setDimensions(Dimensions dims)
Description copied from interface: MatrixVariableI
Sets the dimension of the variable. Will also allocate appropriate space for value container.

Specified by:
setDimensions in interface MatrixVariableI

getMValue

public MatrixValueI getMValue()
returns the value, uses the Scaler type.

Specified by:
getMValue in interface MatrixVariableI

getValue

public java.lang.Object getValue()
returns the value, unpacks Scalers so they just return its elements.

Overrides:
getValue in class Variable

setValueRaw

protected boolean setValueRaw(java.lang.Object val)
Sets the value of this variable. Needed when using macro functions in matrix calculations. TODO might be better to change macro function behaviour.

Overrides:
setValueRaw in class Variable
Returns:
false if tried to change a constant value.

setMValue

public void setMValue(MatrixValueI val)
Description copied from interface: MatrixVariableI
Sets the value of the variable (matrix aware).

Specified by:
setMValue in interface MatrixVariableI

print

public void print(PrintVisitor bpv)


http://www.singularsys.com/jep Copyright © 2007 Singular Systems