Image Component Library (ICL)
Public Member Functions | Private Attributes | List of all members
icl::utils::URand Class Reference

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

#include <Random.h>

Public Member Functions

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

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

◆ URand() [1/3]

icl::utils::URand::URand ( )
inline

Range [0,1].

◆ URand() [2/3]

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

Given range.

◆ URand() [3/3]

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

Given range.

Member Function Documentation

◆ operator icl64f()

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

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

Member Data Documentation

◆ range

Range64f icl::utils::URand::range
private

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