random.hpp File Reference

Miscellaneous math random-related routines. More...

Include dependency graph for random.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Namespaces | |

mlpack | |

Linear algebra utility functions, generally performed on matrices or vectors. | |

mlpack::math | |

Miscellaneous math routines. | |

## Functions | |

void | CustomRandomSeed (const size_t seed) |

void | FixedRandomSeed () |

Set the random seed to a fixed number. More... | |

void | ObtainDistinctSamples (const size_t loInclusive, const size_t hiExclusive, const size_t maxNumSamples, arma::uvec &distinctSamples) |

Obtains no more than maxNumSamples distinct samples. More... | |

double | RandBernoulli (const double input) |

Generates a 0/1 specified by the input. More... | |

int | RandInt (const int hiExclusive) |

Generates a uniform random integer. More... | |

int | RandInt (const int lo, const int hiExclusive) |

Generates a uniform random integer. More... | |

double | RandNormal () |

Generates a normally distributed random number with mean 0 and variance 1. More... | |

double | RandNormal (const double mean, const double variance) |

Generates a normally distributed random number with specified mean and variance. More... | |

double | Random () |

Generates a uniform random number between 0 and 1. More... | |

double | Random (const double lo, const double hi) |

Generates a uniform random number in the specified range. More... | |

void | RandomSeed (const size_t seed) |

Set the random seed used by the random functions (Random() and RandInt()). More... | |

## Variables | |

MLPACK_EXPORT std::mt19937 | randGen |

MLPACK_EXPORT is required for global variables; it exports the symbols correctly on Windows. More... | |

MLPACK_EXPORT std::normal_distribution | randNormalDist |

MLPACK_EXPORT std::uniform_real_distribution | randUniformDist |

Miscellaneous math random-related routines.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Definition in file random.hpp.