|
waLBerla 7.2
|
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_ { nullptr } |
| exprtk::symbol_table< double > * | symbolTable_ { nullptr } |
| bool | isConstant_ {false} |
| bool | isZero_ {false} |
|
default |
| 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 |