VCV Rack API v2
Loading...
Searching...
No Matches
rack::random::Xoroshiro128Plus Struct Reference

xoroshiro128+. More...

#include <random.hpp>

Public Member Functions

void seed (uint64_t s0, uint64_t s1)
 
bool isSeeded ()
 
uint64_t operator() ()
 
constexpr uint64_t min () const
 
constexpr uint64_t max () const
 

Static Public Member Functions

static uint64_t rotl (uint64_t x, int k)
 

Public Attributes

uint64_t state [2] = {}
 

Detailed Description

xoroshiro128+.

Very fast, not-cryptographic random number generator. From https://prng.di.unimi.it/ Example:

std::random_device rd;
random::Xoroshiro128Plus rng(rd(), rd());
uint64_t r = rng();

std::uniform_real_distribution<float> uniform(0.f, 1.f);
float r = uniform(rng);

std::normal_distribution<> normal(0.0, 1.0);
double r = normal(rng);

Member Function Documentation

◆ seed()

void rack::random::Xoroshiro128Plus::seed ( uint64_t s0,
uint64_t s1 )
inline

◆ isSeeded()

bool rack::random::Xoroshiro128Plus::isSeeded ( )
inline

◆ rotl()

static uint64_t rack::random::Xoroshiro128Plus::rotl ( uint64_t x,
int k )
inlinestatic

◆ operator()()

uint64_t rack::random::Xoroshiro128Plus::operator() ( )
inline

◆ min()

uint64_t rack::random::Xoroshiro128Plus::min ( ) const
inlineconstexpr

◆ max()

uint64_t rack::random::Xoroshiro128Plus::max ( ) const
inlineconstexpr

Member Data Documentation

◆ state

uint64_t rack::random::Xoroshiro128Plus::state[2] = {}

The documentation for this struct was generated from the following file: