pulsatrix
Loading...
Searching...
No Matches
determinism.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <cstdint>
9
10namespace pulsatrix {
11
21void set_seed(uint64_t seed);
22
24[[nodiscard]] uint64_t global_seed();
25
31[[nodiscard]] uint64_t next_seed();
32
40void set_deterministic(bool enabled);
41
43[[nodiscard]] bool deterministic();
44
50void check_deterministic_allowed(const char* operation);
51
52} // namespace pulsatrix
Definition acquisition_functions.hpp:16
uint64_t next_seed()
The next seed in the global stream: a distinct, well-mixed 64-bit value per call, reproducible for a ...
void check_deterministic_allowed(const char *operation)
Guard for a nondeterministic code path: call it before running one.
void set_deterministic(bool enabled)
Turns deterministic mode on (the default) or off.
uint64_t global_seed()
The seed most recently passed to set_seed() (0 by default).
bool deterministic()
Whether deterministic mode is on.
void set_seed(uint64_t seed)
Sets the global seed and restarts the seed stream next_seed() draws from.