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

Bernoulli distribution. More...

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

## Public Member Functions

| Bernoulli_RNG (double prob)
| Binary source with probability prob for a 1.
| Bernoulli_RNG ()
| Binary source with probability prob for a 1.
void | setup (double prob)
| set the probability
double | get_setup () const
| return the probability
bin | operator() ()
| Get one sample.
bvec | operator() (int n)
| Get a sample vector.
bmat | operator() (int h, int w)
| Get a sample matrix.
bin | sample ()
| Get a sample.
void | sample_vector (int size, bvec &out)
| Get a sample vector.
void | sample_matrix (int rows, int cols, bmat &out)
| Get a sample matrix.

## Detailed Description

Bernoulli distribution.

Definition at line 264 of file random.h.

## Constructor & Destructor Documentation

## Bernoulli_RNG() [1/2]

itpp::Bernoulli_RNG::Bernoulli_RNG | ( | double | prob | ) |

inline

Binary source with probability prob for a 1.

Definition at line 268 of file random.h.

## Bernoulli_RNG() [2/2]

itpp::Bernoulli_RNG::Bernoulli_RNG | ( |  | ) |

inline

Binary source with probability prob for a 1.

Definition at line 270 of file random.h.

## Member Function Documentation

## setup()

void itpp::Bernoulli_RNG::setup | ( | double | prob | ) |

inline

set the probability

Definition at line 272 of file random.h.

References it_assert.

## get_setup()

double itpp::Bernoulli_RNG::get_setup | ( |  | ) | const

inline

return the probability

Definition at line 278 of file random.h.

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

bin itpp::Bernoulli_RNG::operator() | ( |  | ) |

inline

Get one sample.

Definition at line 280 of file random.h.

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

bvec itpp::Bernoulli_RNG::operator() | ( | int | n | ) |

inline

Get a sample vector.

Definition at line 282 of file random.h.

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

bmat itpp::Bernoulli_RNG::operator() | ( | int | h,
|  | int | w
| ) |  |

inline

Get a sample matrix.

Definition at line 284 of file random.h.

## sample()

bin itpp::Bernoulli_RNG::sample | ( |  | ) |

inline

Get a sample.

Definition at line 286 of file random.h.

## sample_vector()

void itpp::Bernoulli_RNG::sample_vector | ( | int | size,
|  | bvec & | out
| ) |  |

inline

Get a sample vector.

Definition at line 288 of file random.h.

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

## sample_matrix()

void itpp::Bernoulli_RNG::sample_matrix | ( | int | rows,
|  | int | cols,
|  | bmat & | out
| ) |  |

inline

Get a sample matrix.

Definition at line 293 of file random.h.

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

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

- itpp/base/random.h

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