31 #ifndef MYGSL_SEED_MANAGER_H 32 #define MYGSL_SEED_MANAGER_H 1 42 #include <boost/cstdint.hpp> 85 void get_labels (std::vector<std::string> & labels_)
const;
88 bool has_seed (
const std::string & label_)
const;
91 void add_seed (
const std::string & label_, int32_t seed_);
94 int32_t
get_seed (
const std::string & label_)
const;
97 void update_seed (
const std::string & label_, int32_t seed_);
133 size_t size ()
const;
146 void dump (std::ostream &)
const;
159 void _set_seed(
const std::string & label_, int32_t seed_);
162 void _set_init_seed_flags_();
165 uint32_t _init_seed_flags_;
166 typedef std::map<std::string, int32_t> dict_type;
176 #endif // MYGSL_SEED_MANAGER_H friend std::istream & operator>>(std::istream &, seed_manager &)
Load the seeds informations froma stream.
friend std::ostream & operator<<(std::ostream &, const seed_manager &)
Store the seeds informations in a stream.
int32_t get_seed(const std::string &label_) const
Get the seed value associated to a PRNG with a given label.
bool has_seed(const std::string &label_) const
Check is a PRNG with a given label has an associated seed.
void _set_seed(const std::string &label_, int32_t seed_)
bool has_time_seeds() const
Check if some valid seeds are 'time' :
Definition: seed_manager.h:68
void all_auto_seeds()
Make all seeds associated to all PRNGs set automatically.
void invalidate_seed(const std::string &label_)
Invalidate the seed value associated to a PRNG with a given label.
void clear()
Clear the list of stored seeds.
Definition: seed_manager.h:65
bool has_auto_seeds() const
Check if some valid seeds are 'auto' :
bool empty() const
Check if the manager is empty.
bool has_invalid_seeds() const
Check if some seeds are 'invalid' :
int32_t _set_seed_for_seeds()
void set_init_seed_flags(uint32_t)
Set the entropy strategy flags.
void update_seed(const std::string &label_, int32_t seed_)
Change the seed value associated to a PRNG with a given label.
static bool seed_is_valid(int32_t seed)
Return true if supplied integer can be treated as a seed.
seed_manager prng_seed_manager
WHY IS THIS NEEDED???????
Definition: seed_manager.h:172
void _ensure_different_seeds(mygsl::rng *random_=0)
Definition: seed_manager.h:70
void transform_time_seeds(bool allow_duplication_=false)
Compute the effective seeds' values from the current time.
void ensure_different_seeds()
Compute the effective seeds' values to be all different from each others.
Definition: seed_manager.h:66
void invalidate()
Make all seeds associated to all PRNGs invalid.
size_t size() const
Returns the number of PRNG's seed values storedin the manager.
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
Definition: seed_manager.h:60
Definition: seed_manager.h:71
void dump(std::ostream &) const
Basic print.
void all_time_seeds()
Make all seeds associated to all PRNGs set by the current time.
Definition: seed_manager.h:67
init_seed_from_type
The entropy strategy used to choose a seed for randomization of seeds.
Definition: seed_manager.h:63
virtual ~seed_manager()
Destructor:
Definition: seed_manager.h:64
void add_seed(const std::string &label_, int32_t seed_)
Install the seed value associated to a PRNG with a given label.
uint32_t get_init_seed_flags() const
Return the entropy strategy flags.
Definition: seed_manager.h:69
Pseudo random number generator.
Definition: rng.h:53
bool all_different_seeds() const
Check if all valid seeds are differents :
void get_labels(std::vector< std::string > &labels_) const
Build an array of all the PRNGs' labels stored in the manager.
seed_manager()
Default constructor: