IT++ Logo
Public Member Functions | List of all members
itpp::I_Uniform_RNG Class Reference

Integer uniform distributionExample: Generation of random uniformly distributed integers in the interval [0,10]. More...

#include <itpp/base/random.h>

Public Member Functions

 I_Uniform_RNG (int min=0, int max=1)
 constructor. Sets min and max values.
 
void setup (int min, int max)
 set min and max values
 
void get_setup (int &min, int &max) const
 get the parameters
 
int operator() ()
 Get one sample.
 
ivec operator() (int n)
 Get a sample vector.
 
imat operator() (int h, int w)
 Get a sample matrix.
 
int sample ()
 Return a single value from this random generator.
 

Detailed Description

Integer uniform distribution

Example: Generation of random uniformly distributed integers in the interval [0,10].

#include "itpp/sigproc.h"
int main() {
I_Uniform_RNG gen(0, 10);
cout << gen() << endl; // prints a random integer
cout << gen(10) << endl; // prints 10 random integers
}

Definition at line 322 of file random.h.


The documentation for this class was generated from the following files:
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:31 for IT++ by Doxygen 1.8.2