Functions | |
template<typename T > | |
T | BALL::Maths::abs (const T &t) |
template<typename T > | |
T | BALL::Maths::frac (const T &t) |
template<typename T > | |
T | BALL::Maths::max (const T &a, const T &b) |
template<typename T > | |
T | BALL::Maths::max (const T &a, const T &b, const T &ct) |
template<typename T > | |
T | BALL::Maths::min (const T &a, const T &b) |
template<typename T > | |
T | BALL::Maths::min (const T &a, const T &b, const T &ct) |
template<typename T > | |
T | BALL::Maths::round (const T &t) |
template<typename T > | |
T | BALL::Maths::sgn (const T &t) |
template<typename T > | |
bool | BALL::Maths::isFinite (const T &t) |
template<typename T > | |
bool | BALL::Maths::isNan (const T &t) |
template<typename T > | |
bool | BALL::Maths::isInfinite (const T &t) |
template<typename T > | |
bool | BALL::Maths::isZero (const T &t) |
template<typename T > | |
bool | BALL::Maths::isNotZero (const T &t) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isEqual (const T1 &a, const T2 &b) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isNotEqual (const T1 &a, const T2 &b) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isLess (const T1 &a, const T2 &b) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isLessOrEqual (const T1 &a, const T2 &b) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isGreaterOrEqual (const T1 &a, const T2 &b) |
template<typename T1 , typename T2 > | |
bool | BALL::Maths::isGreater (const T1 &a, const T2 &b) |
template<typename T > | |
long | BALL::Maths::floor (const T &t) |
template<typename T > | |
long | BALL::Maths::ceiling (const T &t) |
template<typename T1 , typename T2 > | |
Index | BALL::Maths::compare (const T1 &a, const T2 &b) |
template<typename T > | |
bool | BALL::Maths::isNear (const T &a, const T &b, const T &max_diff) |
double | BALL::Maths::rint (double x) |
round to integral value in floating-point format |
Namespace: BALL::Maths
T BALL::Maths::abs | ( | const T & | t | ) | [inline] |
Return the absolute value of a number.
t | the number |
Definition at line 54 of file MATHS/common.h.
long BALL::Maths::ceiling | ( | const T & | t | ) | [inline] |
Return the ceiling of a number.
t | the number |
Definition at line 300 of file MATHS/common.h.
Index BALL::Maths::compare | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Compare two numbers to each other.
a | the first number | |
b | the second number |
-1
a < b; 0
a = b; 1
a > b Definition at line 312 of file MATHS/common.h.
long BALL::Maths::floor | ( | const T & | t | ) | [inline] |
Return the floor of a number.
t | the number |
Definition at line 289 of file MATHS/common.h.
T BALL::Maths::frac | ( | const T & | t | ) | [inline] |
Return the fraction of a number.
t | the number |
Definition at line 65 of file MATHS/common.h.
bool BALL::Maths::isEqual | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is equal to another.
a | the first number | |
b | the second number |
a
and b
is below Constants::EPSILON Definition at line 217 of file MATHS/common.h.
bool BALL::Maths::isFinite | ( | const T & | t | ) | [inline] |
Test whether a number is finite.
t | the number |
t
is finite Definition at line 153 of file MATHS/common.h.
bool BALL::Maths::isGreater | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is greater compared to another.
a | the first number | |
b | the second number |
a
is greater than b
Definition at line 278 of file MATHS/common.h.
bool BALL::Maths::isGreaterOrEqual | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is greater or equal compared to another.
a | the first number | |
b | the second number |
a
is greater or equal than b
Definition at line 266 of file MATHS/common.h.
bool BALL::Maths::isInfinite | ( | const T & | t | ) | [inline] |
Test whether a number is infinite.
t | the number |
t
equals inf
or -inf
Definition at line 183 of file MATHS/common.h.
bool BALL::Maths::isLess | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is less compared to another.
a | the first number | |
b | the second number |
a
is smaller than b
Definition at line 241 of file MATHS/common.h.
bool BALL::Maths::isLessOrEqual | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is less or equal compared to another.
a | the first number | |
b | the second number |
a
is less or equal b
Definition at line 254 of file MATHS/common.h.
bool BALL::Maths::isNan | ( | const T & | t | ) | [inline] |
Test whether a value is not a number.
t | the number |
nan
Definition at line 168 of file MATHS/common.h.
bool BALL::Maths::isNear | ( | const T & | a, | |
const T & | b, | |||
const T & | max_diff | |||
) | [inline] |
Test whether two numbers are close to each other.
a | the first number | |
b | the second number | |
max_diff | the maximum allowed difference between the two numbers |
a
and b
is below max_diff
Definition at line 325 of file MATHS/common.h.
bool BALL::Maths::isNotEqual | ( | const T1 & | a, | |
const T2 & | b | |||
) | [inline] |
Test whether a number is not equal to another.
a | the first number | |
b | the second number |
a
and b
is at least Constants::EPSILON Definition at line 229 of file MATHS/common.h.
bool BALL::Maths::isNotZero | ( | const T & | t | ) | [inline] |
Test whether a number is not zero.
t | the number |
t
is at least Constants::EPSILON Definition at line 205 of file MATHS/common.h.
bool BALL::Maths::isZero | ( | const T & | t | ) | [inline] |
Test whether a number is zero.
t | the number |
t
is below Constants::EPSILON Definition at line 194 of file MATHS/common.h.
T BALL::Maths::max | ( | const T & | a, | |
const T & | b, | |||
const T & | ct | |||
) | [inline] |
Return the greatest of three numbers.
a | the first number | |
b | the second number | |
ct | the third number |
Definition at line 92 of file MATHS/common.h.
T BALL::Maths::max | ( | const T & | a, | |
const T & | b | |||
) | [inline] |
Return the greater of two numbers.
a | the first number | |
b | the second number |
Definition at line 79 of file MATHS/common.h.
T BALL::Maths::min | ( | const T & | a, | |
const T & | b, | |||
const T & | ct | |||
) | [inline] |
Return the smallest of three numbers.
a | the first number | |
b | the second number | |
ct | the third number |
Definition at line 119 of file MATHS/common.h.
T BALL::Maths::min | ( | const T & | a, | |
const T & | b | |||
) | [inline] |
Return the smallest of two numbers.
a | the first number | |
b | the second number |
Definition at line 106 of file MATHS/common.h.
round to integral value in floating-point format
Definition at line 332 of file MATHS/common.h.
T BALL::Maths::round | ( | const T & | t | ) | [inline] |
Round a number and return the result.
t | the number |
Definition at line 131 of file MATHS/common.h.
T BALL::Maths::sgn | ( | const T & | t | ) | [inline] |
Return the sign of a number.
t | the number |
-1
t < 0; 0
t = 0; 1
t > 0 Definition at line 142 of file MATHS/common.h.