8 #include "columns/RandomSeed.hpp" 9 #include "utils/PVLog.hpp" 13 RandomSeed *RandomSeed::instance() {
14 static RandomSeed *singleton =
new RandomSeed();
18 RandomSeed::RandomSeed() {
19 if (
sizeof(
unsigned int) < (
size_t)4) {
20 Fatal() <<
"Unsigned int must have a size of at least 4 bytes.\n";
24 void RandomSeed::initialize(
unsigned int initialSeed) {
25 if (initialSeed < RandomSeed::minSeed) {
26 Fatal() <<
"random seed " << initialSeed <<
"" 27 " is too small. Use a seed of at least " 31 mInitialSeed = initialSeed;
32 mNextSeed = initialSeed;
35 unsigned int RandomSeed::allocate(
unsigned int numRequested) {
37 Fatal() <<
"RandomSeed has not been initialized.\n";
39 unsigned int allocation = mNextSeed;
40 mNextSeed += numRequested;
41 if (mNextSeed < minSeed) {
47 unsigned int constexpr RandomSeed::minSeed;