Image Component Library (ICL)
Classes | Namespaces | Functions
Random.h File Reference
#include <ICLUtils/CompatMacros.h>
#include <ICLUtils/Time.h>
#include <ICLUtils/Range.h>
#include <ICLUtils/Exception.h>
#include <ICLUtils/ClippedCast.h>
#include <cmath>
#include <cstdlib>
#include <vector>

Go to the source code of this file.

Classes

struct  icl::utils::RandomSeeder
 Object based random seed caller. More...
 
class  icl::utils::URand
 lightweight Random generator class for uniform random distributions More...
 
class  icl::utils::URandI
 lightweight Random generator class for uniform random distributions in positive integer domain More...
 
class  icl::utils::GRand
 lightweight Random generator class for gaussian distributed numbers More...
 
class  icl::utils::GRandClip
 lightweight Random generator class for gaussian distributed numbers clipped to a given range More...
 

Namespaces

 icl
 undocument this line if you encounter any issues!
 
 icl::utils
 

Functions

void icl::utils::randomSeed (long int seedval)
 Initilaize the random number generator. More...
 
void icl::utils::randomSeed ()
 Initilaize the random number generator (with Time::now().toMicroSeconds()). More...
 
double icl::utils::random (double max=1)
 Generates random numbers in range [0,1]. More...
 
double icl::utils::random (double min, double max)
 Generate a random number in range [min,max]. More...
 
template<class T >
double icl::utils::random (const Range< T > &r)
 equivalent to random (r.minVal,r.maxVal) More...
 
unsigned int icl::utils::random (unsigned int max)
 Creates a non-negative random number in range [0,max]. More...
 
ICLUtils_API double icl::utils::gaussRandom (double mean, double var)
 Generate a gaussian random number with given mean and variance. More...
 
double icl::utils::gaussRandom (double mean, double var, const Range< double > &range)
 Generate a gaussian random number with given mean and variance and clips the result to a range. More...
 
std::vector< int > icl::utils::get_random_index_subset (int containerSize, int subsetSize)
 
template<class T >
std::vector< T > icl::utils::get_random_subset (const std::vector< T > &s, int subsetSize)
 
template<class T >
void icl::utils::get_random_subset (const std::vector< T > &s, int subsetSize, std::vector< T > &subset)
 
template<class T >
void icl::utils::get_random_subset (const std::vector< T > &s, int subsetSize, std::vector< T > &subset, std::vector< int > &indices)