BALL::ParsedFunction< arg > Class Template Reference
[Function classes]

#include <BALL/MATHS/parsedFunction.h>

Inherits std::unary_function<arg, double>.

List of all members.


Public Member Functions

Constructors and Destructors
 ParsedFunction ()
 

Default constructor.


 ParsedFunction (const String &expression)
 

Detailed constructor.


 ParsedFunction (const ParsedFunction &func)
 

Copy constructor.


 ~ParsedFunction ()
 

Destructor.


Accessors
double operator() (arg p) throw (Exception::ParseError)
Parsing
void initTable ()

Public Attributes

StringHashMap< double * > constants_
StringHashMap< double(*)(double)> functions_

Protected Attributes

String expression_

Detailed Description

template<typename arg>
class BALL::ParsedFunction< arg >

ParsedFunction. This function type contains a double - valued function string like $var1=atan(.5); sin(cos(atan(asin(exp(X+var1)))))$. When the operator () is called, $X$ is replaced with the argument of the operator call and the function string is parsed and evaluated.


Constructor & Destructor Documentation

template<typename arg >
BALL::ParsedFunction< arg >::ParsedFunction (  ) 

Default constructor.

template<typename arg >
BALL::ParsedFunction< arg >::ParsedFunction ( const String expression  ) 

Detailed constructor.

template<typename arg >
BALL::ParsedFunction< arg >::ParsedFunction ( const ParsedFunction< arg > &  func  ) 

Copy constructor.

template<typename arg >
BALL::ParsedFunction< arg >::~ParsedFunction (  ) 

Destructor.


Member Function Documentation

template<typename arg >
void BALL::ParsedFunction< arg >::initTable (  ) 

This function initializes the function table and the constant table of our parser.

template<typename arg >
double BALL::ParsedFunction< arg >::operator() ( arg  p  )  throw (Exception::ParseError)

Evaluate the function at point $p$.


Member Data Documentation

template<typename arg >
StringHashMap<double*> BALL::ParsedFunction< arg >::constants_

The table of constants

template<typename arg >
String BALL::ParsedFunction< arg >::expression_ [protected]
template<typename arg >
StringHashMap<double (*)(double)> BALL::ParsedFunction< arg >::functions_

The table of functions