CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Public Member Functions
MyEvaluator Class Reference
Inheritance diagram for MyEvaluator:
HepTool::Evaluator

List of all members.

Public Member Functions

 MyEvaluator ()
bool isOK ()
double evaluate (const char *e)
- Public Member Functions inherited from HepTool::Evaluator
 Evaluator ()
 ~Evaluator ()
int status () const
int error_position () const
void print_error () const
std::string error_name () const
void setVariable (const char *name, double value)
void setVariable (const char *name, const char *expression)
void setFunction (const char *name, double(*fun)())
void setFunction (const char *name, double(*fun)(double))
void setFunction (const char *name, double(*fun)(double, double))
void setFunction (const char *name, double(*fun)(double, double, double))
void setFunction (const char *name, double(*fun)(double, double, double, double))
void setFunction (const char *name, double(*fun)(double, double, double, double, double))
bool findVariable (const char *name) const
bool findFunction (const char *name, int npar) const
void removeVariable (const char *name)
void removeFunction (const char *name, int npar)
void clear ()
void setStdMath ()
void setSystemOfUnits (double meter=1.0, double kilogram=1.0, double second=1.0, double ampere=1.0, double kelvin=1.0, double mole=1.0, double candela=1.0)
 Evaluator ()
 ~Evaluator ()
int status () const
int error_position () const
void print_error () const
std::string error_name () const
void setVariable (const char *name, double value)
void setVariable (const char *name, const char *expression)
void setFunction (const char *name, double(*fun)())
void setFunction (const char *name, double(*fun)(double))
void setFunction (const char *name, double(*fun)(double, double))
void setFunction (const char *name, double(*fun)(double, double, double))
void setFunction (const char *name, double(*fun)(double, double, double, double))
void setFunction (const char *name, double(*fun)(double, double, double, double, double))
bool findVariable (const char *name) const
bool findFunction (const char *name, int npar) const
void removeVariable (const char *name)
void removeFunction (const char *name, int npar)
void clear ()
void setStdMath ()
void setSystemOfUnits (double meter=1.0, double kilogram=1.0, double second=1.0, double ampere=1.0, double kelvin=1.0, double mole=1.0, double candela=1.0)

Additional Inherited Members

- Public Types inherited from HepTool::Evaluator
enum  {
  OK, WARNING_EXISTING_VARIABLE, WARNING_EXISTING_FUNCTION, WARNING_BLANK_STRING,
  ERROR_NOT_A_NAME, ERROR_SYNTAX_ERROR, ERROR_UNPAIRED_PARENTHESIS, ERROR_UNEXPECTED_SYMBOL,
  ERROR_UNKNOWN_VARIABLE, ERROR_UNKNOWN_FUNCTION, ERROR_EMPTY_PARAMETER, ERROR_CALCULATION_ERROR
}
enum  {
  OK, WARNING_EXISTING_VARIABLE, WARNING_EXISTING_FUNCTION, WARNING_BLANK_STRING,
  ERROR_NOT_A_NAME, ERROR_SYNTAX_ERROR, ERROR_UNPAIRED_PARENTHESIS, ERROR_UNEXPECTED_SYMBOL,
  ERROR_UNKNOWN_VARIABLE, ERROR_UNKNOWN_FUNCTION, ERROR_EMPTY_PARAMETER, ERROR_CALCULATION_ERROR
}

Detailed Description

Definition at line 10 of file testBug90848.cc.


Constructor & Destructor Documentation

MyEvaluator::MyEvaluator ( )
inline

Definition at line 12 of file testBug90848.cc.

References HepTool::Evaluator::setStdMath().


Member Function Documentation

double MyEvaluator::evaluate ( const char *  expression)
inline

Evaluates the arithmetic expression given as character string. The expression may consist of numbers, variables and functions separated by arithmetic (+, - , /, *, ^, **) and logical operators (==, !=, >, >=, <, <=, &&, ||).

Parameters:
expressioninput expression.
Returns:
result of the evaluation.
See also:
status
error_position
print_error

Reimplemented from HepTool::Evaluator.

Definition at line 14 of file testBug90848.cc.

References HepTool::Evaluator::OK, and HepTool::Evaluator::status().

Referenced by main().

bool MyEvaluator::isOK ( )
inline

Definition at line 13 of file testBug90848.cc.

References HepTool::Evaluator::OK, and HepTool::Evaluator::status().

Referenced by main().


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