Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mygsl::rng Class Reference

Pseudo random number generator. More...

#include <bayeux/mygsl/rng.h>

Public Types

typedef std::vector< unsigned char > state_buffer_type
 

Public Member Functions

 rng ()
 Default constructor. More...
 
 rng (int32_t seed_, bool init_now_=true)
 Constructor from a seed. More...
 
 rng (const std::string &id_, int32_t seed_, bool init_now_=true)
 Constructor from a GSL PRNG id and a seed. More...
 
 rng (const rng &)
 
virtual ~rng ()
 Destructor. More...
 
rngoperator= (const rng &)
 
bool is_initialized () const
 
void initialize ()
 
void initialize (int32_t seed_)
 
void initialize (const std::string &id_, int32_t seed_=0)
 
void initialize (const datatools::properties &config_)
 
void init (const std::string &id_, int32_t seed_=0)
 
void reset ()
 Reset. More...
 
void clear ()
 
bool is_seed_invalid () const
 
bool is_seed_valid () const
 
bool is_seed_time () const
 
bool is_id_valid () const
 
int32_t get_seed () const
 
void set_seed (int32_t seed_=0)
 
const std::string & get_id () const
 
void set_id (const std::string &id_="")
 
void set_trunc (int)
 
bool has_tracker () const
 
void set_tracker (const std::string &filename_)
 
void reset_tracker ()
 
template<class Type >
void tracker_tag (const std::string &tag_)
 
template<class Type >
void tracker_tag (const std::string &tag_, const Type &value_)
 
void dump (std::ostream &=std::clog) const
 Raw print. More...
 
unsigned long int get ()
 
double uniform ()
 Shoot a real between 0 and 1. More...
 
double uniform_pos ()
 Shoot a real between 0 (excluded) and 1. More...
 
unsigned long int uniform_int (unsigned long int n_)
 
std::string name () const
 Return the name/ID of the embedded GSL PRNG. More...
 
unsigned long int min () const
 
unsigned long int max () const
 
void store (const std::string &filename_) const
 
void load (const std::string &filename_)
 
void to_stream (std::ostream &) const
 
void from_stream (std::istream &)
 
void to_buffer (state_buffer_type &) const
 
void from_buffer (const state_buffer_type &)
 
size_t get_internal_state_size () const
 
double flat (double a_, double b_)
 
double gaussian (double sigma_=1.0)
 
double gaussian (double mu_, double sigma_)
 
double gaussian_tail (double min_, double sigma_=1.0)
 
double exponential (double sigma_=1.0)
 
double chisquare (double nu_=1.0)
 
unsigned long int poisson (double mu_)
 
unsigned long int bernoulli (double p_=0.5)
 
unsigned long int binomial (double p_, unsigned long int n_)
 
double operator() (void)
 
datatools::logger::priority get_logging_priority () const
 Return the logging priority. More...
 
void set_logging_priority (datatools::logger::priority)
 Set the logging priority. More...
 

Static Public Member Functions

static void default_setup ()
 
static void print_dict (std::ostream &)
 
static bool is_id_valid (const std::string &id_)
 
static bool is_seed_valid (int32_t seed_)
 

Static Public Attributes

static const std::string DEFAULT_RNG_ID
 
static const std::string DEFAULT_RNG_TYPE
 

Detailed Description

Pseudo random number generator.

Member Typedef Documentation

◆ state_buffer_type

typedef std::vector<unsigned char> mygsl::rng::state_buffer_type

Constructor & Destructor Documentation

◆ rng() [1/4]

mygsl::rng::rng ( )

Default constructor.

◆ rng() [2/4]

mygsl::rng::rng ( int32_t  seed_,
bool  init_now_ = true 
)

Constructor from a seed.

◆ rng() [3/4]

mygsl::rng::rng ( const std::string &  id_,
int32_t  seed_,
bool  init_now_ = true 
)

Constructor from a GSL PRNG id and a seed.

◆ rng() [4/4]

mygsl::rng::rng ( const rng )

◆ ~rng()

virtual mygsl::rng::~rng ( )
virtual

Destructor.

Member Function Documentation

◆ bernoulli()

unsigned long int mygsl::rng::bernoulli ( double  p_ = 0.5)

◆ binomial()

unsigned long int mygsl::rng::binomial ( double  p_,
unsigned long int  n_ 
)

◆ chisquare()

double mygsl::rng::chisquare ( double  nu_ = 1.0)

◆ clear()

void mygsl::rng::clear ( )

◆ default_setup()

static void mygsl::rng::default_setup ( )
static

◆ dump()

void mygsl::rng::dump ( std::ostream &  = std::clog) const

Raw print.

◆ exponential()

double mygsl::rng::exponential ( double  sigma_ = 1.0)

◆ flat()

double mygsl::rng::flat ( double  a_,
double  b_ 
)

◆ from_buffer()

void mygsl::rng::from_buffer ( const state_buffer_type )

◆ from_stream()

void mygsl::rng::from_stream ( std::istream &  )

◆ gaussian() [1/2]

double mygsl::rng::gaussian ( double  sigma_ = 1.0)

◆ gaussian() [2/2]

double mygsl::rng::gaussian ( double  mu_,
double  sigma_ 
)

◆ gaussian_tail()

double mygsl::rng::gaussian_tail ( double  min_,
double  sigma_ = 1.0 
)

◆ get()

unsigned long int mygsl::rng::get ( )

◆ get_id()

const std::string& mygsl::rng::get_id ( ) const

◆ get_internal_state_size()

size_t mygsl::rng::get_internal_state_size ( ) const

◆ get_logging_priority()

datatools::logger::priority mygsl::rng::get_logging_priority ( ) const

Return the logging priority.

◆ get_seed()

int32_t mygsl::rng::get_seed ( ) const

◆ has_tracker()

bool mygsl::rng::has_tracker ( ) const

◆ init()

void mygsl::rng::init ( const std::string &  id_,
int32_t  seed_ = 0 
)

◆ initialize() [1/4]

void mygsl::rng::initialize ( )

◆ initialize() [2/4]

void mygsl::rng::initialize ( int32_t  seed_)

◆ initialize() [3/4]

void mygsl::rng::initialize ( const std::string &  id_,
int32_t  seed_ = 0 
)

◆ initialize() [4/4]

void mygsl::rng::initialize ( const datatools::properties config_)

◆ is_id_valid() [1/2]

static bool mygsl::rng::is_id_valid ( const std::string &  id_)
static

◆ is_id_valid() [2/2]

bool mygsl::rng::is_id_valid ( ) const

◆ is_initialized()

bool mygsl::rng::is_initialized ( ) const

◆ is_seed_invalid()

bool mygsl::rng::is_seed_invalid ( ) const

◆ is_seed_time()

bool mygsl::rng::is_seed_time ( ) const

◆ is_seed_valid() [1/2]

static bool mygsl::rng::is_seed_valid ( int32_t  seed_)
static

◆ is_seed_valid() [2/2]

bool mygsl::rng::is_seed_valid ( ) const

◆ load()

void mygsl::rng::load ( const std::string &  filename_)

◆ max()

unsigned long int mygsl::rng::max ( ) const

◆ min()

unsigned long int mygsl::rng::min ( ) const

◆ name()

std::string mygsl::rng::name ( ) const

Return the name/ID of the embedded GSL PRNG.

◆ operator()()

double mygsl::rng::operator() ( void  )

◆ operator=()

rng& mygsl::rng::operator= ( const rng )

◆ poisson()

unsigned long int mygsl::rng::poisson ( double  mu_)

◆ print_dict()

static void mygsl::rng::print_dict ( std::ostream &  )
static

◆ reset()

void mygsl::rng::reset ( )

Reset.

◆ reset_tracker()

void mygsl::rng::reset_tracker ( )

◆ set_id()

void mygsl::rng::set_id ( const std::string &  id_ = "")

◆ set_logging_priority()

void mygsl::rng::set_logging_priority ( datatools::logger::priority  )

Set the logging priority.

◆ set_seed()

void mygsl::rng::set_seed ( int32_t  seed_ = 0)

◆ set_tracker()

void mygsl::rng::set_tracker ( const std::string &  filename_)

◆ set_trunc()

void mygsl::rng::set_trunc ( int  )

◆ store()

void mygsl::rng::store ( const std::string &  filename_) const

◆ to_buffer()

void mygsl::rng::to_buffer ( state_buffer_type ) const

◆ to_stream()

void mygsl::rng::to_stream ( std::ostream &  ) const

◆ tracker_tag() [1/2]

template<class Type >
void mygsl::rng::tracker_tag ( const std::string &  tag_)
inline

◆ tracker_tag() [2/2]

template<class Type >
void mygsl::rng::tracker_tag ( const std::string &  tag_,
const Type &  value_ 
)
inline

◆ uniform()

double mygsl::rng::uniform ( )

Shoot a real between 0 and 1.

◆ uniform_int()

unsigned long int mygsl::rng::uniform_int ( unsigned long int  n_)

◆ uniform_pos()

double mygsl::rng::uniform_pos ( )

Shoot a real between 0 (excluded) and 1.

Member Data Documentation

◆ DEFAULT_RNG_ID

const std::string mygsl::rng::DEFAULT_RNG_ID
static

◆ DEFAULT_RNG_TYPE

const std::string mygsl::rng::DEFAULT_RNG_TYPE
static

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