|
class | prrng::exponential_distribution |
| Exponential distribution. More...
|
|
class | prrng::power_distribution |
| Power distribution. More...
|
|
class | prrng::gamma_distribution |
| Gamma distribution. More...
|
|
class | prrng::pareto_distribution |
| Pareto distribution. More...
|
|
class | prrng::weibull_distribution |
| Weibull distribution. More...
|
|
class | prrng::normal_distribution |
| Normal distribution. More...
|
|
class | prrng::GeneratorBase< Derived > |
| Base class of the pseudorandom number generators providing common methods. More...
|
|
class | prrng::pcg32 |
| Random number generate using the pcg32 algorithm. More...
|
|
class | prrng::pcg32_index |
| Overload of prrng::pcg32() that keeps track of the current index of the generator in the sequence. More...
|
|
struct | prrng::alignment |
| Structure to assemble the alignment parameters. More...
|
|
class | prrng::pcg32_cumsum< Data > |
| Generator of a random cumulative sum of which a chunk is kept in memory. More...
|
|
class | prrng::GeneratorBase_array< Derived, M > |
| Base class of an array of pseudorandom number generators. More...
|
|
class | prrng::pcg32_arrayBase< Generator, Shape > |
| Base class, see pcg32_array for description. More...
|
|
class | prrng::pcg32_array |
| Array of independent generators. More...
|
|
class | prrng::pcg32_tensor< N > |
| Fixed rank version of pcg32_array. More...
|
|
class | prrng::pcg32_index_array |
| Array of prrng::pcg32_index(). More...
|
|
class | prrng::pcg32_index_tensor< N > |
| Fixed rank version of pcg32_index_array. More...
|
|
class | prrng::pcg32_arrayBase_chunkBase< Generator, Data, Index, is_cumsum > |
| Array of generators of which a chunk of random numbers is kept in memory. More...
|
|
class | prrng::pcg32_arrayBase_chunk< Generator, Data, Index > |
| Array of generators of which a chunk of random numbers is kept in memory. More...
|
|
class | prrng::pcg32_arrayBase_cumsum< Generator, Data, Index > |
| TODO: copydoc. More...
|
|
class | prrng::pcg32_array_chunk< Data, Index > |
| Array of generators of which a chunk of the random sequence is kept in memory. More...
|
|
class | prrng::pcg32_tensor_chunk< Data, Index, N > |
| Array of generators of which a chunk of the random sequence is kept in memory. More...
|
|
class | prrng::pcg32_array_cumsum< Data, Index > |
| Array of generators of a random cumulative sum, see prrng::pcg32_cumsum(). More...
|
|
class | prrng::pcg32_tensor_cumsum< Data, Index, N > |
| Array of generators of a random cumulative sum, see prrng::pcg32_cumsum(). More...
|
|
|
#define | PRRNG_PCG32_INITSTATE 0x853c49e6748fea9bULL |
| Default initialisation state for pcg32() (used as constructor parameter that can be overwritten at run-time).
|
|
#define | PRRNG_PCG32_INITSEQ 0xda3e39cb94b95bdbULL |
| Default initialisation sequence for pcg32() (used as constructor parameter that can be overwritten at run-time).
|
|
#define | PRRNG_PCG32_MULT 6364136223846793005ULL |
| Multiplicative factor for pcg32() (used internally, cannot be overwritten at run-time).
|
|
#define | PRRNG_USE_BOOST 1 |
| To use prrng without Boost.
|
|
#define | PRRNG_VERSION "@PROJECT_VERSION@" |
| Library version.
|
|
#define | PRRNG_ASSERT(expr) |
| All assertions are implementation as:
|
|
#define | PRRNG_DEBUG(expr) |
| All debug assertions are implementation as:
|
|
#define | PRRNG_WARNING(message) PRRNG_WARNING_IMPL(message, __FILE__, __LINE__, __FUNCTION__) |
| Warnings are implemented as:
|
|
#define | PRRNG_WARNING_PYTHON(message) |
| Warnings specific to the Python API are implemented as:
|
|
|
std::vector< double > | prrng::default_parameters (enum distribution distribution, const std::vector< double > ¶meters=std::vector< double >{}) |
|
std::string | prrng::version () |
| Version string, e.g.
|
|
std::vector< std::string > | prrng::version_dependencies () |
| Versions of this library and of all of its dependencies.
|
|
std::vector< std::string > | prrng::version_compiler () |
| Information on the compiler, the platform, the C++ standard, and the compilation date.
|
|
template<class It , class T , class R = size_t> |
R | prrng::iterator::lower_bound (const It first, const It last, const T &value, R guess=0, R proximity=10) |
| Return index of the first element in the range [first, last) such that element < value is false (i.e.
|
|
template<class T , class V , class R > |
void | prrng::inplace::lower_bound (const T &matrix, const V &value, R &index, typename R::value_type proximity=10) |
| Similar to lower_bound but on the last axis of an nd-array (e.g.
|
|
template<class V , class I > |
void | prrng::inplace::cumsum_chunk (V &cumsum, const V &delta, const I &shift) |
| Update the chunk of a cumsum computed and stored in chunks.
|
|
template<class T , class V , class R > |
R | prrng::lower_bound (const T &matrix, const V &value, const R &index, size_t proximity=10) |
| Iterating on the last axis of an nd-array (e.g.
|
|
template<class T , class V , class R > |
R | prrng::lower_bound (const T &matrix, const V &value) |
| Iterating on the last axis of an nd-array (e.g.
|
|
template<class V , class I > |
V | prrng::cumsum_chunk (const V &cumsum, const V &delta, const I &shift) |
| Update the chunk of a cumsum computed and stored in chunks.
|
|
template<class T > |
auto | prrng::auto_pcg32 (const T &initstate) |
| Return a pcg32, a pcg32_array, or a pcg32_tensor based on input.
|
|
template<class T , class S > |
auto | prrng::auto_pcg32 (const T &initstate, const S &initseq) |
| Return a pcg32, a pcg32_array, or a pcg32_tensor based on input.
|
|
Portable Reconstructible Random Number Generator.
The idea is that a random sequence can be restored independent of platform or compiler. In addition, this library allows you to store a point in the sequence, and then later restore the sequence exactly from this point (in both directions actually).
Note that the core of this code is taken from https://github.com/imneme/pcg-c-basic All the credits goes to those developers. This is just a wrapper.
- Copyright
- Copyright 2021. Tom de Geus. All rights reserved.
- license This project is released under the MIT License.
Definition in file prrng.h.
template<class It , class T , class R = size_t>
R prrng::iterator::lower_bound |
( |
const It |
first, |
|
|
const It |
last, |
|
|
const T & |
value, |
|
|
R |
guess = 0 , |
|
|
R |
proximity = 10 |
|
) |
| |
|
inline |
Return index of the first element in the range [first, last) such that element < value
is false
(i.e.
greater or equal to), or last if no such element is found.
Compared to the default function, this function allows for a guess of the index and a proximity search around. This could be efficient for finding items in large arrays.
- Parameters
-
first | Iterator defining the beginning of the range to examine (e.g. a.begin() ). |
last | Iterator defining the end of the range to examine (e.g. a.end() ) |
value | Value to find. |
guess | Guess of the index where to find the value. |
proximity | Size of the proximity search around guess (use 0 to disable). |
- Returns
- The index of
value
(i.e. a[index] < value <= a[index + 1]
).
Definition at line 694 of file prrng.h.
template<class T , class V , class R >
void prrng::inplace::lower_bound |
( |
const T & |
matrix, |
|
|
const V & |
value, |
|
|
R & |
index, |
|
|
typename R::value_type |
proximity = 10 |
|
) |
| |
|
inline |
Similar to lower_bound
but on the last axis of an nd-array (e.g.
per row of a rank 2 matrix).
- Parameters
-
matrix | The matrix defining a range per row. |
value | The value to find (per row). |
index | Initial guess on index (updated). |
proximity | Size of the proximity search around guess (use 0 to disable proximity search). |
Definition at line 736 of file prrng.h.