org.lsmp.djep.vectorJep
Class VectorJep

java.lang.Object
  extended byorg.nfunk.jep.JEP
      extended byorg.lsmp.djep.vectorJep.VectorJep

public class VectorJep
extends JEP

An extension of JEP with support for basic vectors and matricies. Use this class instead of JEP if you wish to use vectors and matricies.

Author:
Rich Morris Created on 19-Dec-2003

Field Summary
 
Fields inherited from class org.nfunk.jep.JEP
allowAssignment, allowUndeclared, errorList, ev, funTab, implicitMul, numberFactory, opSet, parser, symTab
 
Constructor Summary
VectorJep()
           
VectorJep(JEP j)
           
 
Method Summary
 void addStandardFunctions()
          Adds the standard functions to the parser.
 java.lang.Object evaluate(Node node)
          Evaluate a node.
 java.lang.Object evaluateRaw(Node node)
          Evaluate a node.
 
Methods inherited from class org.nfunk.jep.JEP
addComplex, addConstant, addFunction, addStandardConstants, addVariable, addVariable, addVariable, getAllowAssignment, getAllowUndeclared, getComplexValue, getErrorInfo, getFunctionTable, getImplicitMul, getNumberFactory, getOperatorSet, getParser, getSymbolTable, getTopNode, getTraverse, getValue, getValueAsObject, 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
 

Constructor Detail

VectorJep

public VectorJep()

VectorJep

public VectorJep(JEP j)
Method Detail

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 JEP

evaluate

public java.lang.Object evaluate(Node node)
                          throws java.lang.Exception
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:
java.lang.Exception - if for some reason the expression could not be evaluated

evaluateRaw

public java.lang.Object evaluateRaw(Node node)
                             throws java.lang.Exception
Evaluate a node. Does not unwrap scalers.

Throws:
java.lang.Exception


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