latest version v1.9 - last update 10 Apr 2010 |
Functions | |
template<class T > | |
bool | lti::closeTo (const T &a, const T &b, const T epsilon=std::numeric_limits< T >::epsilon()) |
template<class T > | |
bool | lti::closeToZero (const T &a, const T epsilon=std::numeric_limits< T >::epsilon()) |
template<class T > | |
T | lti::round (T x) |
template<class T > | |
int | lti::iround (T x) |
template<class T > | |
long | lti::lround (T x) |
template<class T > | |
void | lti::exchange (T &a, T &b) |
template<class T > | |
T | lti::min (const T x, const T y) |
template<class T > | |
T | lti::max (const T x, const T y) |
template<class T > | |
T | lti::min (const T x, const T y, const T z) |
template<class T > | |
T | lti::max (const T x, const T y, const T z) |
template<class T > | |
T | lti::lnGamma (const T &x) |
double | lti::factorial (const int x) |
double | lti::lnFactorial (const int x) |
double | lti::binomial (const int n, const int k) |
byte | lti::abs (byte x) |
int | lti::abs (int x) |
float | lti::abs (float x) |
double | lti::abs (const double &x) |
template<class T > | |
T | lti::absdiff (const T &x, const T &y) |
template<class T > | |
T | lti::rectify (const T &x) |
template<class T > | |
T | lti::sqr (const T &x) |
int | lti::sqrt (int x) |
unsigned int | lti::sqrt (unsigned int x) |
float | lti::sqrt (float x) |
double | lti::sqrt (const double &x) |
float | lti::sigmoid (const float x) |
double | lti::sigmoid (const double &x) |
double | lti::sigmoid (const int x) |
template<class T > | |
T | lti::signum (T x) |
template<class T > | |
T | lti::signum0 (T x) |
template<class T > | |
bool | lti::even (const T x) |
template<class T > | |
bool | lti::odd (const T x) |
template<class T > | |
T | lti::betai (const T &a, const T &b, const T &x) |
Variables | |
const double | lti::Pi = 3.1415926535897932 |
const double | lti::NaN = log(-1.0) |
const double | lti::Inf = tan(Pi/2.0) |
double lti::abs | ( | const double & | x | ) | [inline] |
absolute value for any type
References lti::abs().
float lti::abs | ( | float | x | ) | [inline] |
absolute value for any type
References lti::abs().
int lti::abs | ( | int | x | ) | [inline] |
absolute value for integers
byte lti::abs | ( | byte | x | ) | [inline] |
absolute value for signed bytes
T lti::absdiff | ( | const T & | x, | |
const T & | y | |||
) | [inline] |
absolute difference for the given values equals if (x>y) then (x-y) else (y-x).
Note that with complex numbers it does not return the real abs value.
T lti::betai | ( | const T & | a, | |
const T & | b, | |||
const T & | x | |||
) | [inline] |
Compute the incomplete beta function.
double lti::binomial | ( | const int | n, | |
const int | k | |||
) |
Returns the binomial coefficient defined by
.
bool lti::closeTo | ( | const T & | a, | |
const T & | b, | |||
const T | epsilon = std::numeric_limits<T>::epsilon() | |||
) | [inline] |
Returns true if a is close to b, i.e.
if abs(a-b) <= epsilon.
This is always better than testing equality with a==b for floating point types. For default epsilon integers are tested for equality.
Note: Do not used for unsigned types T.
a | first value | |
b | second value | |
epsilon | max difference between a and b , default std::numeric_limits<T>::epsilon() |
bool lti::closeToZero | ( | const T & | a, | |
const T | epsilon = std::numeric_limits<T>::epsilon() | |||
) | [inline] |
Returns true if a is close to T(0), i.e.
if abs(a) <= epsilon.
This is always better than testing equality with a==0. for floating point types. For default epsilon integers are tested for ==0 automagically.
Note: Do not used for unsigned types T.
a | value | |
epsilon | maximum absolute value of a , default std::numeric_limits<T>::epsilon() |
bool lti::even | ( | const T | x | ) | [inline] |
Return true if the given number is an even number.
For floating point types, this function will return true only if the number is exacltly an integer and it is even.
void lti::exchange | ( | T & | a, | |
T & | b | |||
) | [inline] |
Exchange the content of the two given variables.
It works for all types T that properly define the copy constructor and operator=().
a | first variable | |
b | second variable |
Referenced by lti::minmax().
double lti::factorial | ( | const int | x | ) |
Returns the factorial of x.
Note that the returned type is always the same as the input type. So, if you require very large faculty values, just cast the input to double.
int lti::iround | ( | T | x | ) | [inline] |
round any float type mathematicly and return an integer
Referenced by lti::nearestNeighborInterpolator< T >::interpolate(), lti::arctanLUT::operator()(), and lti::draw< rgbPixel >::turnPoint().
double lti::lnFactorial | ( | const int | x | ) |
Returns the natural logarithm of the factorial of x.
T lti::lnGamma | ( | const T & | x | ) | [inline] |
Returns the value ln( gamma(x) ) for xx>0.
long lti::lround | ( | T | x | ) | [inline] |
round any float type mathematicly and return an long integer
T lti::max | ( | const T | x, | |
const T | y, | |||
const T | z | |||
) | [inline] |
Get the maximum of x, y and z.
References lti::max().
T lti::max | ( | const T | x, | |
const T | y | |||
) | [inline] |
Get the maximum of x and y.
Referenced by lti::abs(), lti::draw< rgbPixel >::enterPX(), lti::tree< T >::node::height(), lti::max(), lti::noise< T >::parameters::parameters(), lti::geometricTransform::rotate(), lti::scale(), and lti::kdTree< T, D, U >::node::subdivide().
T lti::min | ( | const T | x, | |
const T | y, | |||
const T | z | |||
) | [inline] |
Get the minimum of x, y and z.
References lti::min().
T lti::min | ( | const T | x, | |
const T | y | |||
) | [inline] |
Get the minimum of x and y.
Referenced by lti::draw< rgbPixel >::enterPX(), lti::min(), lti::noise< T >::parameters::parameters(), lti::SOFM2DVisualizer::sammonsMapper(), and lti::scale().
bool lti::odd | ( | const T | x | ) | [inline] |
Return true if the given number is an odd number.
For floating point types, this function will return true only if the number is exacltly an integer and it is odd.
T lti::rectify | ( | const T & | x | ) | [inline] |
rectify is 0 if x<0 or x otherwise
T lti::round | ( | T | x | ) | [inline] |
round any float type mathematicly
double lti::sigmoid | ( | const int | x | ) | [inline] |
sigmoid for ints
References lti::exp().
double lti::sigmoid | ( | const double & | x | ) | [inline] |
sigmoid for doubles
References lti::exp().
float lti::sigmoid | ( | const float | x | ) | [inline] |
sigmoid for floats
References lti::exp().
T lti::signum | ( | T | x | ) | [inline] |
signum of x (for x==0 -> signum = 1) (
T lti::signum0 | ( | T | x | ) | [inline] |
signum of x (for x==0 -> signum = 0) (
T lti::sqr | ( | const T & | x | ) | [inline] |
square (x*x)
double lti::sqrt | ( | const double & | x | ) | [inline] |
square root
References lti::sqrt().
float lti::sqrt | ( | float | x | ) | [inline] |
square root
References lti::sqrt().
unsigned int lti::sqrt | ( | unsigned int | x | ) | [inline] |
square root
References lti::sqrt().
int lti::sqrt | ( | int | x | ) | [inline] |
const double lti::Inf = tan(Pi/2.0) |
Constant Infinity (Inf) (double precision).
const double lti::NaN = log(-1.0) |
Constant Not a Number (NaN) (doble precision).
const double lti::Pi = 3.1415926535897932 |
Constant Pi (double precision).
Referenced by lti::degToRad(), lti::radToDeg(), and lti::draw3D< T >::parameters::setCamera().