Rosetta
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
basic::random::RandomGeneratorSettings Class Reference

A class to store settings from the options system for the random generator. Moved from core to basic. More...

#include <RandomGeneratorSettings.hh>

Inheritance diagram for basic::random::RandomGeneratorSettings:
Inheritance graph
[legend]

Public Member Functions

 RandomGeneratorSettings ()
 
void initialize_from_options (utility::options::OptionCollection const &options)
 
int seed () const
 
int seed_offset () const
 
bool const_seed () const
 
bool use_time_as_seed () const
 
std::string const & random_device_name () const
 
std::string const & rng_type () const
 
bool mpi_bcast_seed_from_node0 () const
 
void seed (int setting)
 
void seed_offset (int setting)
 
void const_seed (bool setting)
 
void use_time_as_seed (bool setting)
 
void random_device_name (std::string const &setting)
 
void rng_type (std::string const &setting)
 
void mpi_bcast_seed_from_node0 (bool setting)
 It is important that calls to determine_random_seed with this value set to true (the default!) only occur when all nodes will reach this function at the same time with no intervening mpi calls. Beware if in a multithreaded context if a seed is set more than once (e.g. after each thread launches) as it can produce MPI-deadlock. More...
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Static Public Member Functions

static void list_options_read (utility::options::OptionKeyList &opt_keys)
 

Private Attributes

int seed_
 
int seed_offset_
 
bool const_seed_
 
bool use_time_as_seed_
 
std::string random_device_name_
 
std::string rng_type_
 
bool mpi_bcast_seed_from_node0_
 

Detailed Description

A class to store settings from the options system for the random generator. Moved from core to basic.

Author
Original author unknown. @modified Moved from core to basic by Vikram K. Mulligan (vmull.nosp@m.igan.nosp@m.@flat.nosp@m.iron.nosp@m.insti.nosp@m.tute.nosp@m..org).

Constructor & Destructor Documentation

◆ RandomGeneratorSettings()

basic::random::RandomGeneratorSettings::RandomGeneratorSettings ( )

Member Function Documentation

◆ const_seed() [1/2]

bool basic::random::RandomGeneratorSettings::const_seed ( ) const

References const_seed_.

◆ const_seed() [2/2]

void basic::random::RandomGeneratorSettings::const_seed ( bool  setting)

References const_seed_.

◆ initialize_from_options()

void basic::random::RandomGeneratorSettings::initialize_from_options ( utility::options::OptionCollection const &  options)

◆ list_options_read()

void basic::random::RandomGeneratorSettings::list_options_read ( utility::options::OptionKeyList opt_keys)
static

◆ mpi_bcast_seed_from_node0() [1/2]

bool basic::random::RandomGeneratorSettings::mpi_bcast_seed_from_node0 ( ) const

◆ mpi_bcast_seed_from_node0() [2/2]

void basic::random::RandomGeneratorSettings::mpi_bcast_seed_from_node0 ( bool  setting)

It is important that calls to determine_random_seed with this value set to true (the default!) only occur when all nodes will reach this function at the same time with no intervening mpi calls. Beware if in a multithreaded context if a seed is set more than once (e.g. after each thread launches) as it can produce MPI-deadlock.

References mpi_bcast_seed_from_node0_.

◆ random_device_name() [1/2]

std::string const & basic::random::RandomGeneratorSettings::random_device_name ( ) const

References random_device_name_.

◆ random_device_name() [2/2]

void basic::random::RandomGeneratorSettings::random_device_name ( std::string const &  setting)

References random_device_name_.

◆ rng_type() [1/2]

std::string const & basic::random::RandomGeneratorSettings::rng_type ( ) const

◆ rng_type() [2/2]

void basic::random::RandomGeneratorSettings::rng_type ( std::string const &  setting)

References rng_type_.

◆ seed() [1/2]

int basic::random::RandomGeneratorSettings::seed ( ) const

References seed_.

◆ seed() [2/2]

void basic::random::RandomGeneratorSettings::seed ( int  setting)

References seed_.

◆ seed_offset() [1/2]

int basic::random::RandomGeneratorSettings::seed_offset ( ) const

References seed_offset_.

◆ seed_offset() [2/2]

void basic::random::RandomGeneratorSettings::seed_offset ( int  setting)

References seed_offset_.

◆ use_time_as_seed() [1/2]

bool basic::random::RandomGeneratorSettings::use_time_as_seed ( ) const

References use_time_as_seed_.

◆ use_time_as_seed() [2/2]

void basic::random::RandomGeneratorSettings::use_time_as_seed ( bool  setting)

References use_time_as_seed_.

Member Data Documentation

◆ const_seed_

bool basic::random::RandomGeneratorSettings::const_seed_
private

◆ mpi_bcast_seed_from_node0_

bool basic::random::RandomGeneratorSettings::mpi_bcast_seed_from_node0_
private

◆ random_device_name_

std::string basic::random::RandomGeneratorSettings::random_device_name_
private

◆ rng_type_

std::string basic::random::RandomGeneratorSettings::rng_type_
private

◆ seed_

int basic::random::RandomGeneratorSettings::seed_
private

Referenced by initialize_from_options(), and seed().

◆ seed_offset_

int basic::random::RandomGeneratorSettings::seed_offset_
private

◆ use_time_as_seed_

bool basic::random::RandomGeneratorSettings::use_time_as_seed_
private

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