Chebyshev
Unit testing for scientific software
random.h File Reference

The pseudorandom number generation and sampling module. More...

#include <cstdlib>
#include "../prec/interval.h"

Go to the source code of this file.

Classes

class  chebyshev::random::random_settings
 

Namespaces

 chebyshev
 General namespace of the framework.
 
 chebyshev::random
 Pseudorandom number generation and sampling module.
 

Functions

void chebyshev::random::setup (uint64_t seed=0)
 Initialize the random module.
 
uint64_t chebyshev::random::natural ()
 Generate a random natural number.
 
long double chebyshev::random::uniform (long double a, long double b)
 Generate a uniformly distributed random number. More...
 
template<typename Vector >
Vector & chebyshev::random::sample_uniform (Vector &x, const std::vector< prec::interval > intervals)
 Fill an already allocated vector with uniformly distributed numbers over different intervals. More...
 
std::string chebyshev::random::string (size_t length)
 Generate a random string made of human-readable ASCII characters. More...
 
std::string chebyshev::random::string (size_t length, std::string alphabet)
 Generate a random string made of the elements of the given alphabet. More...
 
std::string chebyshev::random::string (size_t length, std::vector< char > alphabet)
 Generate a random string made of the elements of the given alphabet. More...
 
template<typename T >
std::vector< T > chebyshev::random::string (size_t length, std::vector< T > alphabet)
 Generate a random string made of the elements of the given alphabet, of arbitrary type. More...
 

Variables

struct chebyshev::random::random_settings chebyshev::random::settings
 

Detailed Description

The pseudorandom number generation and sampling module.