Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
icl::utils::URand Class Reference

lightweight Random generator class for uniform random distributions More...

#include <Random.h>

List of all members.

Public Member Functions

 URand ()
 Range [0,1].
 URand (icl64f min, icl64f max)
 Given range.
 URand (const Range64f &range)
 Given range.
 operator icl64f () const
 returns random(this->min,this->max)

Private Attributes

Range64f range

Detailed Description

lightweight Random generator class for uniform random distributions

URand obeject can be used like 'normal double values'. Each time some other variable is assigned by it, it returns a random value. By this means, e.g. STL-containers can be filled/created with random numbers

        std::vector<double> foo(100,URand()); 
        std::fill(foo.begin(),foo.end(),URand(0,42));

But do not try to fill an Image with random numbers like this:

        Img64f image(Size::VGA,1);
        image.clearAllChannels(URand());

Here: URand is only evaluatet at the function interface, so the image is filled with a single random value;


Constructor & Destructor Documentation

Range [0,1].

icl::utils::URand::URand ( icl64f  min,
icl64f  max 
) [inline]

Given range.

icl::utils::URand::URand ( const Range64f &  range) [inline]

Given range.


Member Function Documentation

icl::utils::URand::operator icl64f ( ) const [inline]

returns random(this->min,this->max)


Member Data Documentation

Range64f icl::utils::URand::range [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines