|
std::vector< double > | default_parameters (enum distribution distribution, const std::vector< double > ¶meters=std::vector< double >{}) |
|
std::string | version () |
| Version string, e.g.
|
|
std::vector< std::string > | version_dependencies () |
| Versions of this library and of all of its dependencies.
|
|
std::vector< std::string > | version_compiler () |
| Information on the compiler, the platform, the C++ standard, and the compilation date.
|
|
template<class T , class V , class R > |
R | 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 | 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 | 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 | auto_pcg32 (const T &initstate) |
| Return a pcg32, a pcg32_array, or a pcg32_tensor based on input.
|
|
template<class T , class S > |
auto | auto_pcg32 (const T &initstate, const S &initseq) |
| Return a pcg32, a pcg32_array, or a pcg32_tensor based on input.
|
|
Portable Reconstructible (Pseudo!) Random Number Generator.
template<class V , class I >
V prrng::cumsum_chunk |
( |
const V & |
cumsum, |
|
|
const V & |
delta, |
|
|
const I & |
shift |
|
) |
| |
|
inline |
Update the chunk of a cumsum computed and stored in chunks.
Example
Consider a full array:
da = np.random.random(N)
a = np.cumsum(a)
With chunk settings:
n = ... # size of each new chunk
nbuffer = ... # number of items to buffer
The the first chunk:
chunk = np.copy(a[:n + nbuffer])
nchunk = n + nbuffer
istart = np.array(0)
Then, moving right:
prrng.cumsum_chunk_inplace(chunk, da[istart + nchunk : istart + nchunk + n], n)
istart += n
Or, moving left:
prrng.cumsum_chunk_inplace(chunk, da[istart - n : istart + 1], -n)
istart -= n
- Parameters
-
cumsum | The current chunk of the cumsum. |
delta | The 'diff's of the next chunk in the cumsum. |
shift | The shift per row. |
- Returns
- Same shape as
cumsum
.
Definition at line 898 of file prrng.h.
template<class T , class V , class R >
R prrng::lower_bound |
( |
const T & |
matrix, |
|
|
const V & |
value |
|
) |
| |
|
inline |
Iterating on the last axis of an nd-array (e.g.
per row of a rank 2 matrix): 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.
- Parameters
-
matrix | The matrix defining a range per row. |
value | The value to find (per row). |
- Returns
- Same shape as
value
.
Definition at line 854 of file prrng.h.
template<class T , class V , class R >
R prrng::lower_bound |
( |
const T & |
matrix, |
|
|
const V & |
value, |
|
|
const R & |
index, |
|
|
size_t |
proximity = 10 |
|
) |
| |
|
inline |
Iterating on the last axis of an nd-array (e.g.
per row of a rank 2 matrix): 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.
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
-
matrix | The matrix defining a range per row. |
value | The value to find (per row). |
index | Initial guess on index . |
proximity | Size of the proximity search around guess (use 0 to disable proximity search). |
- Returns
- Same shape as
index
.
Definition at line 837 of file prrng.h.
std::vector< std::string > prrng::version_dependencies |
( |
| ) |
|
|
inline |
Versions of this library and of all of its dependencies.
The output is a list of strings, e.g.:
"prrng=1.7.0",
"xtensor=0.20.1"
...
- Returns
- List of strings.
Definition at line 563 of file prrng.h.