Biorbd
|
Strings that are to be interpreted as equation that can be evaluated. More...
#include <Equation.h>
Public Member Functions | |
Equation () | |
Construct Equation. | |
Equation (const char *string) | |
Construct Equation. More... | |
Equation (const biorbd::utils::String &string) | |
Construct Equation. More... | |
Equation (const std::basic_string< char > &string) | |
Construct Equation. More... | |
![]() | |
String () | |
Construct string. | |
String (const char *text) | |
Construct string. More... | |
String (const biorbd::utils::String &text) | |
Construct string. More... | |
String (const std::basic_string< char > &text) | |
Construct string. More... | |
String & | operator= (const biorbd::utils::String &other) |
Allow to use operator=. More... | |
String | operator+ (unsigned int val) |
Append an unsigned int to the string. More... | |
String | operator+ (int val) |
Append an int to the string. More... | |
String | operator+ (double val) |
Append a double to the string. More... | |
String | operator+ (const char *text) |
Append a char to the string. More... | |
String | operator() (unsigned int idx) const |
Get a specific character in the string. More... | |
String | operator() (unsigned int startIdx, unsigned int lastIdx) const |
Extract a portion of the string. More... | |
virtual | ~String () |
Destroy class properly. | |
biorbd::utils::String | tolower () const |
Return a lower case string. More... | |
biorbd::utils::String | toupper () const |
Return an upper case string. More... | |
Static Public Member Functions | |
static std::vector< biorbd::utils::Equation > | splitIntoEquation (biorbd::utils::Equation wholeEq, const std::map< biorbd::utils::Equation, double > &variables) |
Split equation into smaller parts, down to number or math symbols. More... | |
static double | evaluateEquation (std::vector< biorbd::utils::Equation > wholeEq) |
Evaluate and return an equation. More... | |
static double | evaluateEquation (biorbd::utils::Equation wholeEq) |
Evaluate and return an equation. More... | |
static double | evaluateEquation (biorbd::utils::Equation wholeEq, const std::map< biorbd::utils::Equation, double > &variables) |
Evaluate and return an equation. More... | |
static void | replaceCste (std::vector< biorbd::utils::Equation > &eq) |
Replace constants in the split equation by a number. More... | |
static void | replaceVar (biorbd::utils::Equation &eq, const std::map< biorbd::utils::Equation, double > &variables) |
Replace the varirables in the equation by their values. More... | |
![]() | |
static biorbd::utils::String | tolower (const biorbd::utils::String &str) |
Convert a string to a lower case string. More... | |
static biorbd::utils::String | toupper (const biorbd::utils::String &str) |
Convert a string to a upper case string. More... | |
static biorbd::utils::String | to_string (double val) |
Overload of the to_string C++11 function to allow for X-digits precision. More... | |
static biorbd::utils::String | to_string (float val) |
Overload of the to_string C++11 function to allow for X-digits precision. More... | |
static biorbd::utils::String | removeTrailing (const biorbd::utils::String &origin, const biorbd::utils::String &trailTag) |
The trailing tags of a string. More... | |
Static Protected Member Functions | |
static double | evaluateEquation (std::vector< biorbd::utils::Equation > eq, unsigned int math) |
Resolve the equation. More... | |
static std::vector< biorbd::utils::Equation > | prepareMathSymbols () |
Prepare the mathematical symbols. More... | |
Strings that are to be interpreted as equation that can be evaluated.
Definition at line 15 of file Equation.h.
biorbd::utils::Equation::Equation | ( | const char * | string | ) |
Construct Equation.
string | The equation in a char format |
Definition at line 31 of file Equation.cpp.
biorbd::utils::Equation::Equation | ( | const biorbd::utils::String & | string | ) |
Construct Equation.
string | The equation in a string format |
Definition at line 37 of file Equation.cpp.
biorbd::utils::Equation::Equation | ( | const std::basic_string< char > & | string | ) |
Construct Equation.
string | The equation in a list of char format |
Definition at line 43 of file Equation.cpp.
|
static |
Evaluate and return an equation.
wholeEq | The whole equation to evaluate |
Definition at line 258 of file Equation.cpp.
|
static |
Evaluate and return an equation.
wholeEq | The whole equation to evaluate |
variables | The variables in the equation |
Definition at line 252 of file Equation.cpp.
|
staticprotected |
Resolve the equation.
eq | The equation to resolve |
math | The mathematical symbol that is being evaluated now |
Definition at line 167 of file Equation.cpp.
|
static |
Evaluate and return an equation.
wholeEq | The already split equation to evaluate |
Definition at line 161 of file Equation.cpp.
|
staticprotected |
Prepare the mathematical symbols.
The supported symbols are:
Definition at line 11 of file Equation.cpp.
|
static |
Replace constants in the split equation by a number.
eq | The split equation |
The supported constants are:
Definition at line 137 of file Equation.cpp.
|
static |
Replace the varirables in the equation by their values.
eq | The equation to replace the variables |
variables | The variable set |
Definition at line 146 of file Equation.cpp.
|
static |
Split equation into smaller parts, down to number or math symbols.
wholeEq | The whole equation to split |
variables | The set of variables in the equation |
Definition at line 49 of file Equation.cpp.