MCPcopy Create free account
hub / github.com/avaneev/biteopt / init

Method init

biteaux.h:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 */
89
90 void init( const int NewSeed, biteopt_rng const arf = NULL,
91 void* const ardata = NULL )
92 {
93 rf = arf;
94 rdata = ardata;
95
96 BitsLeft = 0;
97 Seed = (uint64_t) NewSeed;
98 lcg = 0;
99 Hash = 0;
100
101 // Skip first values to make PRNG "settle down".
102
103 int i;
104
105 for( i = 0; i < 5; i++ )
106 {
107 advance();
108 }
109 }
110
111 /**
112 * @return Random number in the range [0; 1).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected