Embedded control libraries. More...
Classes | |
class | EuclideanNorm |
Functor for euclidean norms. More... | |
Functions | |
template<typename Scalar > | |
Scalar | cube_root (const Scalar &x) |
The real solution to a cube root. | |
template<typename T > | |
T | euclidean_norm (const T &x1, const T &x2, const T &x3) |
Function for euclidean norms of dimension 3. | |
template<typename T > | |
T | euclidean_norm (const T &x1, const T &x2) |
Function for euclidean norms of dimension 2. | |
template<typename Scalar , typename OtherScalar > | |
bool | isApprox (const Scalar &x, const OtherScalar &y, typename numeric_limits< Scalar >::Precision precision=numeric_limits< Scalar >::dummy_precision) |
Checks if two values are approximate. | |
template<typename Scalar , typename OtherScalar > | |
bool | isApproxOrLessThan (const Scalar &x, const OtherScalar &y, typename numeric_limits< Scalar >::Precision precision=numeric_limits< Scalar >::dummy_precision) |
Checks if the first value is less than or approximate to the second. | |
template<typename Scalar > | |
int | psign (const Scalar &x) |
A sign function for numerical values (positive return if arg is zero). | |
template<typename Scalar > | |
int | sign (const Scalar &x) |
A sign function for numerical values. | |
Variables | |
double const | pi = 4*std::atan(1) |
Mathematical constant for pi. | |
const double | pi_2 = pi/2.0 |
Mathematical constant for pi/2. | |
const float | pi_2_f = pi_2 |
Mathematical constant (float format) for pi/2. | |
const double | pi_4 = pi/4.0 |
Mathematical constant for pi/4. | |
const float | pi_4_f = pi_4 |
Mathematical constant (float format) for pi/4. | |
const float | pi_f = pi |
Mathematical constant (float format) for pi. | |
const double | two_pi = 2.0*pi |
Mathematical constant for 2*pi. | |
const float | two_pi_f = two_pi |
Mathematical constant (float format) for 2*pi. |
Embedded control libraries.
Various core libraries useful for embedded control systems.
Scalar ecl::cube_root | ( | const Scalar & | x | ) | [inline] |
The real solution to a cube root.
x | : scalar to test. |
Scalar | : a real numerical value |
Definition at line 75 of file simple.hpp.
T ecl::euclidean_norm | ( | const T & | x1, | |
const T & | x2, | |||
const T & | x3 | |||
) | [inline] |
T ecl::euclidean_norm | ( | const T & | x1, | |
const T & | x2 | |||
) | [inline] |
bool ecl::isApprox | ( | const Scalar & | x, | |
const OtherScalar & | y, | |||
typename numeric_limits< Scalar >::Precision | precision = numeric_limits<Scalar>::dummy_precision | |||
) | [inline] |
Checks if two values are approximate.
Note that this does not use the usual direct epsilon bound check, instead, it uses the magnitudes of the values and supplied precision to determine the epsilon bounds before carrying out the operation.
x | - first input argument | |
y | - second input argument | |
precision | - precision to use (default is defined by the type). |
bool ecl::isApproxOrLessThan | ( | const Scalar & | x, | |
const OtherScalar & | y, | |||
typename numeric_limits< Scalar >::Precision | precision = numeric_limits<Scalar>::dummy_precision | |||
) | [inline] |
Checks if the first value is less than or approximate to the second.
Note that this does not use the usual direct epsilon bound check, instead, it uses the magnitudes of the values and supplied precision to determine the epsilon bounds before carrying out the operation.
x | - first input argument | |
y | - second input argument | |
precision | - precision to use (default is defined by the type). |
int ecl::psign | ( | const Scalar & | x | ) | [inline] |
A sign function for numerical values (positive return if arg is zero).
Note that zero will return +1, positive numbers +1, and negative numbers -1.
x | : scalar to test. |
Scalar | : some numerical quantity satisfying a comparison with >= 0 |
Definition at line 59 of file simple.hpp.
int ecl::sign | ( | const Scalar & | x | ) | [inline] |
A sign function for numerical values.
Note that zero will return zero, positive numbers +1, and negative numbers -1.
x | : scalar to test. |
Scalar | : some numerical quantity satisfying a comparison with >= 0 |
Definition at line 38 of file simple.hpp.
double const ecl::pi = 4*std::atan(1) |
Mathematical constant for pi.
Definition at line 37 of file constants.hpp.
Mathematical constant for pi/2.
Definition at line 39 of file constants.hpp.
const float ecl::pi_2_f = pi_2 |
Mathematical constant (float format) for pi/2.
Definition at line 43 of file constants.hpp.
Mathematical constant for pi/4.
Definition at line 40 of file constants.hpp.
const float ecl::pi_4_f = pi_4 |
Mathematical constant (float format) for pi/4.
Definition at line 44 of file constants.hpp.
Mathematical constant (float format) for pi.
Definition at line 42 of file constants.hpp.
const double ecl::two_pi = 2.0*pi |
Mathematical constant for 2*pi.
Definition at line 38 of file constants.hpp.
const float ecl::two_pi_f = two_pi |
Mathematical constant (float format) for 2*pi.
Definition at line 41 of file constants.hpp.