openGPMP
Open Source Mathematics Package
Classes | Namespaces | Macros | Functions | Variables
random.hpp File Reference

Pseudorandom Number Generators. More...

#include <chrono>
#include <cstdint>

Go to the source code of this file.

Classes

class  gpmp::core::rndm::LCG
 Linear Congruential Generator. More...
 

Namespaces

 gpmp
 The source C++ openGPMP namespace.
 
 gpmp::core
 
 gpmp::core::rndm
 

Macros

#define __8MAX   127 /** 8 bit signed max */
 
#define __U8MAX   255 /** 8 bit unsigned max */
 
#define __16MAX   32767 /** 16 bit signed max */
 
#define __U16MAX   65535 /** 16 bit unsigned max */
 
#define __32MAX   2147483647L /** 32 bit signed max */
 
#define __U32MAX   4294967295U /** 32 bit unsigned max */
 
#define __64MAX   9223372036854775807LL /** 64 bit signed max */
 
#define __U64MAX   18446744073709551615ULL /** 64 bit unsigned max */
 

Functions

uint32_t gpmp::core::rndm::rotr32 (uint32_t x, unsigned r)
 
uint32_t gpmp::core::rndm::pcg32 (void)
 
void gpmp::core::rndm::pcg32_init (uint64_t seed)
 

Variables

static uint64_t __PCG_STATE = 0x4d595df4d0f33173
 
static uint64_t const __PCG_MULTPLR = 6364136223846793005u
 
static uint64_t const __PCG_INCR
 

Detailed Description

Pseudorandom Number Generators.

Definition in file random.hpp.

Macro Definition Documentation

◆ __16MAX

#define __16MAX   32767 /** 16 bit signed max */

Definition at line 48 of file random.hpp.

◆ __32MAX

#define __32MAX   2147483647L /** 32 bit signed max */

Definition at line 51 of file random.hpp.

◆ __64MAX

#define __64MAX   9223372036854775807LL /** 64 bit signed max */

Definition at line 54 of file random.hpp.

◆ __8MAX

#define __8MAX   127 /** 8 bit signed max */

PRNG CONSTANTS

Definition at line 45 of file random.hpp.

◆ __U16MAX

#define __U16MAX   65535 /** 16 bit unsigned max */

Definition at line 49 of file random.hpp.

◆ __U32MAX

#define __U32MAX   4294967295U /** 32 bit unsigned max */

Definition at line 52 of file random.hpp.

◆ __U64MAX

#define __U64MAX   18446744073709551615ULL /** 64 bit unsigned max */

Definition at line 55 of file random.hpp.

◆ __U8MAX

#define __U8MAX   255 /** 8 bit unsigned max */

Definition at line 46 of file random.hpp.

Variable Documentation

◆ __PCG_INCR

uint64_t const __PCG_INCR
static
Initial value:
=
1442695040888963407u

Definition at line 63 of file random.hpp.

Referenced by gpmp::core::rndm::pcg32(), and gpmp::core::rndm::pcg32_init().

◆ __PCG_MULTPLR

uint64_t const __PCG_MULTPLR = 6364136223846793005u
static

Definition at line 62 of file random.hpp.

Referenced by gpmp::core::rndm::pcg32().

◆ __PCG_STATE

uint64_t __PCG_STATE = 0x4d595df4d0f33173
static

Definition at line 61 of file random.hpp.

Referenced by gpmp::core::rndm::pcg32(), and gpmp::core::rndm::pcg32_init().