#include <cmath>
#include <algorithm>
#include <limits>
#include <string>
#include <iostream>
#include <vector>
Go to the source code of this file.
Namespaces | |
ignition | |
ignition::math | |
Math classes and function useful in robot applications. | |
Macros | |
#define | _USE_MATH_DEFINES |
#define | IGN_DBL_MAX std::numeric_limits<double>::max() |
Double maximum value. More... | |
#define | IGN_DBL_MIN std::numeric_limits<double>::min() |
Double min value. More... | |
#define | IGN_FLT_MAX std::numeric_limits<float>::max() |
Float maximum value. More... | |
#define | IGN_FLT_MIN std::numeric_limits<float>::min() |
Float minimum value. More... | |
#define | IGN_INT32_MAX std::numeric_limits<int32_t>::max() |
32bit integer maximum value More... | |
#define | IGN_INT32_MIN std::numeric_limits<int32_t>::min() |
32bit integer minimum value More... | |
#define | IGN_PI 3.14159265358979323846 |
Define IGN_PI, IGN_PI_2, and IGN_PI_4. More... | |
#define | IGN_PI_2 1.57079632679489661923 |
#define | IGN_PI_4 0.78539816339744830962 |
#define | IGN_UINT32_MAX std::numeric_limits<uint32_t>::max() |
32bit unsigned integer maximum value More... | |
#define | IGN_UINT32_MIN std::numeric_limits<uint32_t>::min() |
32bit unsigned integer minimum value More... | |
#define | IGNITION_HIDDEN |
Use to represent "symbol hidden" if supported. More... | |
#define | IGNITION_VISIBLE |
Use to represent "symbol visible" if supported. More... | |
Functions | |
template<typename T > | |
T | ignition::math::clamp (T _v, T _min, T _max) |
Simple clamping function. More... | |
template<typename T > | |
bool | ignition::math::equal (const T &_a, const T &_b, const T &_epsilon=1e-6) |
check if two values are equal, within a tolerance More... | |
float | ignition::math::fixnan (float _v) |
Fix a nan value. More... | |
double | ignition::math::fixnan (double _v) |
Fix a nan value. More... | |
bool | ignition::math::isnan (float _v) |
check if a float is NaN More... | |
bool | ignition::math::isnan (double _v) |
check if a double is NaN More... | |
bool | ignition::math::isPowerOfTwo (unsigned int _x) |
Is this a power of 2? More... | |
template<typename T > | |
T | ignition::math::max (const std::vector< T > &_values) |
get the maximum value of vector of values More... | |
template<typename T > | |
T | ignition::math::mean (const std::vector< T > &_values) |
get mean of vector of values More... | |
template<typename T > | |
T | ignition::math::min (const std::vector< T > &_values) |
get the minimum value of vector of values More... | |
double | ignition::math::parseFloat (const std::string &_input) |
parse string into float More... | |
int | ignition::math::parseInt (const std::string &_input) |
parse string into an integer More... | |
template<typename T > | |
T | ignition::math::precision (const T &_a, const unsigned int &_precision) |
get value at a specified precision More... | |
unsigned int | ignition::math::roundUpPowerOfTwo (unsigned int _x) |
Get the smallest power of two that is greater or equal to a given value. More... | |
template<typename T > | |
T | ignition::math::variance (const std::vector< T > &_values) |
get variance of vector of values More... | |
Variables | |
static const double | ignition::math::NAN_D = std::numeric_limits<double>::quiet_NaN() |
Returns the representation of a quiet not a number (NAN) More... | |
static const float | ignition::math::NAN_F = std::numeric_limits<float>::quiet_NaN() |
Returns the representation of a quiet not a number (NAN) More... | |
static const int | ignition::math::NAN_I = std::numeric_limits<int>::quiet_NaN() |
Returns the representation of a quiet not a number (NAN) More... | |
#define _USE_MATH_DEFINES |
#define IGN_DBL_MAX std::numeric_limits<double>::max() |
Double maximum value.
#define IGN_DBL_MIN std::numeric_limits<double>::min() |
Double min value.
#define IGN_FLT_MAX std::numeric_limits<float>::max() |
Float maximum value.
#define IGN_FLT_MIN std::numeric_limits<float>::min() |
Float minimum value.
#define IGN_INT32_MAX std::numeric_limits<int32_t>::max() |
32bit integer maximum value
#define IGN_INT32_MIN std::numeric_limits<int32_t>::min() |
32bit integer minimum value
#define IGN_PI 3.14159265358979323846 |
Define IGN_PI, IGN_PI_2, and IGN_PI_4.
This was put here for Windows support.
Referenced by ignition::math::Quaternion< T >::Euler(), ignition::math::Matrix4< double >::EulerRotation(), ignition::math::OnePole< math::Quaterniond >::Fc(), and ignition::math::BiQuad< math::Vector3d >::Fc().
#define IGN_PI_2 1.57079632679489661923 |
#define IGN_PI_4 0.78539816339744830962 |
#define IGN_UINT32_MAX std::numeric_limits<uint32_t>::max() |
32bit unsigned integer maximum value
#define IGN_UINT32_MIN std::numeric_limits<uint32_t>::min() |
32bit unsigned integer minimum value
#define IGNITION_HIDDEN |
Use to represent "symbol hidden" if supported.
#define IGNITION_VISIBLE |
Use to represent "symbol visible" if supported.