org.lsmp.djep.matrixJep
Class MatrixJep
java.lang.Object
org.nfunk.jep.JEP
org.lsmp.djep.xjep.XJep
org.lsmp.djep.djep.DJep
org.lsmp.djep.matrixJep.MatrixJep
public class MatrixJep
- extends DJep
An extension of JEP which allows advanced vector and matrix handling and differentation.
- Author:
- Rich Morris
Created on 19-Dec-2003
Fields inherited from class org.lsmp.djep.djep.DJep |
dv |
Methods inherited from class org.lsmp.djep.xjep.XJep |
addComplex, addStandardConstants, calcVarValue, continueParsing, deepCopy, evaluate, getNodeFactory, getPrintVisitor, getTreeUtils, getVarsInEquation, print, print, println, println, recursiveGetVarsInEquation, restartParser, restartParser, simplify, substitute, substitute, toString |
Methods inherited from class org.nfunk.jep.JEP |
addConstant, addFunction, addVariable, addVariable, addVariable, getAllowAssignment, getAllowUndeclared, getComplexValue, getErrorInfo, getEvaluatorVisitor, getFunctionTable, getImplicitMul, getNumberFactory, getOperatorSet, getParser, getSymbolTable, getTopNode, getTraverse, getValue, getVar, getVarValue, hasError, initFunTab, initSymTab, parse, parseExpression, removeFunction, removeVariable, setAllowAssignment, setAllowUndeclared, setImplicitMul, setTraverse, setVarValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dec
protected MatrixPreprocessor dec
mvf
protected MatrixVariableFactory mvf
mev
protected MatrixEvaluator mev
MatrixJep
public MatrixJep()
addStandardFunctions
public void addStandardFunctions()
- Description copied from class:
JEP
- Adds the standard functions to the parser. If this function is not called
before parsing an expression, functions such as sin() or cos() would
produce an "Unrecognized function..." error.
In most cases, this method should be called immediately after the JEP
object is created.
- Overrides:
addStandardFunctions
in class XJep
evaluate
public java.lang.Object evaluate(Node node)
throws ParseException
- Evaluate a node. If the result is a scaler it
will be unwrapped, i.e. it will return a Double and not a Scaler.
- Overrides:
evaluate
in class JEP
- Parameters:
node
- the top node of the tree representing the expression.
- Returns:
- The value of the expression
- Throws:
ParseException
- if for some reason the expression could not be evaluated
evaluateRaw
public java.lang.Object evaluateRaw(Node node)
throws ParseException
- Evaluate a node. Does not unwrap scalers.
- Throws:
ParseException
preprocess
public Node preprocess(Node node)
throws ParseException
- Pre-processes an equation to allow the diff and eval operators to be used.
- Overrides:
preprocess
in class XJep
- Throws:
ParseException
getValueAsObject
public java.lang.Object getValueAsObject()
- Description copied from class:
JEP
- Evaluates and returns the value of the expression as an object.
The EvaluatorVisitor member ev is used to do the evaluation procedure.
This method is useful when the type of the value is unknown, or
not important.
- Overrides:
getValueAsObject
in class JEP
- Returns:
- The calculated value of the expression if no errors occur.
Returns null otherwise.
http://www.singularsys.com/jep Copyright © 2007 Singular Systems