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:251
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:242
static const int NAN_I
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:362
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:330
static const float INF_F
float positive infinite value
Definition: Helpers.hh:278
static const double LOW_D
Double low value, equivalent to -MAX_D.
Definition: Helpers.hh:260
T find_first_not_of(T... args)
static const uint64_t MIN_UI64
64bit unsigned integer minimum value
Definition: Helpers.hh:339
static const uint32_t MIN_UI32
32bit unsigned integer minimum value
Definition: Helpers.hh:313
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:587
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:403
static const size_t IGN_EIGHT_SIZE_T
size_t type with a value of 8
Definition: Helpers.hh:248
T mean(const std::vector< T > &_values)
get mean of vector of values
Definition: Helpers.hh:500
static const int32_t INF_I32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:333
T swap(T... args)
static const float NAN_F
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:281
static const int16_t MAX_I16
16bit unsigned integer maximum value
Definition: Helpers.hh:297
static const uint16_t MAX_UI16
16bit unsigned integer maximum value
Definition: Helpers.hh:284
T stod(T... args)
static const uint64_t MAX_UI64
64bit unsigned integer maximum value
Definition: Helpers.hh:336
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:343
unsigned int roundUpPowerOfTwo(unsigned int _x)
Get the smallest power of two that is greater or equal to a given value.
Definition: Helpers.hh:632
static const uint32_t MAX_UI32
32bit unsigned integer maximum value
Definition: Helpers.hh:310
T max(const std::vector< T > &_values)
get the maximum value of vector of values
Definition: Helpers.hh:526
T duration_cast(T... args)
static const int64_t MAX_I64
64bit unsigned integer maximum value
Definition: Helpers.hh:349
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:553
static const double MIN_D
Double min value. This value will be similar to 2.22507e-308.
Definition: Helpers.hh:257
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:227
bool greaterOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:576
STL class.
T variance(const std::vector< T > &_values)
get variance of vector of values
Definition: Helpers.hh:512
T min(T... args)
static const size_t IGN_FOUR_SIZE_T
size_t type with a value of 4
Definition: Helpers.hh:236
std::pair< int64_t, int64_t > durationToSecNsec(const std::chrono::steady_clock::duration &_dur)
Convert a std::chrono::steady_clock::duration to a seconds and nanoseconds pair.
Definition: Helpers.hh:735
static const uint32_t INF_UI32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:320
static const size_t IGN_FIVE_SIZE_T
size_t type with a value of 5
Definition: Helpers.hh:239
static const uint64_t INF_UI64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:346
T lowest(T... args)
static const float LOW_F
Float low value, equivalent to -MAX_F.
Definition: Helpers.hh:275
#define IGN_FP_VOLATILE
Define IGN_FP_VOLATILE for FP equality comparisons Use volatile parameters when checking floating poi...
Definition: Helpers.hh:193
bool isPowerOfTwo(unsigned int _x)
Is this a power of 2?
Definition: Helpers.hh:622
static const uint16_t INF_UI16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:294
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:224
static const uint16_t MIN_UI16
16bit unsigned integer minimum value
Definition: Helpers.hh:287
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:291
static const int16_t MIN_I16
16bit unsigned integer minimum value
Definition: Helpers.hh:300
T infinity(T... args)
static const int32_t MIN_I32
32bit unsigned integer minimum value
Definition: Helpers.hh:326
T max(T... args)
static const int64_t MIN_I64
64bit unsigned integer minimum value
Definition: Helpers.hh:352
T count(T... args)
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:269
T size(T... args)
STL class.
bool isEven(const int _v)
Check if parameter is even.
Definition: Helpers.hh:443
T pow(T... args)
static const double NAN_D
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:266
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:304
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:356
static const double MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:254
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:230
static const int64_t INF_I64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:359
static const float MIN_F
Float minimum value. This value will be similar to 1.17549e-38.
Definition: Helpers.hh:272
T isnan(T... args)
double parseFloat(const std::string &_input)
parse string into float
Definition: Helpers.hh:705
constexpr T IGN_MASSMATRIX3_DEFAULT_TOLERANCE
The default tolerance value used by MassMatrix3::IsValid(), MassMatrix3::IsPositive(), and MassMatrix3::ValidMoments()
Definition: Helpers.hh:37
static const int16_t INF_I16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:307
T quiet_NaN(T... args)
static const double INF_D
Double positive infinite value.
Definition: Helpers.hh:263
void sort2(T &_a, T &_b)
Sort two numbers, such that _a <= _b.
Definition: Helpers.hh:597
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:317
static const size_t IGN_THREE_SIZE_T
size_t type with a value of 3
Definition: Helpers.hh:233
static const size_t IGN_SEVEN_SIZE_T
size_t type with a value of 7
Definition: Helpers.hh:245
T isinf(T... args)
Definition: Angle.hh:42
T stoi(T... args)
T round(T... args)
int parseInt(const std::string &_input)
parse string into an integer
Definition: Helpers.hh:676
bool lessOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:565
T min(const std::vector< T > &_values)
get the minimum value of vector of values
Definition: Helpers.hh:539
int roundUpMultiple(int _num, int _multiple)
Round a number up to the nearest multiple. For example, if the input number is 12 and the multiple is...
Definition: Helpers.hh:658
void sort3(T &_a, T &_b, T &_c)
Sort three numbers, such that _a <= _b <= _c.
Definition: Helpers.hh:609
static const int32_t MAX_I32
32bit unsigned integer maximum value
Definition: Helpers.hh:323