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:253
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:244
static const int NAN_I
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:364
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:332
static const float INF_F
float positive infinite value
Definition: Helpers.hh:280
static const double LOW_D
Double low value, equivalent to -MAX_D.
Definition: Helpers.hh:262
T find_first_not_of(T... args)
static const uint64_t MIN_UI64
64bit unsigned integer minimum value
Definition: Helpers.hh:341
static const uint32_t MIN_UI32
32bit unsigned integer minimum value
Definition: Helpers.hh:315
std::chrono::duration< uint64_t, std::ratio< 86400 > > days
This will exist in C++-20.
Definition: Helpers.hh:785
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:589
static const size_t IGN_EIGHT_SIZE_T
size_t type with a value of 8
Definition: Helpers.hh:250
T mean(const std::vector< T > &_values)
get mean of vector of values
Definition: Helpers.hh:502
static const int32_t INF_I32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:335
T swap(T... args)
static const float NAN_F
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:283
static const int16_t MAX_I16
16bit unsigned integer maximum value
Definition: Helpers.hh:299
static const uint16_t MAX_UI16
16bit unsigned integer maximum value
Definition: Helpers.hh:286
T stod(T... args)
static const uint64_t MAX_UI64
64bit unsigned integer maximum value
Definition: Helpers.hh:338
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:345
unsigned int roundUpPowerOfTwo(unsigned int _x)
Get the smallest power of two that is greater or equal to a given value.
Definition: Helpers.hh:634
static const uint32_t MAX_UI32
32bit unsigned integer maximum value
Definition: Helpers.hh:312
T max(const std::vector< T > &_values)
get the maximum value of vector of values
Definition: Helpers.hh:528
T duration_cast(T... args)
static const int64_t MAX_I64
64bit unsigned integer maximum value
Definition: Helpers.hh:351
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:555
static const double MIN_D
Double min value. This value will be similar to 2.22507e-308.
Definition: Helpers.hh:259
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:229
T setw(T... args)
bool greaterOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:578
STL class.
T variance(const std::vector< T > &_values)
get variance of vector of values
Definition: Helpers.hh:514
T min(T... args)
static const size_t IGN_FOUR_SIZE_T
size_t type with a value of 4
Definition: Helpers.hh:238
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:775
std::tuple< Durations... > breakDownDurations(DurationIn d)
break down durations NOTE: the template arguments must be properly ordered according to magnitude and...
Definition: Helpers.hh:795
static const uint32_t INF_UI32
32-bit unsigned integer positive infinite value
Definition: Helpers.hh:322
static const size_t IGN_FIVE_SIZE_T
size_t type with a value of 5
Definition: Helpers.hh:241
static const uint64_t INF_UI64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:348
T lowest(T... args)
static const float LOW_F
Float low value, equivalent to -MAX_F.
Definition: Helpers.hh:277
#define IGN_FP_VOLATILE
Define IGN_FP_VOLATILE for FP equality comparisons Use volatile parameters when checking floating poi...
Definition: Helpers.hh:195
STL class.
std::pair< int64_t, int64_t > timePointToSecNsec(const std::chrono::steady_clock::time_point &_time)
Convert a std::chrono::steady_clock::time_point to a seconds and nanoseconds pair.
Definition: Helpers.hh:738
T setfill(T... args)
bool isPowerOfTwo(unsigned int _x)
Is this a power of 2?
Definition: Helpers.hh:624
static const uint16_t INF_UI16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:296
std::chrono::steady_clock::time_point secNsecToTimePoint(const uint64_t &_sec, const uint64_t &_nanosec)
Convert seconds and nanoseconds to std::chrono::steady_clock::time_point.
Definition: Helpers.hh:758
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:226
static const uint16_t MIN_UI16
16bit unsigned integer minimum value
Definition: Helpers.hh:289
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:293
static const int16_t MIN_I16
16bit unsigned integer minimum value
Definition: Helpers.hh:302
T infinity(T... args)
static const int32_t MIN_I32
32bit unsigned integer minimum value
Definition: Helpers.hh:328
T max(T... args)
static const int64_t MIN_I64
64bit unsigned integer minimum value
Definition: Helpers.hh:354
T count(T... args)
T fixed(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:271
T size(T... args)
STL class.
bool isEven(const int _v)
Check if parameter is even.
Definition: Helpers.hh:445
T pow(T... args)
static const double NAN_D
Returns the representation of a quiet not a number (NAN)
Definition: Helpers.hh:268
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:306
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:358
static const double MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:256
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:232
static const int64_t INF_I64
64-bit unsigned integer positive infinite value
Definition: Helpers.hh:361
static const float MIN_F
Float minimum value. This value will be similar to 1.17549e-38.
Definition: Helpers.hh:274
T isnan(T... args)
double parseFloat(const std::string &_input)
parse string into float
Definition: Helpers.hh:707
constexpr T IGN_MASSMATRIX3_DEFAULT_TOLERANCE
The default tolerance value used by MassMatrix3::IsValid(), MassMatrix3::IsPositive(), and MassMatrix3::ValidMoments()
Definition: Helpers.hh:39
static const int16_t INF_I16
16-bit unsigned integer positive infinite value
Definition: Helpers.hh:309
T quiet_NaN(T... args)
static const double INF_D
Double positive infinite value.
Definition: Helpers.hh:265
void sort2(T &_a, T &_b)
Sort two numbers, such that _a <= _b.
Definition: Helpers.hh:599
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:319
static const size_t IGN_THREE_SIZE_T
size_t type with a value of 3
Definition: Helpers.hh:235
static const size_t IGN_SEVEN_SIZE_T
size_t type with a value of 7
Definition: Helpers.hh:247
T isinf(T... args)
Definition: Angle.hh:42
T setprecision(T... args)
std::string timePointToString(const std::chrono::steady_clock::time_point &_point)
Convert a std::chrono::steady_clock::time_point to a string.
Definition: Helpers.hh:809
T stoi(T... args)
T round(T... args)
int parseInt(const std::string &_input)
parse string into an integer
Definition: Helpers.hh:678
bool lessOrNearEqual(const T &_a, const T &_b, const T &_epsilon=1e-6)
inequality test, within a tolerance
Definition: Helpers.hh:567
T min(const std::vector< T > &_values)
get the minimum value of vector of values
Definition: Helpers.hh:541
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:405
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:660
void sort3(T &_a, T &_b, T &_c)
Sort three numbers, such that _a <= _b <= _c.
Definition: Helpers.hh:611
static const int32_t MAX_I32
32bit unsigned integer maximum value
Definition: Helpers.hh:325