Static Public Member Functions | List of all members
PLMD::maze::rnd Class Reference

Mersenne Twister sampler for random variables. More...

#include "maze/Random_MT.h"

Static Public Member Functions

static std::mt19937_64 & mt_eng ()
 Initialize MT sampler engine based on std::mt19937_64. More...
 
static double next_cauchy (double m, double s)
 Returns a random double from the Cauchy distribution. More...
 
static double next_double ()
 
static double next_double (double e)
 
static double next_double (double f, double e)
 Returns a random double from the uniform distribution from a [f, e) range. More...
 
static std::vector< double > next_double (double f, double e, std::size_t n)
 Returns a random vector<double> from the uniform distribution from a [f, e) range of length n. More...
 
static int next_int (int e)
 
static int next_int (int f, int e)
 Returns a random int from the uniform distribution from a [f, e) range. More...
 
static Vector next_plmd_vector ()
 Returns a random PLMD::Vector of length r. More...
 
static Vector next_plmd_vector (double r)
 
static std::vector< double > next_std_vector ()
 Returns a random std::vector of length r. More...
 
static std::vector< double > next_std_vector (double r)
 
static void randomize ()
 Feed a random seed. More...
 

Detailed Description

Mersenne Twister sampler for random variables.

Supports generating integers, doubles, and std::vectors and PLMD::Vectors within a given range.

Member Function Documentation

◆ mt_eng()

std::mt19937_64 & PLMD::maze::rnd::mt_eng ( )
static

Initialize MT sampler engine based on std::mt19937_64.

◆ next_cauchy()

double PLMD::maze::rnd::next_cauchy ( double  m,
double  s 
)
static

Returns a random double from the Cauchy distribution.

Parameters
mmean
sspread

◆ next_double() [1/4]

double PLMD::maze::rnd::next_double ( )
static

◆ next_double() [2/4]

double PLMD::maze::rnd::next_double ( double  e)
inlinestatic

◆ next_double() [3/4]

double PLMD::maze::rnd::next_double ( double  f,
double  e 
)
static

Returns a random double from the uniform distribution from a [f, e) range.

◆ next_double() [4/4]

static std::vector<double> PLMD::maze::rnd::next_double ( double  f,
double  e,
std::size_t  n 
)
static

Returns a random vector<double> from the uniform distribution from a [f, e) range of length n.

◆ next_int() [1/2]

int PLMD::maze::rnd::next_int ( int  e)
static

◆ next_int() [2/2]

int PLMD::maze::rnd::next_int ( int  f,
int  e 
)
static

Returns a random int from the uniform distribution from a [f, e) range.

Parameters
fbegin
eend

◆ next_plmd_vector() [1/2]

Vector PLMD::maze::rnd::next_plmd_vector ( )
inlinestatic

Returns a random PLMD::Vector of length r.

◆ next_plmd_vector() [2/2]

Vector PLMD::maze::rnd::next_plmd_vector ( double  r)
inlinestatic

◆ next_std_vector() [1/2]

std::vector< double > PLMD::maze::rnd::next_std_vector ( )
inlinestatic

Returns a random std::vector of length r.

◆ next_std_vector() [2/2]

std::vector< double > PLMD::maze::rnd::next_std_vector ( double  r)
inlinestatic

◆ randomize()

void PLMD::maze::rnd::randomize ( )
inlinestatic

Feed a random seed.


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