CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
pcg.h File Reference

High-quality pseudo-random number generation using PCG algorithm. More...

#include <cx/cx.h>
#include <cx/debug/assert.h>

Go to the source code of this file.

Data Structures

struct  PcgState
 

Typedefs

typedef struct PcgState PcgState
 

Functions

void pcgSeed (PcgState *rng, uint64 initstate, uint64 initseq)
 
void pcgAutoSeed (PcgState *rng)
 
uint32 pcgRandom (PcgState *rng)
 
uint32 pcgBounded (PcgState *rng, uint32 bound)
 
bool pcgFlip (PcgState *rng)
 
int32 pcgSBounded (PcgState *rng, int32 bound)
 
uint32 pcgRange (PcgState *rng, uint32 lower, uint32 upper)
 
int32 pcgSRange (PcgState *rng, int32 lower, int32 upper)
 
uint64 pcgRandom64 (PcgState *rng)
 
uint64 pcgBounded64 (PcgState *rng, uint64 bound)
 
uint64 pcgRange64 (PcgState *rng, uint64 lower, uint64 upper)
 
int64 pcgSRange64 (PcgState *rng, int64 lower, int64 upper)
 
float32 pcgFRange (PcgState *rng, float32 lower, float32 upper)
 
float64 pcgFRange64 (PcgState *rng, float64 lower, float64 upper)
 
void pcgAdvance (PcgState *rng, uint64 delta)
 

Detailed Description

High-quality pseudo-random number generation using PCG algorithm.

Somewhat modified version of PCG (Permuted Congruential Generator). Extremely fast pseudo-random number generator with excellent statistical properties.

PCG Random Number Generation for C.

Copyright 2014 Melissa O'Neill oneil.nosp@m.l@pc.nosp@m.g-ran.nosp@m.dom..nosp@m.org

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0 

Definition in file pcg.h.