SG++-Doxygen-Documentation
sgpp::quadrature::Random Class Reference

Wraps the random generator to use. More...

#include <Random.hpp>

Static Public Member Functions

static double random_double ()
 returns a random double value in [0, 1) More...
 
static std::uint64_t random_uint64 ()
 returns a random integer value in [0, RAND_MAX) More...
 
static void seed (std::uint64_t seed_value=std::mt19937_64::default_seed)
 Manually seed the generator with a given seed. More...
 

Static Protected Attributes

static std::uniform_int_distribution< std::uint64_t > distInt
 
static std::uniform_real_distribution< double > distReal
 
static std::mt19937_64 gen = std::mt19937_64()
 
static bool is_seeded = false
 

Detailed Description

Wraps the random generator to use.

Ensures that it is is seeded correctly.

Member Function Documentation

◆ random_double()

double sgpp::quadrature::Random::random_double ( )
static

returns a random double value in [0, 1)

References distReal, gen, is_seeded, and seed().

◆ random_uint64()

std::uint64_t sgpp::quadrature::Random::random_uint64 ( )
static

returns a random integer value in [0, RAND_MAX)

References distInt, gen, is_seeded, and seed().

◆ seed()

void sgpp::quadrature::Random::seed ( std::uint64_t  seed_value = std::mt19937_64::default_seed)
static

Manually seed the generator with a given seed.

Parameters
seed_valuethe seed to use.

References gen, and is_seeded.

Referenced by random_double(), and random_uint64().

Member Data Documentation

◆ distInt

std::uniform_int_distribution< std::uint64_t > sgpp::quadrature::Random::distInt
staticprotected
Initial value:
=
std::uniform_int_distribution<std::uint64_t>(0, RAND_MAX)

Referenced by random_uint64().

◆ distReal

std::uniform_real_distribution< double > sgpp::quadrature::Random::distReal
staticprotected
Initial value:
=
std::uniform_real_distribution<double>(0, 1)

Referenced by random_double().

◆ gen

std::mt19937_64 sgpp::quadrature::Random::gen = std::mt19937_64()
staticprotected

Referenced by random_double(), random_uint64(), and seed().

◆ is_seeded

bool sgpp::quadrature::Random::is_seeded = false
staticprotected

Referenced by random_double(), random_uint64(), and seed().


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