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

Classes | Functions
Mathematical Functions

Classes

class  BSpline< ORDER, T >
class  BSplineBase< ORDER, T >
class  CatmullRomSpline< T >
class  CoscotFunction< T >
class  Gaussian< T >

Functions

template<class IndexIterator , class InIterator , class OutIterator >
void applyPermutation (IndexIterator index_first, IndexIterator index_last, InIterator in, OutIterator out)
template<class Iterator >
Iterator argMax (Iterator first, Iterator last)
template<class Iterator , class UnaryFunctor >
Iterator argMaxIf (Iterator first, Iterator last, UnaryFunctor condition)
template<class Iterator >
Iterator argMin (Iterator first, Iterator last)
template<class Iterator , class UnaryFunctor >
Iterator argMinIf (Iterator first, Iterator last, UnaryFunctor condition)
double besselJ (int n, double x)
double besselY (int n, double x)
UInt32 ceilPower2 (UInt32 x)
UInt32 checksum (const char *data, unsigned int size)
double chi2 (unsigned int degreesOfFreedom, double arg, double accuracy=1e-7)
double chi2CDF (unsigned int degreesOfFreedom, double arg, double accuracy=1e-7)
template<class T1 , class T2 >
bool closeAtTolerance (T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
UInt32 concatenateChecksum (UInt32 checksum, const char *data, unsigned int size)
template<class PointArray1 , class PointArray2 >
void convexHull (const PointArray1 &points, PointArray2 &convex_hull)
 Compute convex hull of a 2D polygon.
template<class REAL >
REAL cos_pi (REAL x)
double ellipticIntegralE (double x, double k)
double ellipticIntegralF (double x, double k)
bool even (int t)
UInt32 floorPower2 (UInt32 x)
double gamma (double x)
template<typename IntType >
IntType gcd (IntType n, IntType m)
template<class Iterator , class IndexIterator , class Compare >
void indexSort (Iterator first, Iterator last, IndexIterator index_first, Compare c)
template<class InIterator , class OutIterator >
void inversePermutation (InIterator first, InIterator last, OutIterator out)
template<typename IntType >
IntType lcm (IntType n, IntType m)
template<class REAL >
REAL legendre (unsigned int l, int m, REAL x)
template<class REAL >
REAL legendre (unsigned int l, REAL x)
template<class Iterator , class Value >
void linearSequence (Iterator first, Iterator last, Value start, Value step)
Int32 log2i (UInt32 x)
double loggamma (double x)
double noncentralChi2 (unsigned int degreesOfFreedom, double noncentrality, double arg, double accuracy=1e-7)
double noncentralChi2CDF (unsigned int degreesOfFreedom, double noncentrality, double arg, double accuracy=1e-7)
double noncentralChi2CDFApprox (unsigned int degreesOfFreedom, double noncentrality, double arg)
template<class T >
NormTraits< T >::NormType norm (T const &t)
bool odd (int t)
result_type operator() (argument_type x) const
REAL round (REAL v)
int roundi (double t)
template<class T >
sign (T t)
template<class T1 , class T2 >
T1 sign (T1 t1, T2 t2)
template<class T >
int signi (T t)
template<class REAL >
REAL sin_pi (REAL x)
template<class T >
NumericTraits< T >::Promote sq (T t)
Int32 sqrti (Int32 v)
NormTraits< T >::SquaredNormType squaredNorm (T const &t)
template<class T >
void symmetric2x2Eigenvalues (T a00, T a01, T a11, T *r0, T *r1)
template<class T >
void symmetric3x3Eigenvalues (T a00, T a01, T a02, T a11, T a12, T a22, T *r0, T *r1, T *r2)

Detailed Description

Useful mathematical functions and functors.

Function Documentation

Iterator vigra::argMin ( Iterator  first,
Iterator  last 
)

Find the minimum element in a sequence.

   The function returns the iterator referring to the minimum element.
   This is identical to the function <tt>std::min_element()</tt>.

   <b>Required Interface:</b>

   @code 
   Iterator is a standard forward iterator.

   bool f = *first < NumericTraits<typename std::iterator_traits<Iterator>::value_type>::max();
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
Iterator vigra::argMax ( Iterator  first,
Iterator  last 
)

Find the maximum element in a sequence.

   The function returns the iterator referring to the maximum element.
   This is identical to the function <tt>std::max_element()</tt>.

   <b>Required Interface:</b>

   @code 
   Iterator is a standard forward iterator.

   bool f = NumericTraits<typename std::iterator_traits<Iterator>::value_type>::min() < *first;
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
Iterator vigra::argMinIf ( Iterator  first,
Iterator  last,
UnaryFunctor  condition 
)

Find the minimum element in a sequence conforming to a condition.

   The function returns the iterator referring to the minimum element,
   where only elements conforming to the condition (i.e. where 
   <tt>condition(*iterator)</tt> evaluates to <tt>true</tt>) are considered.
   If no element conforms to the condition, or the sequence is empty,
   the end iterator \a last is returned.

   <b>Required Interface:</b>

   @code 
   Iterator is a standard forward iterator.

   bool c = condition(*first);

   bool f = *first < NumericTraits<typename std::iterator_traits<Iterator>::value_type>::max();
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
Iterator vigra::argMaxIf ( Iterator  first,
Iterator  last,
UnaryFunctor  condition 
)

Find the maximum element in a sequence conforming to a condition.

   The function returns the iterator referring to the maximum element,
   where only elements conforming to the condition (i.e. where 
   <tt>condition(*iterator)</tt> evaluates to <tt>true</tt>) are considered.
   If no element conforms to the condition, or the sequence is empty,
   the end iterator \a last is returned.

   <b>Required Interface:</b>

   @code 
   Iterator is a standard forward iterator.

   bool c = condition(*first);

   bool f = NumericTraits<typename std::iterator_traits<Iterator>::value_type>::min() < *first;
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
void vigra::linearSequence ( Iterator  first,
Iterator  last,
Value  start,
Value  step 
)

Fill an array with a sequence of numbers.

   The sequence starts at \a start and is incremented with \a step. Default start
   and stepsize are 0 and 1 respectively.

   <b> Declaration:</b>

   @code 
   namespace vigra {
       template <class Iterator, class Value>
       void linearSequence(Iterator first, Iterator last, 
                     Value const & start = 0, Value const & step = 1);
   }
   \endcode

   <b>Required Interface:</b>

   @code 
   Iterator is a standard forward iterator.

   *first = start;
   start += step;
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
void vigra::indexSort ( Iterator  first,
Iterator  last,
IndexIterator  index_first,
Compare  c 
)

Return the index permutation that would sort the input array.

   To actually sort an array according to the ordering thus determined, use 
   \ref applyPermutation().

   <b> Declarations:</b>

   @code 
   namespace vigra {
       // compare using std::less
       template <class Iterator, class IndexIterator>
       void indexSort(Iterator first, Iterator last, IndexIterator index_first);

       // compare using functor Compare
       template <class Iterator, class IndexIterator, class Compare>
       void indexSort(Iterator first, Iterator last, IndexIterator index_first, Compare compare);
   }
   \endcode

   <b>Required Interface:</b>

   @code 
   Iterator and IndexIterators are random access iterators.

   bool res = compare(first[*index_first], first[*index_first]);
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
void vigra::applyPermutation ( IndexIterator  index_first,
IndexIterator  index_last,
InIterator  in,
OutIterator  out 
)

Sort an array according to the given index permutation.

   The iterators \a in and \a out may not refer to the same array, as
   this would overwrite the input prematurely.

   <b> Declaration:</b>

   @code 
   namespace vigra {
       template <class IndexIterator, class InIterator, class OutIterator>
       void applyPermutation(IndexIterator index_first, IndexIterator index_last, 
                             InIterator in, OutIterator out);
   }
   \endcode

   <b>Required Interface:</b>

   @code 
   OutIterator and IndexIterators are forward iterators.
   InIterator is a random access iterator.

   *out = in[*index_first];
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
void vigra::inversePermutation ( InIterator  first,
InIterator  last,
OutIterator  out 
)

Compute the inverse of a given permutation.

   This is just another name for \ref indexSort(), referring to
   another semantics.

   <b> Declaration:</b>

   @code 
   namespace vigra {
       template <class InIterator, class OutIterator>
       void inversePermutation(InIterator first, InIterator last, 
                               OutIterator out);
   }
   \endcode

   <b>Required Interface:</b>

   @code 
   InIterator and OutIterator are random access iterators.

   *out = in[*index_first];
   \endcode

   <b>\#include</b> \<vigra/algorithm.hxx\><br>
   Namespace: vigra
UInt32 vigra::checksum ( const char *  data,
unsigned int  size 
)

Compute the CRC-32 checksum of a byte array.

   Implementation note: This function is slower on big-endian machines
   because the "4 bytes at a time" optimization is only implemented for 
   little-endian.
UInt32 vigra::concatenateChecksum ( UInt32  checksum,
const char *  data,
unsigned int  size 
)

Concatenate a byte array to an existing CRC-32 checksum.

double vigra::besselJ ( int  n,
double  x 
)

Bessel function of the first kind.

   Computes the value of BesselJ of integer order <tt>n</tt> and argument <tt>x</tt>.
   Negative <tt>x</tt> are unsupported and will result in a <tt>std::domain_error</tt>.

   This function wraps a number of existing implementations and falls back to 
   a rather slow algorithm if none of them is available. In particular,
   it uses boost::math when <tt>HasBoostMath</tt> is \#defined, or native 
   implementations on gcc and MSVC otherwise.

   <b>\#include</b> \<vigra/bessel.hxx\><br>
   Namespace: vigra
double vigra::besselY ( int  n,
double  x 
)

Bessel function of the second kind.

   Computes the value of BesselY of integer order <tt>n</tt> and argument <tt>x</tt>.
   Negative <tt>x</tt> are unsupported and will result in a <tt>std::domain_error</tt>.

   This function wraps a number of existing implementations and falls back to 
   a rather slow algorithm if none of them is available. In particular,
   it uses boost::math when <tt>HasBoostMath</tt> is \#defined, or native 
   implementations on gcc and MSVC otherwise.

   <b>\#include</b> \<vigra/bessel.hxx\><br>
   Namespace: vigra
REAL vigra::round ( REAL  v)

The rounding function.

   Defined for all floating point types. Rounds towards the nearest integer 
   such that <tt>abs(round(t)) == round(abs(t))</tt> for all <tt>t</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
int vigra::roundi ( double  t)

Round and cast to integer.

   Rounds to the nearest integer like round(), but casts the result to 
   <tt>int</tt> (this will be faster and is usually needed anyway).

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
UInt32 vigra::ceilPower2 ( UInt32  x)

Round up to the nearest power of 2.

   Efficient algorithm for finding the smallest power of 2 which is not smaller than \a x
   (function clp2() from Henry Warren: "Hacker's Delight", Addison-Wesley, 2003,
    see http://www.hackersdelight.org/).
   If \a x > 2^31, the function will return 0 because integer arithmetic is defined modulo 2^32.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
UInt32 vigra::floorPower2 ( UInt32  x)

Round down to the nearest power of 2.

   Efficient algorithm for finding the largest power of 2 which is not greater than \a x
   (function flp2() from Henry Warren: "Hacker's Delight", Addison-Wesley, 2003,
    see http://www.hackersdelight.org/).

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
Int32 vigra::log2i ( UInt32  x)

Compute the base-2 logarithm of an integer.

   Returns the position of the left-most 1-bit in the given number \a x, or
   -1 if \a x == 0. That is,

   @code 
   assert(k >= 0 && k < 32 && log2i(1 << k) == k);
   \endcode

   The function uses Robert Harley's algorithm to determine the number of leading zeros
   in \a x (algorithm nlz10() at http://www.hackersdelight.org/). But note that the functions
   \ref floorPower2() or \ref ceilPower2() are more efficient and should be preferred when possible.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
NumericTraits<T>::Promote vigra::sq ( t)

The square function.

   <tt>sq(x) = x*x</tt> is needed so often that it makes sense to define it as a function.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
UInt32 sqrti ( Int32  v)

Signed integer square root.

   Useful for fast fixed-point computations.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra

Unsigned integer square root.

   Useful for fast fixed-point computations.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
T vigra::sign ( t)

The sign function.

   Returns 1, 0, or -1 depending on the sign of \a t, but with the same type as \a t.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
int vigra::signi ( t)

The integer sign function.

   Returns 1, 0, or -1 depending on the sign of \a t, converted to int.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
T1 vigra::sign ( T1  t1,
T2  t2 
)

The binary sign function.

   Transfers the sign of \a t2 to \a t1.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
bool vigra::even ( int  t)

Check if an integer is even.

   Defined for all integral types.
bool vigra::odd ( int  t)

Check if an integer is odd.

   Defined for all integral types.
NormTraits<T>::SquaredNormType vigra::squaredNorm ( T const &  t)

The squared norm of a numerical object.

   For scalar types: equals <tt>vigra::sq(t)</tt><br>.
   For vectorial types: equals <tt>vigra::dot(t, t)</tt><br>.
   For complex types: equals <tt>vigra::sq(t.real()) + vigra::sq(t.imag())</tt><br>.
   For matrix types: results in the squared Frobenius norm (sum of squares of the matrix elements).
NormTraits<T>::NormType vigra::norm ( T const &  t)

The norm of a numerical object.

   For scalar types: implemented as <tt>abs(t)</tt><br>
   otherwise: implemented as <tt>sqrt(squaredNorm(t))</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
void vigra::symmetric2x2Eigenvalues ( a00,
a01,
a11,
T *  r0,
T *  r1 
)

Compute the eigenvalues of a 2x2 real symmetric matrix.

   This uses the analytical eigenvalue formula 

\[ \lambda_{1,2} = \frac{1}{2}\left(a_{00} + a_{11} \pm \sqrt{(a_{00} - a_{11})^2 + 4 a_{01}^2}\right) \]

  <b>\#include</b> \<vigra/mathutil.hxx\><br>
  Namespace: vigra
void vigra::symmetric3x3Eigenvalues ( a00,
a01,
a02,
a11,
a12,
a22,
T *  r0,
T *  r1,
T *  r2 
)

Compute the eigenvalues of a 3x3 real symmetric matrix.

   This uses a numerically stable version of the analytical eigenvalue formula according to
   <p>
   David Eberly: <a href="http://www.geometrictools.com/Documentation/EigenSymmetric3x3.pdf">
   <em>"Eigensystems for 3 × 3 Symmetric Matrices (Revisited)"</em></a>, Geometric Tools Documentation, 2006

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::ellipticIntegralF ( double  x,
double  k 
)

The incomplete elliptic integral of the first kind.

   Computes

\[ \mbox{F}(x, k) = \int_0^x \frac{1}{\sqrt{1 - k^2 \sin(t)^2}} dt \]

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

  Note: In some libraries (e.g. Mathematica), the second parameter of the elliptic integral
  functions must be k^2 rather than k. Check the documentation when results disagree!

  <b>\#include</b> \<vigra/mathutil.hxx\><br>
  Namespace: vigra
double vigra::ellipticIntegralE ( double  x,
double  k 
)

The incomplete elliptic integral of the second kind.

   Computes

\[ \mbox{E}(x, k) = \int_0^x \sqrt{1 - k^2 \sin(t)^2} dt \]

  according to the algorithm given in Press et al. "Numerical Recipes". The
  complete elliptic integral of the second kind is simply <tt>ellipticIntegralE(M_PI/2, k)</TT>.

  Note: In some libraries (e.g. Mathematica), the second parameter of the elliptic integral
  functions must be k^2 rather than k. Check the documentation when results disagree!

  <b>\#include</b> \<vigra/mathutil.hxx\><br>
  Namespace: vigra
double vigra::chi2 ( unsigned int  degreesOfFreedom,
double  arg,
double  accuracy = 1e-7 
)

Chi square distribution.

   Computes the density of a chi square distribution with \a degreesOfFreedom 
   and tolerance \a accuracy at the given argument \a arg
   by calling <tt>noncentralChi2(degreesOfFreedom, 0.0, arg, accuracy)</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::chi2CDF ( unsigned int  degreesOfFreedom,
double  arg,
double  accuracy = 1e-7 
)

Cumulative chi square distribution.

   Computes the cumulative density of a chi square distribution with \a degreesOfFreedom 
   and tolerance \a accuracy at the given argument \a arg, i.e. the probability that
   a random number drawn from the distribution is below \a arg
   by calling <tt>noncentralChi2CDF(degreesOfFreedom, 0.0, arg, accuracy)</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::noncentralChi2 ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg,
double  accuracy = 1e-7 
)

Non-central chi square distribution.

   Computes the density of a non-central chi square distribution with \a degreesOfFreedom, 
   noncentrality parameter \a noncentrality and tolerance \a accuracy at the given argument 
   \a arg. It uses Algorithm AS 231 from Appl. Statist. (1987) Vol.36, No.3 (code ported from 
   http://lib.stat.cmu.edu/apstat/231). The algorithm has linear complexity in the number of
   degrees of freedom.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::noncentralChi2CDF ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg,
double  accuracy = 1e-7 
)

Cumulative non-central chi square distribution.

   Computes the cumulative density of a chi square distribution with \a degreesOfFreedom, 
   noncentrality parameter \a noncentrality and tolerance \a accuracy at the given argument 
   \a arg, i.e. the probability that a random number drawn from the distribution is below \a arg
   It uses Algorithm AS 231 from Appl. Statist. (1987) Vol.36, No.3 (code ported from 
   http://lib.stat.cmu.edu/apstat/231). The algorithm has linear complexity in the number of
   degrees of freedom (see noncentralChi2CDFApprox() for a constant-time algorithm).

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::noncentralChi2CDFApprox ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg 
)

Cumulative non-central chi square distribution (approximate).

   Computes approximate values of the cumulative density of a chi square distribution with \a degreesOfFreedom, 
   and noncentrality parameter \a noncentrality at the given argument 
   \a arg, i.e. the probability that a random number drawn from the distribution is below \a arg
   It uses the approximate transform into a normal distribution due to Wilson and Hilferty 
   (see Abramovitz, Stegun: "Handbook of Mathematical Functions", formula 26.3.32). 
   The algorithm's running time is independent of the inputs, i.e. is should be used
   when noncentralChi2CDF() is too slow, and approximate values are sufficient. The accuracy is only 
   about 0.1 for few degrees of freedom, but reaches about 0.001 above dof = 5.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
REAL vigra::legendre ( unsigned int  l,
int  m,
REAL  x 
)

Associated Legendre polynomial.

   Computes the value of the associated Legendre polynomial of order <tt>l, m</tt> 
   for argument <tt>x</tt>. <tt>x</tt> must be in the range <tt>[-1.0, 1.0]</tt>, 
   otherwise an exception is thrown. The standard Legendre polynomials are the 
   special case <tt>m == 0</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
REAL vigra::legendre ( unsigned int  l,
REAL  x 
)

Legendre polynomial.

   Computes the value of the Legendre polynomial of order <tt>l</tt> for argument <tt>x</tt>.
   <tt>x</tt> must be in the range <tt>[-1.0, 1.0]</tt>, otherwise an exception is thrown.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
REAL vigra::sin_pi ( REAL  x)

sin(pi*x).

   Essentially calls <tt>std::sin(M_PI*x)</tt> but uses a more accurate implementation
   to make sure that <tt>sin_pi(1.0) == 0.0</tt> (which does not hold for
   <tt>std::sin(M_PI)</tt> due to round-off error), and <tt>sin_pi(0.5) == 1.0</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
REAL vigra::cos_pi ( REAL  x)

cos(pi*x).

   Essentially calls <tt>std::cos(M_PI*x)</tt> but uses a more accurate implementation
   to make sure that <tt>cos_pi(1.0) == -1.0</tt> and <tt>cos_pi(0.5) == 0.0</tt>.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::gamma ( double  x)

The gamma function.

   This function implements the algorithm from<br>
   Zhang and Jin: "Computation of Special Functions", John Wiley and Sons, 1996.

   The argument must be <= 171.0 and cannot be zero or a negative integer. An
   exception is thrown when these conditions are violated.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
double vigra::loggamma ( double  x)

The natural logarithm of the gamma function.

   This function is based on a free implementation by Sun Microsystems, Inc., see
   <a href="http://www.sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/newlib/libm/mathfp/er_lgamma.c?rev=1.6&content-type=text/plain&cvsroot=src">sourceware.org</a> archive. It can be removed once all compilers support the new C99
   math functions.

   The argument must be positive and < 1e30. An exception is thrown when these conditions are violated.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
bool vigra::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 \a epsilon is not given,
   twice the machine epsilon is used.

   <b>\#include</b> \<vigra/mathutil.hxx\><br>
   Namespace: vigra
void vigra::convexHull ( const PointArray1 &  points,
PointArray2 &  convex_hull 
)

Compute convex hull of a 2D polygon.

The input array points contains a (not necessarily ordered) set of 2D points whose convex hull is to be computed. The array's value_type (i.e. the point type) must be compatible with std::vector (in particular, it must support indexing, copying, and have size() == 2). The points of the convex hull will be appended to the output array convex_hull (which must support std::back_inserter(convex_hull)). Since the convex hull is a closed polygon, the first and last point of the output will be the same (i.e. the first point will simply be inserted at the end again). The points of the convex hull will be ordered counter-clockwise, starting with the leftmost point of the input. The function implements Andrew's Monotone Chain algorithm.

IntType vigra::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 vigra::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

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

function (functor) call

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.8.0 (Wed Sep 26 2012)