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

Base class for random (stochastic) sources. More...

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

## Public Member Functions

| Random_Generator ()
| Default constructor.
double | random_01 ()
| Return a uniformly distributed (0,1) value.
double | random_01_lclosed ()
| Return a uniformly distributed [0,1) value.
double | random_01_rclosed ()
| Return a uniformly distributed (0,1] value.
uint32_t | random_int ()
| Return a uniformly distributed [0, UINT_MAX) value.
uint32_t | genrand_uint32 ()
| Generate uniform [0, UINT_MAX) integer pseudorandom number.
double | genrand_close1_open2 ()
| Generate uniform [1, 2) double pseudorandom number.
double | genrand_close_open ()
| Generate uniform [0, 1) double pseudorandom number.
double | genrand_open_close ()
| Generate uniform (0, 1] double pseudorandom number.
double | genrand_open_open ()
| Generate uniform (0, 1) double pseudorandom number.

## Detailed Description

Base class for random (stochastic) sources.

Random_Generator provides thread-safe generation of pseudo-random numbers

See also
  DSFMT

Definition at line 171 of file random.h.

## Constructor & Destructor Documentation

## Random_Generator()

itpp::Random_Generator::Random_Generator | ( |  | ) |

inline

Default constructor.

Definition at line 176 of file random.h.

References itpp::GlobalRNG_get_local_seed(), itpp::random_details::lc_is_initialized(), and itpp::random_details::lc_mark_initialized().

## Member Function Documentation

## random_01()

double itpp::Random_Generator::random_01 | ( |  | ) |

inline

Return a uniformly distributed (0,1) value.

Definition at line 204 of file random.h.

## random_01_lclosed()

double itpp::Random_Generator::random_01_lclosed | ( |  | ) |

inline

Return a uniformly distributed [0,1) value.

Definition at line 206 of file random.h.

## random_01_rclosed()

double itpp::Random_Generator::random_01_rclosed | ( |  | ) |

inline

Return a uniformly distributed (0,1] value.

Definition at line 208 of file random.h.

## random_int()

uint32_t itpp::Random_Generator::random_int | ( |  | ) |

inline

Return a uniformly distributed [0, UINT_MAX) value.

Definition at line 210 of file random.h.

## genrand_uint32()

uint32_t itpp::Random_Generator::genrand_uint32 | ( |  | ) |

inline

Generate uniform [0, UINT_MAX) integer pseudorandom number.

Definition at line 213 of file random.h.

Referenced by itpp::Normal_RNG::sample().

## genrand_close1_open2()

double itpp::Random_Generator::genrand_close1_open2 | ( |  | ) |

inline

Generate uniform [1, 2) double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range [1, 2). This is the primitive and faster than generating numbers in other ranges. `init_gen_rand()` must be called before this function.

Returns
  double precision floating point pseudorandom number

Definition at line 224 of file random.h.

## genrand_close_open()

double itpp::Random_Generator::genrand_close_open | ( |  | ) |

inline

Generate uniform [0, 1) double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range [0, 1). `init_gen_rand()` must be called before this function.

Returns
  double precision floating point pseudorandom number

Definition at line 234 of file random.h.

Referenced by itpp::Normal_RNG::sample(), and itpp::Gamma_RNG::sample().

## genrand_open_close()

double itpp::Random_Generator::genrand_open_close | ( |  | ) |

inline

Generate uniform (0, 1] double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1]. `init_gen_rand()` must be called before this function.

Returns
  double precision floating point pseudorandom number

Definition at line 244 of file random.h.

Referenced by itpp::Gamma_RNG::sample().

## genrand_open_open()

double itpp::Random_Generator::genrand_open_open | ( |  | ) |

inline

Generate uniform (0, 1) double pseudorandom number.

This function generates and returns double precision pseudorandom number which distributes uniformly in the range (0, 1). `init_gen_rand()` must be called before this function.

Returns
  double precision floating point pseudorandom number

Definition at line 254 of file random.h.

Referenced by itpp::Gamma_RNG::sample().

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

- itpp/base/random.h

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