AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Aqua::Tokenizer_exprtk Class Reference

#include <Tokenizer_exprtk.hpp>

Public Member Functions

 Tokenizer_exprtk ()
 Constructor.
 ~Tokenizer_exprtk ()
 Destructor.
template<typename T>
void registerVariable (const std::string name, T value)
 Register a variable.
std::vector< std::string > exprVariables (const std::string eq)
 Get the list of variables used on an mathematical expression.
template<typename T = float>
T solve (const std::string eq)
 Solve a math expression.

Protected Member Functions

void removeVariable (const std::string name)
 Remove a variable if it has been registered.

Constructor & Destructor Documentation

◆ Tokenizer_exprtk()

Aqua::Tokenizer_exprtk::Tokenizer_exprtk ( )

Constructor.

◆ ~Tokenizer_exprtk()

Aqua::Tokenizer_exprtk::~Tokenizer_exprtk ( )

Destructor.

Member Function Documentation

◆ exprVariables()

std::vector< std::string > Aqua::Tokenizer_exprtk::exprVariables ( const std::string eq)

Get the list of variables used on an mathematical expression.

Parameters
eqMath expression to solve.
Returns
List of variable names

◆ registerVariable()

template<typename T>
void Aqua::Tokenizer_exprtk::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
nameName of the variable.
valueValue of the variable.
Returns
true if the variable already exists, false otherwise.
Here is the call graph for this function:

◆ removeVariable()

void Aqua::Tokenizer_exprtk::removeVariable ( const std::string name)
inlineprotected

Remove a variable if it has been registered.

Parameters
nameName of the variable

◆ solve()

template<typename T = float>
T Aqua::Tokenizer_exprtk::solve ( const std::string eq)
inline

Solve a math expression.

Parameters
eqMath expression to solve.
Returns
Expression value, 0.0 if the evaluation failed (it will be reported by terminal).
Here is the call graph for this function:

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