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 302 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 314 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 291 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 219 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 280 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 268 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 185 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 243 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 256 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 327 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 231 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 207 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 196 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 334 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.