Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
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... | |
rng & | operator= (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 |
Pseudo random number generator.
typedef std::vector<unsigned char> mygsl::rng::state_buffer_type |
mygsl::rng::rng | ( | ) |
Default constructor.
mygsl::rng::rng | ( | int32_t | seed_, |
bool | init_now_ = true |
||
) |
Constructor from a seed.
mygsl::rng::rng | ( | const std::string & | id_, |
int32_t | seed_, | ||
bool | init_now_ = true |
||
) |
Constructor from a GSL PRNG id and a seed.
mygsl::rng::rng | ( | const rng & | ) |
|
virtual |
Destructor.
unsigned long int mygsl::rng::bernoulli | ( | double | p_ = 0.5 | ) |
unsigned long int mygsl::rng::binomial | ( | double | p_, |
unsigned long int | n_ | ||
) |
double mygsl::rng::chisquare | ( | double | nu_ = 1.0 | ) |
void mygsl::rng::clear | ( | ) |
|
static |
void mygsl::rng::dump | ( | std::ostream & | = std::clog | ) | const |
Raw print.
double mygsl::rng::exponential | ( | double | sigma_ = 1.0 | ) |
double mygsl::rng::flat | ( | double | a_, |
double | b_ | ||
) |
void mygsl::rng::from_buffer | ( | const state_buffer_type & | ) |
void mygsl::rng::from_stream | ( | std::istream & | ) |
double mygsl::rng::gaussian | ( | double | sigma_ = 1.0 | ) |
double mygsl::rng::gaussian | ( | double | mu_, |
double | sigma_ | ||
) |
double mygsl::rng::gaussian_tail | ( | double | min_, |
double | sigma_ = 1.0 |
||
) |
unsigned long int mygsl::rng::get | ( | ) |
const std::string& mygsl::rng::get_id | ( | ) | const |
size_t mygsl::rng::get_internal_state_size | ( | ) | const |
datatools::logger::priority mygsl::rng::get_logging_priority | ( | ) | const |
Return the logging priority.
int32_t mygsl::rng::get_seed | ( | ) | const |
bool mygsl::rng::has_tracker | ( | ) | const |
void mygsl::rng::init | ( | const std::string & | id_, |
int32_t | seed_ = 0 |
||
) |
void mygsl::rng::initialize | ( | ) |
void mygsl::rng::initialize | ( | int32_t | seed_ | ) |
void mygsl::rng::initialize | ( | const std::string & | id_, |
int32_t | seed_ = 0 |
||
) |
void mygsl::rng::initialize | ( | const datatools::properties & | config_ | ) |
|
static |
bool mygsl::rng::is_id_valid | ( | ) | const |
bool mygsl::rng::is_initialized | ( | ) | const |
bool mygsl::rng::is_seed_invalid | ( | ) | const |
bool mygsl::rng::is_seed_time | ( | ) | const |
|
static |
bool mygsl::rng::is_seed_valid | ( | ) | const |
void mygsl::rng::load | ( | const std::string & | filename_ | ) |
unsigned long int mygsl::rng::max | ( | ) | const |
unsigned long int mygsl::rng::min | ( | ) | const |
std::string mygsl::rng::name | ( | ) | const |
Return the name/ID of the embedded GSL PRNG.
double mygsl::rng::operator() | ( | void | ) |
unsigned long int mygsl::rng::poisson | ( | double | mu_ | ) |
|
static |
void mygsl::rng::reset | ( | ) |
Reset.
void mygsl::rng::reset_tracker | ( | ) |
void mygsl::rng::set_id | ( | const std::string & | id_ = "" | ) |
void mygsl::rng::set_logging_priority | ( | datatools::logger::priority | ) |
Set the logging priority.
void mygsl::rng::set_seed | ( | int32_t | seed_ = 0 | ) |
void mygsl::rng::set_tracker | ( | const std::string & | filename_ | ) |
void mygsl::rng::set_trunc | ( | int | ) |
void mygsl::rng::store | ( | const std::string & | filename_ | ) | const |
void mygsl::rng::to_buffer | ( | state_buffer_type & | ) | const |
void mygsl::rng::to_stream | ( | std::ostream & | ) | const |
|
inline |
|
inline |
double mygsl::rng::uniform | ( | ) |
Shoot a real between 0 and 1.
unsigned long int mygsl::rng::uniform_int | ( | unsigned long int | n_ | ) |
double mygsl::rng::uniform_pos | ( | ) |
Shoot a real between 0 (excluded) and 1.
|
static |
|
static |