gridripper::math::expr::FnCollection Class Reference

Collection of constant and function definitions. More...

#include <FnCollection.h>

List of all members.

Public Member Functions

 FnCollection (const string &xname, const tvector< StkOp * > &stkops, const tvector< Evaluator::Function * > &varlist)
 Creates a collection for the specified independent variable.
GReal_t eval (const string &expr)
 Evaluates a constant expression.
void addConst (const string &constname, const string &expr) throw (IllegalArgumentException&)
 Adds a constant.
StkVargetStkVar (const string &varname) const
 Gets a stack variable.
void addConstsAndVars (const string &defs) throw (IllegalArgumentException&)
 Adds constants and dependent variables appearing in the specified string.
Evaluator::FunctionaddVar (const string &varname, const string &expr) throw (IllegalArgumentException&)
 Adds a dependent variable.
Evaluator::FunctiongetVar (const string &varname) const
 Gets a dependent variable.
Evaluator::FunctionfindVar (const string &name_or_def)
 Finds a dependent variable.


Detailed Description

Collection of constant and function definitions.

Version:
12/19/2008
Since:
GridRipper 12/16/2008
Author:
Peter Csizmadia

Constructor & Destructor Documentation

gridripper::math::expr::FnCollection::FnCollection ( const string &  xname,
const tvector< StkOp * > &  stkops,
const tvector< Evaluator::Function * > &  varlist 
)

Creates a collection for the specified independent variable.

Parameters:
xname the name of the independent variable
stkops list of constants and other stack operations
varlist list of dependent variables


Member Function Documentation

GReal_t gridripper::math::expr::FnCollection::eval ( const string &  expr  ) 

Evaluates a constant expression.

Dependent variables should not appear in it.

Parameters:
expr the expression
Returns:
the value

void gridripper::math::expr::FnCollection::addConst ( const string &  constname,
const string &  expr 
) throw (IllegalArgumentException&)

Adds a constant.

Parameters:
constname the name
expr the expression defining its value

StkVar* gridripper::math::expr::FnCollection::getStkVar ( const string &  varname  )  const

Gets a stack variable.

Parameters:
varname the name
Returns:
the stack variable or NULL if not found

void gridripper::math::expr::FnCollection::addConstsAndVars ( const string &  defs  )  throw (IllegalArgumentException&)

Adds constants and dependent variables appearing in the specified string.

Parameters:
defs list of definitions, separated by semicolons

Evaluator::Function* gridripper::math::expr::FnCollection::addVar ( const string &  varname,
const string &  expr 
) throw (IllegalArgumentException&)

Adds a dependent variable.

Parameters:
varname the name
expr the defining expression
Returns:
the function representing the dependent variable

Evaluator::Function* gridripper::math::expr::FnCollection::getVar ( const string &  varname  )  const

Gets a dependent variable.

Parameters:
varname the name
Returns:
the function representing the dependent variable or NULL if not found

Evaluator::Function* gridripper::math::expr::FnCollection::findVar ( const string &  name_or_def  ) 

Finds a dependent variable.

The variable can optionally be created if not found.

Parameters:
name_or_def name or the definition to be use if the variable is not found
Returns:
the function representing the dependent variable or NULL if not found (and not created)


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