MCPcopy Create free account
hub / github.com/numpy/numpy / sfc64_set_seed

Function sfc64_set_seed

numpy/random/src/sfc64/sfc64.c:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "sfc64.h"
2
3extern void sfc64_set_seed(sfc64_state *state, uint64_t *seed) {
4 /* Conservatively stick with the original formula. With SeedSequence, it
5 * might be fine to just set the state with 4 uint64s and be done.
6 */
7 int i;
8
9 state->s[0] = seed[0];
10 state->s[1] = seed[1];
11 state->s[2] = seed[2];
12 state->s[3] = 1;
13
14 for (i=0; i<12; i++) {
15 (void)sfc64_next(state->s);
16 }
17}
18
19extern void sfc64_get_state(sfc64_state *state, uint64_t *state_arr, int *has_uint32,
20 uint32_t *uinteger) {

Callers

nothing calls this directly

Calls 1

sfc64_nextFunction · 0.85

Tested by

no test coverage detected