|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
A Gsl_Compatible_Rng in dynamic memory, so that what holds it grows only by a pointer, as with the gsl_rng of before.
More...
#include <ah-random.H>
Classes | |
| struct | Block |
| struct | Free_Block |
Public Member Functions | |
| Gsl_Compatible_Rng_Owner () noexcept=default | |
| An owner without a generator, as after a move; it can take one by a move or a swap. | |
| Gsl_Compatible_Rng_Owner (const unsigned long s) | |
Makes a generator seeded with s, as Gsl_Compatible_Rng(s). | |
| Gsl_Compatible_Rng_Owner (const Gsl_Compatible_Rng_Owner &)=delete | |
| Gsl_Compatible_Rng_Owner & | operator= (const Gsl_Compatible_Rng_Owner &)=delete |
| Gsl_Compatible_Rng_Owner (Gsl_Compatible_Rng_Owner &&o) noexcept=default | |
Takes the generator of o, which keeps none. | |
| Gsl_Compatible_Rng_Owner & | operator= (Gsl_Compatible_Rng_Owner &&o) noexcept=default |
Frees the generator, and takes that of o, which keeps none. | |
| void | swap (Gsl_Compatible_Rng_Owner &o) noexcept |
Swaps the generators, with their gsl_rng. | |
| Gsl_Compatible_Rng & | operator* () const noexcept |
| The generator. | |
| Gsl_Compatible_Rng * | operator-> () const noexcept |
| The generator. | |
| Gsl_Compatible_Rng * | get () const noexcept |
| The generator, or nullptr after a move. | |
Private Attributes | |
| std::unique_ptr< Block, Free_Block > | block |
A Gsl_Compatible_Rng in dynamic memory, so that what holds it grows only by a pointer, as with the gsl_rng of before.
It is the generator of the classes that draw always from the Mersenne Twister, as those that make random graphs, and the one that a Random_Source makes when it is asked for it.
It moves and swaps with its holder; it is not copied, since each holder makes its own generator. While ALEPH_WITH_GSL is 1, gsl() gives a gsl_rng whose state is the generator, for the deprecated gsl_rng_object() of the structures: the functions of GSL on it act on the generator of the structure.
Definition at line 493 of file ah-random.H.
|
defaultnoexcept |
An owner without a generator, as after a move; it can take one by a move or a swap.
|
inlineexplicit |
Makes a generator seeded with s, as Gsl_Compatible_Rng(s).
| [in] | s | The seed. |
| std::bad_alloc | If there is not enough memory: the generator is in memory of malloc(), as the gsl_rng of GSL was. |
Definition at line 543 of file ah-random.H.
References block.
|
delete |
|
defaultnoexcept |
Takes the generator of o, which keeps none.
|
inlinenoexcept |
The generator, or nullptr after a move.
Definition at line 578 of file ah-random.H.
References block.
Referenced by Aleph::Karger_Min_Cut< GT, SA >::compute_min_cut_size(), Aleph::Random_Source::engine(), Aleph::Karger_Min_Cut< GT, SA >::fast(), Aleph::Random_Source::mersenne_twister(), Aleph::Random_Source::next64(), Aleph::Random_Source::operator()(), Aleph::Karger_Min_Cut< GT, SA >::operator()(), Aleph::Karger_Min_Cut< GT, SA >::operator()(), Aleph::Karger_Min_Cut< GT, SA >::reseed(), Aleph::Random_Source::seed(), Aleph::Random_Source::uniform(), and Aleph::Random_Source::uniform_int_ne().
|
inlinenoexcept |
|
inlinenoexcept |
|
delete |
|
defaultnoexcept |
Frees the generator, and takes that of o, which keeps none.
| [in] | o | The other one. |
*this.
|
inlinenoexcept |
Swaps the generators, with their gsl_rng.
| [in] | o | The other one. |
Definition at line 569 of file ah-random.H.
References block.
Referenced by Aleph::Karger_Min_Cut< GT, SA >::Karger_Min_Cut(), and Aleph::Random_Source::swap().
|
private |
Definition at line 530 of file ah-random.H.
Referenced by Gsl_Compatible_Rng_Owner(), get(), operator*(), operator->(), and swap().