VIGRA - VIGRA: Functions for FixedPoint

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

| Functions for FixedPoint |

#include <vigra/fixedpoint.hxx>
More...

## Functions
template<unsigned IntBits, unsigned FracBits>
FixedPoint< IntBits, FracBits > | abs (FixedPoint< IntBits, FracBits > v)
| absolute value.
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void | add (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
| addition with enforced result type.
template<unsigned IntBits, unsigned FracBits>
int | ceil (FixedPoint< IntBits, FracBits > v)
| rounding up.
template<unsigned IntBits, unsigned FracBits>
FixedPoint< 0, FracBits > | dual_frac (FixedPoint< IntBits, FracBits > v)
| dual fractional part: `1 - frac(v)`.
template<class TARGET, unsigned IntBits, unsigned FracBits>
TARGET | fixed_point_cast (FixedPoint< IntBits, FracBits > v)
template<unsigned IntBits, unsigned FracBits>
int | floor (FixedPoint< IntBits, FracBits > v)
| rounding down.
template<unsigned IntBits, unsigned FracBits>
FixedPoint< 0, FracBits > | frac (FixedPoint< IntBits, FracBits > v)
| fractional part.
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void | mul (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
| multiplication with enforced result type.
template<unsigned IntBits, unsigned FracBits>
FixedPoint< IntBits, FracBits > | norm (FixedPoint< IntBits, FracBits > const &v)
| norm (same as abs).
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator!= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| not equal
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint < IntBits1, FracBits1 > , FixedPoint< IntBits2, FracBits2 > >::MultipliesType | operator* (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| multiplication with automatic determination of the appropriate result type.
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint < IntBits1, FracBits1 > , FixedPoint< IntBits2, FracBits2 > >::PlusType | operator+ (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| addition with automatic determination of the appropriate result type.
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint < IntBits1, FracBits1 > , FixedPoint< IntBits2, FracBits2 > >::MinusType | operator- (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| subtraction with automatic determination of the appropriate result type.
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator< (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| less than
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator<= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| less or equal
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator== (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| equal
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator> (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| greater
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool | operator>= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
| greater or equal
template<unsigned IntBits, unsigned FracBits>
int | round (FixedPoint< IntBits, FracBits > v)
| rounding to the nearest integer.
template<unsigned IntBits, unsigned FracBits>
SquareRootTraits< FixedPoint < IntBits, FracBits > >::SquareRootResult | sqrt (FixedPoint< IntBits, FracBits > v)
| square root.
template<unsigned IntBits, unsigned FracBits>
FixedPointTraits< FixedPoint < IntBits, FracBits > , FixedPoint< IntBits, FracBits > >::MultipliesType | squaredNorm (FixedPoint< IntBits, FracBits > v)
| squared norm (same as v*v).
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void | sub (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
| subtraction with enforced result type.

## Detailed Description

#include <vigra/fixedpoint.hxx>

These functions fulfill the requirements of an AlgebraicRing.

Namespace: vigra

## Function Documentation

template<class TARGET, unsigned IntBits, unsigned FracBits>
TARGET vigra::fixed_point_cast | ( | FixedPoint< IntBits, FracBits > | v | ) |

Convert a FixedPoint to a built-in type. If the target is integral, the value is rounded.
Usage:

            FixedPoint<16,15> fp(...);

            double d = fixed_point_cast<double>(fp);

© 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.6.0 (13 Aug 2008)