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 |
References BALL_ABS.
Referenced by BALL::GetAngle(), BALL::TSimpleBox3< T >::getDepth(), BALL::GetDistance(), BALL::TSimpleBox3< T >::getHeight(), BALL::GetIntersection(), BALL::TSimpleBox3< T >::getSurface(), BALL::TSimpleBox3< T >::getVolume(), BALL::TSimpleBox3< T >::getWidth(), BALL::Maths::isEqual(), BALL::Maths::isNear(), BALL::Maths::isNotEqual(), BALL::Maths::isNotZero(), and BALL::Maths::isZero().
| long BALL::Maths::ceiling | ( | const T & | t | ) | [inline] |
Return the ceiling of a number.
| t | the number |
References BALL::Maths::isEqual(), and BALL::Maths::isLess().
| 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 References BALL::Maths::isEqual(), and BALL::Maths::isLess().
| long BALL::Maths::floor | ( | const T & | t | ) | [inline] |
Return the floor of a number.
| t | the number |
References BALL::Maths::isEqual(), and BALL::Maths::isGreater().
Referenced by BALL::HashGrid3< Item >::calculateMinSpacing(), BALL::HashGrid3< Item >::getBox(), BALL::TRegularData1D< ValueType >::getClosestIndex(), BALL::TRegularData1D< ValueType >::getClosestValue(), BALL::TFFT3D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT2D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT1D< ComplexTraits >::getInterpolatedValue(), BALL::TRegularData1D< ValueType >::getLowerIndex(), and BALL::TRegularData1D< ValueType >::operator()().
| T BALL::Maths::frac | ( | const T & | t | ) | [inline] |
Return the fraction of a number.
| t | the number |
| 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 References BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::Maths::ceiling(), BALL::Maths::compare(), BALL::Maths::floor(), BALL::TQuaternion< T >::fromAxisAngle(), BALL::TQuaternion< T >::getAngle(), BALL::TQuaternion< T >::getAxis(), BALL::GetIntersection(), BALL::TSphere3< float >::has(), BALL::TSimpleBox3< T >::has(), BALL::TLine3< T >::has(), BALL::TCircle3< float >::has(), BALL::TMatrix4x4< T >::isEqual(), BALL::TQuaternion< T >::normalize(), BALL::TVector4< T >::operator==(), BALL::TVector2< T >::operator==(), BALL::TSphere3< float >::operator==(), BALL::TCircle3< float >::operator==(), BALL::TAngle< T >::operator==(), and BALL::TQuaternion< T >::toAxisAngle().
| bool BALL::Maths::isFinite | ( | const T & | t | ) | [inline] |
Test whether a number is finite.
| t | the number |
t is finite Referenced by BALL::Maths::isInfinite().
| 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 References BALL::Constants::EPSILON.
Referenced by BALL::Maths::floor(), BALL::GetIntersection(), BALL::TAngle< T >::normalize(), and BALL::TAngle< T >::operator>().
| 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 References BALL::Constants::EPSILON.
Referenced by BALL::GetIntersection(), and BALL::TAngle< T >::operator>=().
| bool BALL::Maths::isInfinite | ( | const T & | t | ) | [inline] |
Test whether a number is infinite.
| t | the number |
t equals inf or -inf References BALL::Maths::isFinite(), and BALL::Maths::isNan().
| 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 References BALL::Constants::EPSILON.
Referenced by BALL::Maths::ceiling(), BALL::Maths::compare(), BALL::TVector3< float >::getAngle_(), BALL::GetIntersection(), BALL::TSimpleBox3< T >::has(), BALL::TPlane3< T >::hessify(), BALL::TSimpleBox3< T >::isIntersecting(), BALL::TAngle< T >::normalize(), BALL::TAngle< T >::operator<(), BALL::SolveQuadraticEquation(), and BALL::SolveSystem().
| 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 References BALL::Constants::EPSILON.
Referenced by BALL::TSphere3< float >::has(), BALL::TCircle3< float >::has(), and BALL::TAngle< T >::operator<=().
| bool BALL::Maths::isNan | ( | const T & | t | ) | [inline] |
Test whether a value is not a number.
| t | the number |
nan Referenced by BALL::Maths::isInfinite(), and BALL::SolveSystem().
| 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 References BALL::Maths::abs().
| 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 References BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::GetIntersection(), BALL::TVector4< T >::operator!=(), BALL::TVector2< T >::operator!=(), BALL::TSphere3< float >::operator!=(), BALL::TCircle3< float >::operator!=(), and BALL::TAngle< T >::operator!=().
| bool BALL::Maths::isNotZero | ( | const T & | t | ) | [inline] |
Test whether a number is not zero.
| t | the number |
t is at least Constants::EPSILON References BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::TVector3< float >::getAngle_(), BALL::GetDistance(), and BALL::TLine3< T >::has().
| bool BALL::Maths::isZero | ( | const T & | t | ) | [inline] |
Test whether a number is zero.
| t | the number |
t is below Constants::EPSILON References BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::GetAngle(), BALL::GetDistance(), BALL::GetIntersection(), BALL::TPlane3< T >::has(), BALL::TCircle3< float >::has(), BALL::isComplanar(), BALL::TSphere3< float >::isEmpty(), BALL::isIntersecting(), BALL::isOrthogonal(), BALL::TVector4< T >::isOrthogonalTo(), BALL::TVector3< T >::isZero(), BALL::TVector2< T >::isZero(), BALL::TVector4< T >::normalize(), BALL::TVector3< T >::normalize(), BALL::TVector2< T >::normalize(), BALL::TVector4< T >::operator/(), BALL::TVector4< T >::operator/=(), BALL::SolveQuadraticEquation(), BALL::SolveSystem(), BALL::SolveSystem2(), and BALL::TPlane3< T >::TPlane3().
| 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 |
References BALL_MAX3.
| 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 |
References BALL_MAX.
Referenced by BALL::TFFT3D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT2D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT1D< ComplexTraits >::getInterpolatedValue(), BALL::PeakList< Peak< float > >::getMaxIntensity(), BALL::PeakList< Peak< float > >::getMinIntensity(), BALL::AssignBondOrderProcessor::getTotalCharge(), BALL::AssignBondOrderProcessor::getTotalPenalty(), BALL::TMatrix4x4< T >::invert(), BALL::TSimpleBox3< T >::join(), BALL::TFFT3D< ComplexTraits >::operator==(), BALL::TFFT2D< ComplexTraits >::operator==(), and BALL::TFFT1D< ComplexTraits >::operator==().
| 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 |
References BALL_MIN3.
| 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 |
References BALL_MIN.
Referenced by BALL::TFFT3D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT2D< ComplexTraits >::getInterpolatedValue(), BALL::TFFT1D< ComplexTraits >::getInterpolatedValue(), BALL::PeakList< Peak< float > >::getMinIntensity(), BALL::TSimpleBox3< T >::join(), BALL::TFFT3D< ComplexTraits >::operator==(), BALL::TFFT2D< ComplexTraits >::operator==(), and BALL::TFFT1D< ComplexTraits >::operator==().
round to integral value in floating-point format
Referenced by BALL::TFFT3D< ComplexTraits >::operator[](), BALL::TFFT2D< ComplexTraits >::operator[](), BALL::TFFT1D< ComplexTraits >::operator[](), BALL::TFFT3D< ComplexTraits >::phase(), BALL::TFFT2D< ComplexTraits >::phase(), BALL::TFFT1D< ComplexTraits >::phase(), BALL::TFFT3D< ComplexTraits >::translate(), BALL::TFFT2D< ComplexTraits >::translate(), and BALL::TFFT1D< ComplexTraits >::translate().
| T BALL::Maths::round | ( | const T & | t | ) | [inline] |
Round a number and return the result.
| t | the number |
| 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 References BALL_SGN.