All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Macros | Functions | Variables
Helpers.hh File Reference
#include <boost/math/special_functions/fpclassify.hpp>
#include <algorithm>
#include <cmath>
#include <limits>
#include <string>
#include <iostream>
#include <vector>
Include dependency graph for Helpers.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  gazebo
 Forward declarations for the common classes.
 
namespace  gazebo::math
 Math namespace.
 

Macros

#define GZ_DBL_MAX   std::numeric_limits<double>::max()
 
#define GZ_DBL_MIN   std::numeric_limits<double>::min()
 
#define GZ_FLT_MAX   std::numeric_limits<float>::max()
 
#define GZ_FLT_MIN   std::numeric_limits<float>::min()
 

Functions

template<typename T >
gazebo::math::clamp (T _v, T _min, T _max)
 simple clamping function
 
template<typename T >
bool gazebo::math::equal (const T &_a, const T &_b, const T &_epsilon=1e-6)
 check if two values are equal, within a tolerance
 
bool gazebo::math::isnan (float _v)
 check if a float is NaN
 
bool gazebo::math::isnan (double _v)
 check if a double is NaN
 
bool gazebo::math::isPowerOfTwo (unsigned int _x)
 is this a power of 2?
 
template<typename T >
gazebo::math::max (const std::vector< T > &_values)
 get the maximum value of vector of values
 
template<typename T >
gazebo::math::mean (const std::vector< T > &_values)
 get mean of vector of values
 
template<typename T >
gazebo::math::min (const std::vector< T > &_values)
 get the minimum value of vector of values
 
double gazebo::math::parseFloat (const std::string &_input)
 parse string into float
 
int gazebo::math::parseInt (const std::string &_input)
 parse string into an integer
 
template<typename T >
gazebo::math::precision (const T &_a, const unsigned int &_precision)
 get value at a specified precision
 
template<typename T >
gazebo::math::variance (const std::vector< T > &_values)
 get variance of vector of values
 

Variables

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)
 

Macro Definition Documentation

#define GZ_DBL_MAX   std::numeric_limits<double>::max()
#define GZ_DBL_MIN   std::numeric_limits<double>::min()
#define GZ_FLT_MAX   std::numeric_limits<float>::max()
#define GZ_FLT_MIN   std::numeric_limits<float>::min()