#include <Tokenizer_muparser.hpp>
|
bool | isVariable (const std::string name) |
| Checks if a variable has been registered.
|
template<typename T = float> |
T | variable (const std::string name) |
| Returns a variable value.
|
◆ Tokenizer_muparser()
Aqua::Tokenizer_muparser::Tokenizer_muparser |
( |
| ) |
|
◆ ~Tokenizer_muparser()
Aqua::Tokenizer_muparser::~Tokenizer_muparser |
( |
| ) |
|
◆ exprVariables()
std::vector< std::string > Aqua::Tokenizer_muparser::exprVariables |
( |
const std::string | eq | ) |
|
Get the list of variables used on an mathematical expression.
- Parameters
-
eq | Math expression to solve. |
- Returns
- List of variable names
◆ isVariable()
bool Aqua::Tokenizer_muparser::isVariable |
( |
const std::string | name | ) |
|
|
protected |
Checks if a variable has been registered.
- Parameters
-
- Returns
- true if already exist a variable with the given name, false otherwise.
◆ registerVariable()
bool Aqua::Tokenizer_muparser::registerVariable |
( |
const std::string | name, |
|
|
T | value ) |
|
inline |
Register a variable.
In case that the variable already exist, it will be modified.
The registered variables can be used later in the expression to be evaluated.
- Parameters
-
name | Name of the variable. |
value | Value of the variable. |
- Returns
- true if the variable already exists, false otherwise.
◆ solve()
template<typename
T = float>
T Aqua::Tokenizer_muparser::solve |
( |
const std::string | eq | ) |
|
|
inline |
Solve a math expression.
- Parameters
-
eq | Math expression to solve. |
- Returns
- Expression value, 0.0 if the evaluation failed (it will be reported by terminal).
◆ variable()
template<typename
T = float>
T Aqua::Tokenizer_muparser::variable |
( |
const std::string | name | ) |
|
|
inlineprotected |
Returns a variable value.
- Parameters
-
- Returns
- The Value of the variable, or 0.0 if the variable cannot be found.
The documentation for this class was generated from the following files: