[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

details Mathematical Functions VIGRA


Namespaces

namespace  vigra::detail
namespace  vigra::detail

Classes

class  BSpline
class  BSplineBase
class  CatmullRomSpline
class  CoscotFunction
class  Gaussian

Functions

template<class T> double erf (T x)
float round (float t)
template<class T> NumericTraits< T >::Promote sq (T t)
Int32 sqrti (Int32 v)
UInt32 sqrti (UInt32 v)
template<class T> T sign (T t)
template<class T1, class T2> T1 sign (T1 t1, T2 t2)
NormTraits< T >::SquaredNormType squaredNorm (T const &t)
template<class T> NormTraits< T >::NormType norm (T const &t)
template<class T1, class T2> bool closeAtTolerance (T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
template<typename IntType> IntType gcd (IntType n, IntType m)
template<typename IntType> IntType lcm (IntType n, IntType m)
result_type operator() (argument_type x) const


Detailed Description


Useful mathematical functions and functors.


Define Documentation


#define VIGRA_DEFINE_NORM  

 

Value:

inline NormTraits<T>::SquaredNormType squaredNorm(T t) { return sq(t); } \
    inline NormTraits<T>::NormType norm(T t) { return abs(t); }


Function Documentation


bool closeAtTolerance T1    l,
T2    r,
typename PromoteTraits< T1, T2 >::Promote    epsilon

 

Tolerance based floating-point comparison.

Check whether two floating point numbers are equal within the given tolerance. This is useful because floating point numbers that should be equal in theory are rarely exactly equal in practice. If the tolerance epsilon is not given, twice the machine epsilon is used.

#include "vigra/mathutil.hxx"
Namespace: vigra


double erf   x

 

The error function.

If erf() is not provided in the C standard math library (as it should according to the new C99 standard ?), VIGRA implements erf() as an approximation of the error function

according to the formula given in Press et al. "Numerical Recipes".

#include "vigra/mathutil.hxx"
Namespace: vigra


IntType gcd IntType    n,
IntType    m

 

Calculate the greatest common divisor.

This function works for arbitrary integer types, including user-defined (e.g. infinite precision) ones.

#include "vigra/rational.hxx"
Namespace: vigra


IntType lcm IntType    n,
IntType    m

 

Calculate the lowest common multiple.

This function works for arbitrary integer types, including user-defined (e.g. infinite precision) ones.

#include "vigra/rational.hxx"
Namespace: vigra


NormTraits<T>::NormType norm T const &    t [inline]

 

The norm of a numerical object.

For scalar types: implemented as abs(t)
otherwise: implemented as sqrt(squaredNorm(t)).

#include "vigra/mathutil.hxx"
Namespace: vigra


CatmullRomSpline< T >::result_type operator() argument_type    x const [inherited]

 

function (functor) call


float round float    t [inline]

 

The rounding function.

Defined for all floating point types. Rounds towards the nearest integer for both positive and negative inputs.

#include "vigra/mathutil.hxx"
Namespace: vigra


T1 sign T1    t1,
T2    t2

 

The binary sign function.

Transfers the sign of t2 to t1.

#include "vigra/mathutil.hxx"
Namespace: vigra


T sign   t

 

The sign function.

Returns 1, 0, or -1 depending on the sign of t.

#include "vigra/mathutil.hxx"
Namespace: vigra


NumericTraits<T>::Promote sq   t [inline]

 

The square function.

sq(x) is needed so often that it makes sense to define it as a function.

#include "vigra/mathutil.hxx"
Namespace: vigra


UInt32 sqrti UInt32    v [inline]

 

Unsigned integer square root.

#include "vigra/mathutil.hxx"
Namespace: vigra


Int32 sqrti Int32    v [inline]

 

Signed integer square root.

#include "vigra/mathutil.hxx"
Namespace: vigra


NormTraits<T>::SquaredNormType squaredNorm T const &    t

 

The squared norm of a numerical object.

For scalar types: equals vigra::sq(t)
. For vectorial types: equals vigra::dot(t, t)
. For complex types: equals vigra::sq(t.real()) + vigra::sq(t.imag())
. For matrix types: results in the squared Frobenius norm (sum of squares of the matrix elements).

© Ullrich Köthe (koethe@informatik.uni-hamburg.de)
Cognitive Systems Group, University of Hamburg, Germany

html generated using doxygen and Python
VIGRA 1.4.0 (21 Dec 2005)