Integer uniform distribution. More...
#include <itpp/base/random.h>
Public Member Functions | |
I_Uniform_RNG (int min=0, int max=1) | |
constructor. Sets min and max values. More... | |
void | setup (int min, int max) |
set min and max values More... | |
void | get_setup (int &min, int &max) const |
get the parameters More... | |
int | operator() () |
Get one sample. More... | |
ivec | operator() (int n) |
Get a sample vector. More... | |
imat | operator() (int h, int w) |
Get a sample matrix. More... | |
int | sample () |
Return a single value from this random generator. More... | |
Integer uniform distribution.
Example: Generation of random uniformly distributed integers in the interval [0,10].
itpp::I_Uniform_RNG::I_Uniform_RNG | ( | int | min = 0 , |
int | max = 1 |
||
) |
constructor. Sets min and max values.
Definition at line 290 of file random.cpp.
References itpp::max(), itpp::min(), and setup().
void itpp::I_Uniform_RNG::setup | ( | int | min, |
int | max | ||
) |
set min and max values
Definition at line 295 of file random.cpp.
References itpp::max(), and itpp::min().
Referenced by I_Uniform_RNG(), and itpp::randi().
void itpp::I_Uniform_RNG::get_setup | ( | int & | min, |
int & | max | ||
) | const |
get the parameters
Definition at line 307 of file random.cpp.
References itpp::max(), and itpp::min().
|
inline |
ivec itpp::I_Uniform_RNG::operator() | ( | int | n | ) |
imat itpp::I_Uniform_RNG::operator() | ( | int | h, |
int | w | ||
) |
|
inline |
Return a single value from this random generator.
Definition at line 338 of file random.h.
References itpp::floor_i().
Referenced by operator()().
Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.4