GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
xoroshiro128p.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

static uint64_t rotl (const uint64_t x, const int k)
 rotating left shift helper According to the original authors, this will on most platforms reduce to a single instruction More...
 
static uint64_t xoroshiro128p_next (uint64_t *state)
 generate the next random number and update the state. This is the workhorse, here! More...
 
static void xoroshiro128p_jump (uint64_t *state)
 Advance the internal state by 2^64 steps; useful when coordinating multiple independent RNGs This is the jump function for the generator. It is equivalent to 2^64 calls to next(); it can be used to generate 2^64 non-overlapping subsequences for parallel computations. More...
 
static uint64_t splitmix64_next (uint64_t *state)
 step of the SPLITMIX64 RNG; only used internally for seeding This RNG isn't as good as XOROSHIRO128+, so it's only used to initialize a 128 bit state from a seed. More...
 
static void xoroshiro128p_seed (uint64_t *state, const uint64_t seed)
 Seed the 128 bit state from a 64 bit seed. More...
 

Function Documentation

◆ rotl()

static uint64_t rotl ( const uint64_t  x,
const int  k 
)
inlinestatic

rotating left shift helper According to the original authors, this will on most platforms reduce to a single instruction

Referenced by xoroshiro128p_next().

◆ splitmix64_next()

static uint64_t splitmix64_next ( uint64_t *  state)
inlinestatic

step of the SPLITMIX64 RNG; only used internally for seeding This RNG isn't as good as XOROSHIRO128+, so it's only used to initialize a 128 bit state from a seed.

Referenced by xoroshiro128p_seed().

◆ xoroshiro128p_jump()

static void xoroshiro128p_jump ( uint64_t *  state)
inlinestatic

Advance the internal state by 2^64 steps; useful when coordinating multiple independent RNGs This is the jump function for the generator. It is equivalent to 2^64 calls to next(); it can be used to generate 2^64 non-overlapping subsequences for parallel computations.

References xoroshiro128p_next().

Referenced by xoroshiro128p_seed().

◆ xoroshiro128p_next()

static uint64_t xoroshiro128p_next ( uint64_t *  state)
inlinestatic

generate the next random number and update the state. This is the workhorse, here!

References rotl().

Referenced by xoroshiro128p_jump().

◆ xoroshiro128p_seed()

static void xoroshiro128p_seed ( uint64_t *  state,
const uint64_t  seed 
)
inlinestatic

Seed the 128 bit state from a 64 bit seed.

References splitmix64_next(), and xoroshiro128p_jump().