Helpers.hh
Go to the documentation of this file.
static const size_t IGN_NINE_SIZE_T
size_t type with a value of 9
Definition: Helpers.hh:244
std::tuple< PairInput, PairInput > Unpair(const PairOutput _key)
The reverse of the Pair function. Accepts a key, produced from the Pair function, and returns a tuple...
T empty(T... args)
static const size_t IGN_SIX_SIZE_T
size_t type with a value of 6
Definition: Helpers.hh:235
static const int NAN_I
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:355
static const int32_t LOW_I32
32bit unsigned integer lowest value. This is equivalent to IGN_INT32_MIN, and is defined here for com...
Definition: Helpers.hh:323
static const float INF_F
float positive infinite value
Definition: Helpers.hh:271
static const double LOW_D
Double low value, equivalent to -MAX_D.
Definition: Helpers.hh:253
T find_first_not_of(T... args)
static const uint64_t MIN_UI64
64bit unsigned integer minimum value
Definition: Helpers.hh:332
static const uint32_t MIN_UI32
32bit unsigned integer minimum value
Definition: Helpers.hh:306
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:580
static const static double const static double const static double const static double const static float const static float const static float const static float const static uint16_t const static uint16_t const static uint16_t const static uint16_t const static int16_t const static int16_t const static int16_t const static int16_t const static uint32_t const static uint32_t const static uint32_t const static uint32_t const static int32_t const static int32_t const static int32_t const static int32_t const static uint64_t const static uint64_t const static uint64_t const static uint64_t const static int64_t const static int64_t const static int64_t const int64_t T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:396
static const size_t IGN_EIGHT_SIZE_T
size_t type with a value of 8
Definition: Helpers.hh:241
T mean(const std::vector< T > &_values)
get mean of vector of values
Definition: Helpers.hh:493
static const int32_t INF_I32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:326
T swap(T... args)
static const float NAN_F
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:274
static const int16_t MAX_I16
16bit unsigned integer maximum value
Definition: Helpers.hh:290
static const uint16_t MAX_UI16
16bit unsigned integer maximum value
Definition: Helpers.hh:277
T stod(T... args)
static const uint64_t MAX_UI64
64bit unsigned integer maximum value
Definition: Helpers.hh:329
static const uint64_t LOW_UI64
64bit unsigned integer lowest value. This is equivalent to IGN_UINT64_MIN, and is defined here for co...
Definition: Helpers.hh:336
unsigned int roundUpPowerOfTwo(unsigned int _x)
Get the smallest power of two that is greater or equal to a given value.
Definition: Helpers.hh:625
static const uint32_t MAX_UI32
32bit unsigned integer maximum value
Definition: Helpers.hh:303
T max(const std::vector< T > &_values)
get the maximum value of vector of values
Definition: Helpers.hh:519
static const int64_t MAX_I64
64bit unsigned integer maximum value
Definition: Helpers.hh:342
bool equal(const T &_a, const T &_b, const T &_epsilon=T(1e-6))
check if two values are equal, within a tolerance
Definition: Helpers.hh:546
static const double MIN_D
Double min value. This value will be similar to 2.22507e-308.
Definition: Helpers.hh:250
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:220
bool greaterOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:569
STL class.
T variance(const std::vector< T > &_values)
get variance of vector of values
Definition: Helpers.hh:505
T min(T... args)
static const size_t IGN_FOUR_SIZE_T
size_t type with a value of 4
Definition: Helpers.hh:229
static const uint32_t INF_UI32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:313
static const size_t IGN_FIVE_SIZE_T
size_t type with a value of 5
Definition: Helpers.hh:232
static const uint64_t INF_UI64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:339
T lowest(T... args)
static const float LOW_F
Float low value, equivalent to -MAX_F.
Definition: Helpers.hh:268
#define IGN_FP_VOLATILE
Define IGN_FP_VOLATILE for FP equality comparisons Use volatile parameters when checking floating poi...
Definition: Helpers.hh:186
bool isPowerOfTwo(unsigned int _x)
Is this a power of 2?
Definition: Helpers.hh:615
static const uint16_t INF_UI16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:287
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:217
static const uint16_t MIN_UI16
16bit unsigned integer minimum value
Definition: Helpers.hh:280
static const uint16_t LOW_UI16
16bit unsigned integer lowest value. This is equivalent to IGN_UINT16_MIN, and is defined here for co...
Definition: Helpers.hh:284
static const int16_t MIN_I16
16bit unsigned integer minimum value
Definition: Helpers.hh:293
T infinity(T... args)
static const int32_t MIN_I32
32bit unsigned integer minimum value
Definition: Helpers.hh:319
T max(T... args)
static const int64_t MIN_I64
64bit unsigned integer minimum value
Definition: Helpers.hh:345
PairOutput Pair(const PairInput _a, const PairInput _b)
A pairing function that maps two values to a unique third value. This is an implement of Szudzik's fu...
static const float MAX_F
Float maximum value. This value will be similar to 3.40282e+38.
Definition: Helpers.hh:262
T size(T... args)
STL class.
bool isEven(const int _v)
Check if parameter is even.
Definition: Helpers.hh:436
T pow(T... args)
static const double NAN_D
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:259
static const int16_t LOW_I16
16bit unsigned integer lowest value. This is equivalent to IGN_INT16_MIN, and is defined here for com...
Definition: Helpers.hh:297
static const int64_t LOW_I64
64bit unsigned integer lowest value. This is equivalent to IGN_INT64_MIN, and is defined here for com...
Definition: Helpers.hh:349
static const double MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:247
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:223
static const int64_t INF_I64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:352
static const float MIN_F
Float minimum value. This value will be similar to 1.17549e-38.
Definition: Helpers.hh:265
T isnan(T... args)
double parseFloat(const std::string &_input)
parse string into float
Definition: Helpers.hh:673
static const int16_t INF_I16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:300
T quiet_NaN(T... args)
static const double INF_D
Double positive infinite value.
Definition: Helpers.hh:256
void sort2(T &_a, T &_b)
Sort two numbers, such that _a <= _b.
Definition: Helpers.hh:590
static const uint32_t LOW_UI32
32bit unsigned integer lowest value. This is equivalent to IGN_UINT32_MIN, and is defined here for co...
Definition: Helpers.hh:310
static const size_t IGN_THREE_SIZE_T
size_t type with a value of 3
Definition: Helpers.hh:226
static const size_t IGN_SEVEN_SIZE_T
size_t type with a value of 7
Definition: Helpers.hh:238
T isinf(T... args)
Definition: Angle.hh:39
T stoi(T... args)
T round(T... args)
int parseInt(const std::string &_input)
parse string into an integer
Definition: Helpers.hh:644
bool lessOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:558
T min(const std::vector< T > &_values)
get the minimum value of vector of values
Definition: Helpers.hh:532
void sort3(T &_a, T &_b, T &_c)
Sort three numbers, such that _a <= _b <= _c.
Definition: Helpers.hh:602
static const int32_t MAX_I32
32bit unsigned integer maximum value
Definition: Helpers.hh:316