Mantid
|
Defines a generator that produces quasi-random numbers according to a Sobol sequence http://en.wikipedia.org/wiki/Sobol_sequence. More...
#include <SobolSequence.h>
Public Member Functions | |
void | generateNextPoint () override |
Generates the next value in the sequence. More... | |
SobolSequence & | operator= (const SobolSequence &)=delete |
Disable assignment operator. More... | |
void | restart () override |
Reset the sequence. More... | |
void | restore () override |
Restores the generator to the last saved point, or the beginning if nothing has been saved. More... | |
void | save () override |
Saves the current state of the generator. More... | |
SobolSequence ()=delete | |
Disable default constructor. More... | |
SobolSequence (const SobolSequence &)=delete | |
Disable copy operator. More... | |
SobolSequence (const unsigned int ndims) | |
Constructor taking the number of dimensions. More... | |
~SobolSequence () override | |
Destructor. More... | |
Public Member Functions inherited from Mantid::Kernel::QuasiRandomNumberSequence | |
QuasiRandomNumberSequence (const unsigned int ndims) | |
Public Member Functions inherited from Mantid::Kernel::NDRandomNumberGenerator | |
NDRandomNumberGenerator ()=delete | |
Disable default constructor. More... | |
NDRandomNumberGenerator (const NDRandomNumberGenerator &)=delete | |
Disable copy operator. More... | |
NDRandomNumberGenerator (const unsigned int ndims) | |
Constructor. More... | |
const std::vector< double > & | nextPoint () |
Generate the next set of values that form a point in ND space. More... | |
unsigned int | numberOfDimensions () const |
Returns the number of dimensions the point will be generated in, i.e. More... | |
NDRandomNumberGenerator & | operator= (const NDRandomNumberGenerator &)=delete |
Disable assignment operator. More... | |
virtual void | restart ()=0 |
Restarts the generator from the beginning of the sequence. More... | |
virtual void | restore ()=0 |
Restores the generator to the last saved point, or the beginning if nothing has been saved. More... | |
virtual void | save ()=0 |
Saves the current state of the generator. More... | |
virtual | ~NDRandomNumberGenerator ()=default |
Virtual destructor to ensure that all inheriting classes have one. More... | |
Private Member Functions | |
void | deleteCurrentGenerator () |
Frees resources allocated by current generator. More... | |
void | setNumberOfDimensions (const unsigned int ndims) |
Set the number of dimensions. More... | |
Private Attributes | |
gsl_qrng * | m_gslGenerator |
GSL quasi-random number state generator. More... | |
gsl_qrng * | m_savedGenerator |
Allocated object for save state calls. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Kernel::NDRandomNumberGenerator | |
void | cacheGeneratedValue (const size_t index, const double value) |
Cache a value for a given dimension index, i.e. 0->ND-1. More... | |
void | cacheNextPoint (const std::vector< double > &nextPoint) |
Cache the while point in one go. More... | |
virtual void | generateNextPoint ()=0 |
Generate the next point. Override this in you concrete implementation. More... | |
std::vector< double > & | getNextPointCache () |
Some generators need direct access to the cache. More... | |
Defines a generator that produces quasi-random numbers according to a Sobol sequence http://en.wikipedia.org/wiki/Sobol_sequence.
Definition at line 26 of file SobolSequence.h.
|
explicit |
Constructor taking the number of dimensions.
Constructor taking the number of dimensions for the sequence.
Definition at line 17 of file SobolSequence.cpp.
References setNumberOfDimensions().
|
override |
|
delete |
Disable default constructor.
|
delete |
Disable copy operator.
|
private |
Frees resources allocated by current generator.
Definition at line 73 of file SobolSequence.cpp.
References m_gslGenerator, and m_savedGenerator.
Referenced by setNumberOfDimensions(), and ~SobolSequence().
|
overridevirtual |
Generates the next value in the sequence.
Returns the next number in the sequence.
Implements Mantid::Kernel::NDRandomNumberGenerator.
Definition at line 32 of file SobolSequence.cpp.
References Mantid::Kernel::NDRandomNumberGenerator::getNextPointCache(), and m_gslGenerator.
|
delete |
Disable assignment operator.
|
overridevirtual |
Reset the sequence.
Reset state back to the start of the sequence.
Implements Mantid::Kernel::NDRandomNumberGenerator.
Definition at line 40 of file SobolSequence.cpp.
References m_gslGenerator.
Referenced by restore().
|
overridevirtual |
Restores the generator to the last saved point, or the beginning if nothing has been saved.
Implements Mantid::Kernel::NDRandomNumberGenerator.
Definition at line 47 of file SobolSequence.cpp.
References m_gslGenerator, m_savedGenerator, and restart().
|
overridevirtual |
Saves the current state of the generator.
Implements Mantid::Kernel::NDRandomNumberGenerator.
Definition at line 43 of file SobolSequence.cpp.
References m_gslGenerator, and m_savedGenerator.
|
private |
Set the number of dimensions.
Sets the number of dimensions for the generator.
Note this destroys any previous state information including any saved state
Definition at line 59 of file SobolSequence.cpp.
References deleteCurrentGenerator(), and m_gslGenerator.
Referenced by SobolSequence().
|
private |
GSL quasi-random number state generator.
Definition at line 59 of file SobolSequence.h.
Referenced by deleteCurrentGenerator(), generateNextPoint(), restart(), restore(), save(), and setNumberOfDimensions().
|
private |
Allocated object for save state calls.
Definition at line 61 of file SobolSequence.h.
Referenced by deleteCurrentGenerator(), restore(), and save().