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

Expression evaluator. More...

#include <Evaluator.h>

List of all members.

Static Public Member Functions

static FunctioncreateFunction (const string &expr, const string &varname, const tvector< StkOp * > &stkops=*(const tvector< StkOp * > *) 0, const tvector< Function * > &depvars=*(const tvector< Function * > *) 0) throw (IllegalArgumentException&)
 Creates a function from the specified string.
static StkConstaddConst (const string &def, tvector< StkOp * > stkops) throw (IllegalArgumentException&)
 Creates a constant and adds it to the list.
static void addConsts (const string &defs, tvector< StkOp * > &stkops) throw (IllegalArgumentException&)
 Creates constants from the definitions in the specified string.
static int findStkOp (const tvector< StkOp * > &stkops, const string &name)
 Finds the stack operation with the specified name in the list.
static FunctionaddVar (const string &def, const string &varname, const tvector< StkOp * > &stkops, tvector< Function * > &depvars) throw (IllegalArgumentException&)
 Creates a dependent variable and adds it to the list.
static void addVars (const string &defs, const string &varname, tvector< StkOp * > &stkops, tvector< Function * > &depvars) throw (IllegalArgumentException&)
 Creates dependent variables from the definitions in the specified string.
static void addConstsAndVars (const string &defs, const string &varname, tvector< StkOp * > &stkops, tvector< Function * > &depvars) throw (IllegalArgumentException&)
 Creates constants and dependent variables from the definitions in the specified string.
static int findFunction (const tvector< Function * > &funcs, const string &name)
 Finds the function with the specified name in the list.
static GReal_t eval (const string &expr, const tvector< StkOp * > &stkops=*(const tvector< StkOp * > *) 0) throw (IllegalArgumentException&)
 Evaluates the specified expression.

Classes

class  Function
 User defined function. More...


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 ( const string &  expr,
const string &  varname,
const tvector< StkOp * > &  stkops = *(const tvectorStkOp * > *) 0,
const tvector< Function * > &  depvars = *(const tvectorFunction * > *) 0 
) throw (IllegalArgumentException&) [static]

Creates a function from the specified string.

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

static StkConst* gridripper::math::expr::Evaluator::addConst ( const string &  def,
tvector< StkOp * >  stkops 
) throw (IllegalArgumentException&) [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 void gridripper::math::expr::Evaluator::addConsts ( const string &  defs,
tvector< StkOp * > &  stkops 
) throw (IllegalArgumentException&) [static]

Creates constants from the definitions in the specified string.

Each definition must end with a semicolon.

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

static int gridripper::math::expr::Evaluator::findStkOp ( const tvector< StkOp * > &  stkops,
const string &  name 
) [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 Function* gridripper::math::expr::Evaluator::addVar ( const string &  def,
const string &  varname,
const tvector< StkOp * > &  stkops,
tvector< Function * > &  depvars 
) throw (IllegalArgumentException&) [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 void gridripper::math::expr::Evaluator::addVars ( const string &  defs,
const string &  varname,
tvector< StkOp * > &  stkops,
tvector< Function * > &  depvars 
) throw (IllegalArgumentException&) [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 list of constants and other stack operations
depvars list of dependent variables

static void gridripper::math::expr::Evaluator::addConstsAndVars ( const string &  defs,
const string &  varname,
tvector< StkOp * > &  stkops,
tvector< Function * > &  depvars 
) throw (IllegalArgumentException&) [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 list of constants and other stack operations
depvars list of dependent variables

static int gridripper::math::expr::Evaluator::findFunction ( const tvector< Function * > &  funcs,
const string &  name 
) [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 GReal_t gridripper::math::expr::Evaluator::eval ( const string &  expr,
const tvector< StkOp * > &  stkops = *(const tvectorStkOp * > *) 0 
) throw (IllegalArgumentException&) [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:46:55 2009 for GridRipper by  doxygen 1.5.6