BALL::Maths More...
Functions |
|
| template<typename T > | |
| T | BALL::Maths::abs (const T &t) |
| Return the absolute value of a
number. |
|
| template<typename T > | |
| T | BALL::Maths::frac (const T &t) |
| Return the fraction of a number.
|
|
| template<typename T > | |
| T | BALL::Maths::max (const T &a, const T &b) |
| Return the greater of two numbers.
|
|
| template<typename T > | |
| T | BALL::Maths::max (const T &a, const T &b, const T &ct) |
| Return the greatest of three
numbers. |
|
| template<typename T > | |
| T | BALL::Maths::min (const T &a, const T &b) |
| Return the smallest of two numbers.
|
|
| template<typename T > | |
| T | BALL::Maths::min (const T &a, const T &b, const T &ct) |
| Return the smallest of three
numbers. |
|
| template<typename T > | |
| T | BALL::Maths::round (const T &t) |
| Round a number and return the
result. |
|
| template<typename T > | |
| T | BALL::Maths::sgn (const T &t) |
| Return the sign of a number.
|
|
| template<typename T > | |
| bool | BALL::Maths::isFinite (const T &t) |
| Test whether a number is finite.
|
|
| template<typename T > | |
| bool | BALL::Maths::isNan (const T &t) |
| Test whether a value is not a
number. |
|
| template<typename T > | |
| bool | BALL::Maths::isInfinite (const T &t) |
| Test whether a number is infinite.
|
|
| template<typename T > | |
| bool | BALL::Maths::isZero (const T &t) |
| Test whether a number is zero.
|
|
| template<typename T > | |
| bool | BALL::Maths::isNotZero (const T &t) |
| Test whether a number is not zero.
|
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isEqual (const T1 &a, const T2 &b) |
| Test whether a number is equal to
another. |
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isNotEqual (const T1 &a, const T2 &b) |
| Test whether a number is not equal
to another. |
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isLess (const T1 &a, const T2 &b) |
| Test whether a number is less
compared to another. |
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isLessOrEqual (const T1 &a, const T2 &b) |
| Test whether a number is less or
equal compared to another. |
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isGreaterOrEqual (const T1 &a, const T2 &b) |
| Test whether a number is greater or
equal compared to another. |
|
| template<typename T1 , typename T2 > | |
| bool | BALL::Maths::isGreater (const T1 &a, const T2 &b) |
| Test whether a number is greater
compared to another. |
|
| template<typename T > | |
| long | BALL::Maths::floor (const T &t) |
| Return the floor of a number.
|
|
| template<typename T > | |
| long | BALL::Maths::ceiling (const T &t) |
| Return the ceiling of a number.
|
|
| template<typename T1 , typename T2 > | |
| Index | BALL::Maths::compare (const T1 &a, const T2 &b) |
| Compare two numbers to each other.
|
|
| template<typename T > | |
| bool | BALL::Maths::isNear (const T &a, const T &b, const T &max_diff) |
| Test whether two numbers are close
to each other. |
|
| double | BALL::Maths::rint (double x) |
| round to integral value in
floating-point format |
|
BALL::Maths
| T BALL::Maths::abs | ( | const T & | t | ) |
Return the absolute value of a number.
| t | the number |
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 | ) |
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 | |||
| ) |
Compare two numbers to each other.
| a | the first number | |
| b | the second number |
-1 a < b; 0 a = b;
1 a > bReferences BALL::Maths::isEqual(), and BALL::Maths::isLess().
| long BALL::Maths::floor | ( | const T & | t | ) |
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 | ) |
Return the fraction of a number.
| t | the number |
| bool BALL::Maths::isEqual | ( | const T1 & | a, | |
| const T2 & | b | |||
| ) |
Test whether a number is equal to another.
| a | the first number | |
| b | the second number |
a and b is below
Constants::EPSILONReferences 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::TVector3< 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 | ) |
Test whether a number is finite.
| t | the number |
t is finiteReferenced by BALL::Maths::isInfinite().
| bool BALL::Maths::isGreater | ( | const T1 & | a, | |
| const T2 & | b | |||
| ) |
Test whether a number is greater compared to another.
| a | the first number | |
| b | the second number |
a is greater than
bReferences 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 | |||
| ) |
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 bReferences BALL::Constants::EPSILON.
Referenced by BALL::GetIntersection(), and BALL::TAngle< T >::operator>=().
| bool BALL::Maths::isInfinite | ( | const T & | t | ) |
Test whether a number is infinite.
| t | the number |
t equals
inf or -infReferences BALL::Maths::isFinite(), and BALL::Maths::isNan().
| bool BALL::Maths::isLess | ( | const T1 & | a, | |
| const T2 & | b | |||
| ) |
Test whether a number is less compared to another.
| a | the first number | |
| b | the second number |
a is smaller than
bReferences BALL::Constants::EPSILON.
Referenced by BALL::Maths::ceiling(), BALL::Maths::compare(), 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 | |||
| ) |
Test whether a number is less or equal compared to another.
| a | the first number | |
| b | the second number |
a is less or equal
bReferences 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 | ) |
Test whether a value is not a number.
| t | the number |
nanReferenced by BALL::Maths::isInfinite(), and BALL::SolveSystem().
| bool BALL::Maths::isNear | ( | const T & | a, | |
| const T & | b, | |||
| const T & | max_diff | |||
| ) |
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_diffReferences BALL::Maths::abs().
| bool BALL::Maths::isNotEqual | ( | const T1 & | a, | |
| const T2 & | b | |||
| ) |
Test whether a number is not equal to another.
| a | the first number | |
| b | the second number |
a and b is at least
Constants::EPSILONReferences BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::GetIntersection(), BALL::TVector4< T >::operator!=(), BALL::TVector3< 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 | ) |
Test whether a number is not zero.
| t | the number |
t is at least
Constants::EPSILONReferences BALL::Maths::abs(), and BALL::Constants::EPSILON.
Referenced by BALL::GetDistance(), and BALL::TLine3< T >::has().
| bool BALL::Maths::isZero | ( | const T & | t | ) |
Test whether a number is zero.
| t | the number |
t is below
Constants::EPSILONReferences 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 | |||
| ) |
Return the greatest of three numbers.
| a | the first number | |
| b | the second number | |
| ct | the third number |
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::max | ( | const T & | a, | |
| const T & | b | |||
| ) |
Return the greater of two numbers.
| a | the first number | |
| b | the second number |
| T BALL::Maths::min | ( | const T & | a, | |
| const T & | b, | |||
| const T & | ct | |||
| ) |
Return the smallest of three numbers.
| a | the first number | |
| b | the second number | |
| ct | the third number |
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==().
| T BALL::Maths::min | ( | const T & | a, | |
| const T & | b | |||
| ) |
Return the smallest of two numbers.
| a | the first number | |
| b | the second number |
| T BALL::Maths::round | ( | const T & | t | ) |
Round a number and return the result.
| t | the number |
| T BALL::Maths::sgn | ( | const T & | t | ) |
Return the sign of a number.
| t | the number |
-1 t < 0; 0 t = 0;
1 t > 0
1.5.8