A set of classes that encapsulate math related properties and functions.
More...
|
file | MathTypes.hh |
| Forward declarations for the math classes.
|
|
|
static const double | gazebo::math::NAN_D = std::numeric_limits<double>::quiet_NaN() |
| Returns the representation of a quiet not a number (NAN)
|
|
static const int | gazebo::math::NAN_I = std::numeric_limits<int>::quiet_NaN() |
| Returns the representation of a quiet not a number (NAN)
|
|
A set of classes that encapsulate math related properties and functions.
template<typename T >
T gazebo::math::clamp |
( |
T |
_v, |
|
|
T |
_min, |
|
|
T |
_max |
|
) |
| |
|
inline |
template<typename T >
bool gazebo::math::equal |
( |
const T & |
_a, |
|
|
const T & |
_b, |
|
|
const T & |
_epsilon = 1e-6 |
|
) |
| |
|
inline |
bool gazebo::math::isnan |
( |
float |
_v | ) |
|
|
inline |
check if a float is NaN
- Parameters
-
- Returns
- true if _v is not a number, false otherwise
Referenced by gazebo::math::isnan().
bool gazebo::math::isnan |
( |
double |
_v | ) |
|
|
inline |
check if a double is NaN
- Parameters
-
- Returns
- true if _v is not a number, false otherwise
References gazebo::math::isnan().
bool gazebo::math::isPowerOfTwo |
( |
unsigned int |
_x | ) |
|
|
inline |
is this a power of 2?
- Parameters
-
- Returns
- true if _x is a power of 2, false otherwise
template<typename T >
T gazebo::math::max |
( |
const std::vector< T > & |
_values | ) |
|
|
inline |
template<typename T >
T gazebo::math::mean |
( |
const std::vector< T > & |
_values | ) |
|
|
inline |
get mean of vector of values
- Parameters
-
[in] | _values | the vector of values |
- Returns
- the mean
template<typename T >
T gazebo::math::min |
( |
const std::vector< T > & |
_values | ) |
|
|
inline |
double gazebo::math::parseFloat |
( |
const std::string & |
_input | ) |
|
|
inline |
parse string into float
- Parameters
-
- Returns
- a floating point number (can be NaN) or 0 with a message in the error stream
References gazebo::math::NAN_D.
int gazebo::math::parseInt |
( |
const std::string & |
_input | ) |
|
|
inline |
parse string into an integer
- Parameters
-
- Returns
- an integer, 0 or 0 and a message in the error stream
References gazebo::math::NAN_I.
template<typename T >
T gazebo::math::precision |
( |
const T & |
_a, |
|
|
const unsigned int & |
_precision |
|
) |
| |
|
inline |
get value at a specified precision
- Parameters
-
[in] | _a | the number |
[in] | _precision | the precision |
- Returns
- the value for the specified precision
template<typename T >
T gazebo::math::variance |
( |
const std::vector< T > & |
_values | ) |
|
|
inline |
get variance of vector of values
- Parameters
-
[in] | _values | the vector of values |
- Returns
- the squared deviation
const double gazebo::math::NAN_D = std::numeric_limits<double>::quiet_NaN() |
|
static |
const int gazebo::math::NAN_I = std::numeric_limits<int>::quiet_NaN() |
|
static |