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.
|
StkVar * | getStkVar (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::Function * | addVar (const string &varname, const string &expr) throw (IllegalArgumentException&) |
| Adds a dependent variable.
|
Evaluator::Function * | getVar (const string &varname) const |
| Gets a dependent variable.
|
Evaluator::Function * | findVar (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
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
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 |
Adds constants and dependent variables appearing in the specified string.
- Parameters:
-
| defs | list of definitions, separated by semicolons |
Adds a dependent variable.
- Parameters:
-
| varname | the name |
| expr | the defining expression |
- Returns:
- the function representing the dependent variable
GReal_t gridripper::math::expr::FnCollection::eval |
( |
const string & |
expr |
) |
|
Evaluates a constant expression.
Dependent variables should not appear in it.
- Parameters:
-
- Returns:
- the value
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)
StkVar* gridripper::math::expr::FnCollection::getStkVar |
( |
const string & |
varname |
) |
const |
Gets a stack variable.
- Parameters:
-
- Returns:
- the stack variable or NULL if not found
Evaluator::Function* gridripper::math::expr::FnCollection::getVar |
( |
const string & |
varname |
) |
const |
Gets a dependent variable.
- Parameters:
-
- Returns:
- the function representing the dependent variable or NULL if not found
The documentation for this class was generated from the following file:
- /home/laszloa/SVN/GR/gridripper/include/gridripper/math/expr/FnCollection.h