Functions |
template<typename T > |
T | zeroVal () |
template<> |
std::string | zeroVal< std::string > () |
| Return the std::string value that corresponds to zero.
|
template<> |
bool | zeroVal< bool > () |
| Return the bool value that corresponds to zero.
|
template<typename T > |
T | toleranceValue () |
template<> |
float | toleranceValue< float > () |
template<typename T > |
T | negative (const T &val) |
template<> |
bool | negative (const bool &val) |
template<> |
std::string | negative (const std::string &val) |
| Return the "negation" of the given string.
|
void | randSeed (unsigned int seed) |
| ==========> Random Values <==================
|
double | randUniform () |
| Return random value [0,1].
|
template<typename Type > |
Type | Clamp (Type x, Type min, Type max) |
| Return x clamped to [min, max].
|
template<class Type > |
Type | Clamp01 (Type x) |
| Return x clamped to [0, 1].
|
template<class Type > |
bool | ClampTest01 (Type &x) |
| Return true if x is outside [0,1].
|
template<class Type > |
Type | SmoothUnitStep (Type x, Type min, Type max) |
| Return 0 if x<min, 1 if x>max and else (3-2*t)*t*t, (x-min)/(max-min)
|
int32_t | Abs (int32_t i) |
| Return the absolute value of a signed integer.
|
int64_t | Abs (int64_t i) |
| Return the absolute value of a signed long integer.
|
float | Abs (float x) |
| Return the absolute value of a float.
|
double | Abs (double x) |
| Return the absolute value of a double.
|
long double | Abs (long double x) |
| Return the absolute value of a long double.
|
uint32_t | Abs (uint32_t i) |
| Return the absolute value of a unsigned integer.
|
uint64_t | Abs (uint64_t i) |
| Return the absolute value of a unsigned integer.
|
template<typename Type > |
bool | isZero (const Type &x) |
template<typename Type > |
bool | isNegative (const Type &x) |
template<typename Type > |
bool | isApproxEqual (const Type &a, const Type &b) |
template<typename Type > |
bool | isApproxEqual (const Type &a, const Type &b, const Type &tolerance) |
template<> |
bool | isApproxEqual< bool > (const bool &a, const bool &b) |
template<> |
bool | isApproxEqual< bool > (const bool &a, const bool &b, const bool &) |
template<> |
bool | isApproxEqual< std::string > (const std::string &a, const std::string &b) |
template<> |
bool | isApproxEqual< std::string > (const std::string &a, const std::string &b, const std::string &) |
template<typename T0 , typename T1 > |
bool | isExactlyEqual (const T0 &a, const T1 &b) |
template<typename Type > |
bool | isRelOrApproxEqual (const Type &a, const Type &b, const Type &absTol, const Type &relTol) |
template<> |
bool | isRelOrApproxEqual (const bool &a, const bool &b, const bool &, const bool &) |
int32_t | floatToInt32 (const float aFloatValue) |
int64_t | doubleToInt64 (const double aDoubleValue) |
bool | isUlpsEqual (const double aLeft, const double aRight, const int64_t aUnitsInLastPlace) |
bool | isUlpsEqual (const float aLeft, const float aRight, const int32_t aUnitsInLastPlace) |
template<typename Type > |
Type | Pow2 (Type x) |
| Return x to the power of two, i.e. x*x.
|
template<typename Type > |
Type | Pow3 (Type x) |
| Return x to the power of three, i.e. x*x*x.
|
template<typename Type > |
Type | Pow4 (Type x) |
| Return x to the power of four, i.e. x*x*x*x.
|
template<typename Type > |
Type | Pow (Type x, int n) |
| Return x to the power of n, i.e. x^n.
|
float | Pow (float b, float e) |
| Return b to the power of e, i.e. b^e.
|
double | Pow (double b, double e) |
| Return b to the power of e, i.e. b^e.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b) |
| Return the maximum of two values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c) |
| Return the maximum of three values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c, const Type &d) |
| Return the maximum of four values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e) |
| Return the maximum of five values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f) |
| Return the maximum of six values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f, const Type &g) |
| Return the maximum of seven values.
|
template<typename Type > |
const Type & | Max (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f, const Type &g, const Type &h) |
| Return the maximum of eight values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b) |
| Return the minimum of two values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c) |
| Return the minimum of three values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c, const Type &d) |
| Return the minimum of four values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e) |
| Return the minimum of five values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f) |
| Return the minimum of six values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f, const Type &g) |
| Return the minimum of seven values.
|
template<typename Type > |
const Type & | Min (const Type &a, const Type &b, const Type &c, const Type &d, const Type &e, const Type &f, const Type &g, const Type &h) |
| Return the minimum of eight values.
|
template<typename Type > |
int | Sign (const Type &x) |
| Return the sign of a variable as an integer. The three cases are -1, 0 or 1.
|
float | Sqrt (float x) |
| Return square-root of a floating point.
|
double | Sqrt (double x) |
long double | Sqrt (long double x) |
int | Mod (int i, int j) |
| Return remainder of x/y = Mod.
|
float | Mod (float x, float y) |
double | Mod (double x, double y) |
long double | Mod (long double x, long double y) |
template<typename Type > |
Type | Reminder (Type x, Type y) |
| Return reminder of x/y.
|
float | RoundUp (float x) |
| Return round up to nearest integer or base.
|
double | RoundUp (double x) |
long double | RoundUp (long double x) |
template<typename Type > |
Type | RoundUp (Type x, Type base) |
float | RoundDown (float x) |
| Return rounds down to nearest integer or base.
|
double | RoundDown (double x) |
long double | RoundDown (long double x) |
template<typename Type > |
Type | RoundDown (Type x, Type base) |
template<typename Type > |
Type | IntegerPart (Type x) |
| Return integer part.
|
template<typename Type > |
Type | FractionalPart (Type x) |
| Return fractional part.
|
int | Floor (float x) |
| Return floor.
|
int | Floor (double x) |
int | Floor (long double x) |
int | Ceil (float x) |
| Return ceil.
|
int | Ceil (double x) |
int | Ceil (long double x) |
template<typename Type > |
Type | Round (Type x) |
| Return rounds off x to nearest integer value.
|
template<typename Type > |
Type | Chop (Type x, Type delta) |
| Return chop of x.
|
template<typename Type > |
Type | Truncate (Type x, unsigned int digits) |
| Return truncation of x to smoe digits.
|
template<typename Type > |
Type | Inv (Type x) |
| Return inverse of x.
|
|
std::string | operator+ (const std::string &s, bool) |
| Needed to support the (zeroVal<ValueType>() + val) idiom when ValueType is std::string .
|
std::string | operator+ (const std::string &s, int) |
| Needed to support the (zeroVal<ValueType>() + val) idiom when ValueType is std::string .
|
std::string | operator+ (const std::string &s, float) |
| Needed to support the (zeroVal<ValueType>() + val) idiom when ValueType is std::string .
|
std::string | operator+ (const std::string &s, double) |
| Needed to support the (zeroVal<ValueType>() + val) idiom when ValueType is std::string .
|