gridripper::math::expr::Evaluator Class Reference

Expression evaluator. More...

List of all members.

Static Public Member Functions

static Function createFunction (String expr, String varname)
 Creates a function from the specified string.
static Function createFunction (String expr, String varname, List< StkOp > stkops, List< Function > depvars)
 Creates a function from the specified string.
static Function addVar (String expr, String varname, List< Function > depvars)
 Creates a dependent variable and adds it to the list.
static StkConst addConst (String def, List< StkOp > stkops)
 Creates a constant and adds it to the list.
static int findStkOp (List< StkOp > stkops, String name)
 Finds the stack operation with the specified name in the list.
static void addConsts (String defs, List< StkOp > stkops)
 Creates constants from the definitions in the specified string.
static Function addVar (String def, String varname, List< StkOp > stkops, List< Function > depvars)
 Creates a dependent variable and adds it to the list.
static int findFunction (List< Function > funcs, String name)
 Finds the function with the specified name in the list.
static void addVars (String defs, String varname, List< StkOp > stkops, List< Function > depvars)
 Creates dependent variables from the definitions in the specified string.
static void addConstsAndVars (String defs, String varname, List< StkOp > stkops, List< Function > depvars)
 Creates constants and dependent variables from the definitions in the specified string.
static double eval (String expr, List< StkOp > stkops) throws IllegalArgumentException
 Evaluates the specified expression.

Classes

interface  Function
class  FunctionImpl
 User defined function.


Detailed Description

Expression evaluator.

Version:
03/06/2009
Since:
GridRipper 11/16/2008
Author:
Peter Csizmadia

Member Function Documentation

static Function gridripper::math::expr::Evaluator::createFunction ( String  expr,
String  varname 
) [inline, static]

Creates a function from the specified string.

Parameters:
expr the expression
varname name of the independent variable

static Function gridripper::math::expr::Evaluator::createFunction ( String  expr,
String  varname,
List< StkOp stkops,
List< Function >  depvars 
) [inline, static]

Creates a function from the specified string.

Parameters:
expr the expression
varname name of the independent variable
stkops list of constants and other stack operations
depvars additional dependent variables

static Function gridripper::math::expr::Evaluator::addVar ( String  expr,
String  varname,
List< Function >  depvars 
) [inline, static]

Creates a dependent variable and adds it to the list.

Parameters:
expr the variable definition
varname name of the independent variable
depvars list of dependent variables
Returns:
the new dependent variable

static StkConst gridripper::math::expr::Evaluator::addConst ( String  def,
List< StkOp stkops 
) [inline, static]

Creates a constant and adds it to the list.

Parameters:
def the variable definition
stkops list of constants and other stack operations
Returns:
the new dependent variable

static int gridripper::math::expr::Evaluator::findStkOp ( List< StkOp stkops,
String  name 
) [inline, static]

Finds the stack operation with the specified name in the list.

Parameters:
stkops list of stack operations
name name of stack operation to find
Returns:
the index if found, -1 otherwise

static void gridripper::math::expr::Evaluator::addConsts ( String  defs,
List< StkOp stkops 
) [inline, static]

Creates constants from the definitions in the specified string.

Each definition must end with a semicolon.

Parameters:
defs the variable definitions
stkops list of constants and other stack operations
Returns:
the new dependent variable

static Function gridripper::math::expr::Evaluator::addVar ( String  def,
String  varname,
List< StkOp stkops,
List< Function >  depvars 
) [inline, static]

Creates a dependent variable and adds it to the list.

Parameters:
def the variable definition
varname name of the independent variable
stkops list of constants and other stack operations
depvars list of dependent variables
Returns:
the new dependent variable

static int gridripper::math::expr::Evaluator::findFunction ( List< Function >  funcs,
String  name 
) [inline, static]

Finds the function with the specified name in the list.

Parameters:
funcs list of functions
name name of the function to find
Returns:
the index if found, -1 otherwise

static void gridripper::math::expr::Evaluator::addVars ( String  defs,
String  varname,
List< StkOp stkops,
List< Function >  depvars 
) [inline, static]

Creates dependent variables from the definitions in the specified string.

Each definition must end with a semicolon.

Parameters:
defs the variable definitions
varname name of the independent variable
stkops additional constants and variables
depvars list of dependent variables

static void gridripper::math::expr::Evaluator::addConstsAndVars ( String  defs,
String  varname,
List< StkOp stkops,
List< Function >  depvars 
) [inline, static]

Creates constants and dependent variables from the definitions in the specified string.

Each definition must end with a semicolon.

Parameters:
defs the variable definitions
varname name of the independent variable
stkops additional constants and variables
stkops list of constants and other stack operations
depvars list of dependent variables

static double gridripper::math::expr::Evaluator::eval ( String  expr,
List< StkOp stkops 
) throws IllegalArgumentException [inline, static]

Evaluates the specified expression.

Parameters:
expr the expression
stkops list of constants and other stack operations


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 18:47:29 2009 for GridRipper by  doxygen 1.5.6