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

| UniformRandomFunctor< Engine > Class Template Reference |

`#include <vigra/random.hxx>`

## Public Types

typedef double | result_type
| STL required functor result type.

## Public Member Functions

double | operator() () const
| UniformRandomFunctor (double lower, double upper, Engine &generator=Engine::global())
| UniformRandomFunctor (Engine const &generator=Engine::global())

## Detailed Description

### template<class Engine = MersenneTwister>
class vigra::UniformRandomFunctor< Engine >

Functor to create uniformly distributed double-precision random numbers.

This functor encapsulates the function `uniform()` of the given random number `Engine` (usually `RandomTT800` or `RandomMT19937`) in an STL-compatible interface.

Traits defined:

    FunctorTraits<UniformIntRandomFunctor<Engine> >::isInitializer

is true (`VigraTrueType`).

## Constructor & Destructor Documentation

## ◆ UniformRandomFunctor() [1/2]

UniformRandomFunctor | ( | Engine const & | generator = `Engine::global()` | ) |

Create functor for uniform random double-precision numbers in the range [0.0, 1.0] using the given engine.

That is, the generated numbers satisfy 0.0 <= i <= 1.0.

## ◆ UniformRandomFunctor() [2/2]

UniformRandomFunctor | ( | double | lower,
|  | double | upper,
|  | Engine & | generator = `Engine::global()`
| ) |  |

Create functor for uniform random double-precision numbers in the range [`lower`, `upper`] using the given engine.

That is, the generated numbers satisfy `lower` <= i <= `upper`.

## Member Function Documentation

## ◆ operator()()

double operator() | ( |  | ) | const

Return a random number as specified in the constructor.

The documentation for this class was generated from the following file:

- vigra/random.hxx

© 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.11.1