Function parser, for parsing and evaluating functions.
Can parse mathematical expressions containing the standard arithmetic operations(+,-,/,*) , brackets, functions (cos,sin,exp,sqrt) and variables
After parsing an expression, values can be bound to variables using a symbol table.
Example:
#include <Parser.h>
Public Member Functions | |
FunctionParser () | |
~FunctionParser () | |
void | parse (const std::string &equation) |
double | evaluate (const std::map< std::string, double > &symbolTable) const |
const bool & | isConstant () const |
const bool & | isZero () const |
bool | symbolExists (const std::string &symbol) const |
Protected Member Functions | |
FunctionParser (const FunctionParser &other) | |
FunctionParser & | operator= (const FunctionParser &other) |
Protected Attributes | |
exprtk::expression< double > * | expression_ |
exprtk::symbol_table< double > * | symbolTable_ |
bool | isConstant_ |
bool | isZero_ |
walberla::math::FunctionParser::FunctionParser | ( | ) |
walberla::math::FunctionParser::~FunctionParser | ( | ) |
|
protected |
double walberla::math::FunctionParser::evaluate | ( | const std::map< std::string, double > & | symbolTable | ) | const |
|
inline |
|
inline |
|
protected |
void walberla::math::FunctionParser::parse | ( | const std::string & | equation | ) |
bool walberla::math::FunctionParser::symbolExists | ( | const std::string & | symbol | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |