itpp::Uniform_RNG Class Reference
Base Module » Random Number Generation

Uniform distribution. More...

`#include <itpp/base/random.h>`

## Public Member Functions

| Uniform_RNG (double min=0, double max=1.0)
| Constructor. Set min, max and seed.
void | setup (double min, double max)
| set min and max
void | get_setup (double &min, double &max) const
| get parameters
double | operator() ()
| Get one sample.
vec | operator() (int n)
| Get a sample vector.
mat | operator() (int h, int w)
| Get a sample matrix.
double | sample ()
| Get a Uniformly distributed [0,1) sample.
void | sample_vector (int size, vec &out)
| Get a Uniformly distributed [0,1) vector.
void | sample_matrix (int rows, int cols, mat &out)
| Get a Uniformly distributed [0,1) matrix.

## Detailed Description

Uniform distribution.

Definition at line 354 of file random.h.

## Constructor & Destructor Documentation

## Uniform_RNG()

itpp::Uniform_RNG::Uniform_RNG | ( | double | min = `0`,
|  | double | max = `1.0`
| ) |  |

Constructor. Set min, max and seed.

Definition at line 339 of file random.cpp.

References itpp::max(), itpp::min(), and setup().

## Member Function Documentation

## setup()

void itpp::Uniform_RNG::setup | ( | double | min,
|  | double | max
| ) |  |

set min and max

Definition at line 344 of file random.cpp.

References itpp::max(), and itpp::min().

Referenced by Uniform_RNG().

## get_setup()

void itpp::Uniform_RNG::get_setup | ( | double & | min,
|  | double & | max
| ) |  | const

get parameters

Definition at line 356 of file random.cpp.

References itpp::max(), and itpp::min().

## operator()() [1/3]

double itpp::Uniform_RNG::operator() | ( |  | ) |

inline

Get one sample.

Definition at line 364 of file random.h.

## operator()() [2/3]

vec itpp::Uniform_RNG::operator() | ( | int | n | ) |

inline

Get a sample vector.

Definition at line 366 of file random.h.

## operator()() [3/3]

mat itpp::Uniform_RNG::operator() | ( | int | h,
|  | int | w
| ) |  |

inline

Get a sample matrix.

Definition at line 374 of file random.h.

## sample()

double itpp::Uniform_RNG::sample | ( |  | ) |

inline

Get a Uniformly distributed [0,1) sample.

Definition at line 382 of file random.h.

## sample_vector()

void itpp::Uniform_RNG::sample_vector | ( | int | size,
|  | vec & | out
| ) |  |

inline

Get a Uniformly distributed [0,1) vector.

Definition at line 384 of file random.h.

References itpp::Array< T >::set_size(), and itpp::Array< T >::size().

## sample_matrix()

void itpp::Uniform_RNG::sample_matrix | ( | int | rows,
|  | int | cols,
|  | mat & | out
| ) |  |

inline

Get a Uniformly distributed [0,1) matrix.

Definition at line 389 of file random.h.

References itpp::Array< T >::set_size().

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

- itpp/base/random.h
- itpp/base/random.cpp

Generated on Mon Jun 10 2024 11:49:41 for IT++ by Doxygen 1.9.8