Octopus
quickrnd.c File Reference

Go to the source code of this file.

Classes

struct  __fsid_t
 

Typedefs

typedef unsigned char __u_char
 
typedef unsigned short int __u_short
 
typedef unsigned int __u_int
 
typedef unsigned long int __u_long
 
typedef signed char __int8_t
 
typedef unsigned char __uint8_t
 
typedef signed short int __int16_t
 
typedef unsigned short int __uint16_t
 
typedef signed int __int32_t
 
typedef unsigned int __uint32_t
 
typedef signed long int __int64_t
 
typedef unsigned long int __uint64_t
 
typedef __int8_t __int_least8_t
 
typedef __uint8_t __uint_least8_t
 
typedef __int16_t __int_least16_t
 
typedef __uint16_t __uint_least16_t
 
typedef __int32_t __int_least32_t
 
typedef __uint32_t __uint_least32_t
 
typedef __int64_t __int_least64_t
 
typedef __uint64_t __uint_least64_t
 
typedef long int __quad_t
 
typedef unsigned long int __u_quad_t
 
typedef long int __intmax_t
 
typedef unsigned long int __uintmax_t
 
typedef unsigned long int __dev_t
 
typedef unsigned int __uid_t
 
typedef unsigned int __gid_t
 
typedef unsigned long int __ino_t
 
typedef unsigned long int __ino64_t
 
typedef unsigned int __mode_t
 
typedef unsigned long int __nlink_t
 
typedef long int __off_t
 
typedef long int __off64_t
 
typedef int __pid_t
 
typedef long int __clock_t
 
typedef unsigned long int __rlim_t
 
typedef unsigned long int __rlim64_t
 
typedef unsigned int __id_t
 
typedef long int __time_t
 
typedef unsigned int __useconds_t
 
typedef long int __suseconds_t
 
typedef long int __suseconds64_t
 
typedef int __daddr_t
 
typedef int __key_t
 
typedef int __clockid_t
 
typedef void * __timer_t
 
typedef long int __blksize_t
 
typedef long int __blkcnt_t
 
typedef long int __blkcnt64_t
 
typedef unsigned long int __fsblkcnt_t
 
typedef unsigned long int __fsblkcnt64_t
 
typedef unsigned long int __fsfilcnt_t
 
typedef unsigned long int __fsfilcnt64_t
 
typedef long int __fsword_t
 
typedef long int __ssize_t
 
typedef long int __syscall_slong_t
 
typedef unsigned long int __syscall_ulong_t
 
typedef __off64_t __loff_t
 
typedef char * __caddr_t
 
typedef long int __intptr_t
 
typedef unsigned int __socklen_t
 
typedef int __sig_atomic_t
 
typedef __int8_t int8_t
 
typedef __int16_t int16_t
 
typedef __int32_t int32_t
 
typedef __int64_t int64_t
 
typedef __uint8_t uint8_t
 
typedef __uint16_t uint16_t
 
typedef __uint32_t uint32_t
 
typedef __uint64_t uint64_t
 
typedef __int_least8_t int_least8_t
 
typedef __int_least16_t int_least16_t
 
typedef __int_least32_t int_least32_t
 
typedef __int_least64_t int_least64_t
 
typedef __uint_least8_t uint_least8_t
 
typedef __uint_least16_t uint_least16_t
 
typedef __uint_least32_t uint_least32_t
 
typedef __uint_least64_t uint_least64_t
 
typedef signed char int_fast8_t
 
typedef long int int_fast16_t
 
typedef long int int_fast32_t
 
typedef long int int_fast64_t
 
typedef unsigned char uint_fast8_t
 
typedef unsigned long int uint_fast16_t
 
typedef unsigned long int uint_fast32_t
 
typedef unsigned long int uint_fast64_t
 
typedef long int intptr_t
 
typedef unsigned long int uintptr_t
 
typedef __intmax_t intmax_t
 
typedef __uintmax_t uintmax_t
 

Functions

void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __attribute__((__nothrow__
 
void __leaf__ __attribute__ ((__noreturn__))
 
void __assert_perror_fail (int __errnum, const char *__file, unsigned int __line, const char *__function) __attribute__((__nothrow__
 
void __assert (const char *__assertion, const char *__file, int __line) __attribute__((__nothrow__
 
double u64_to_open01 (const uint64_t x)
 
double i64_to_open01 (const int64_t x)
 
uint64_t splitmix64_mixer (const uint64_t x)
 
uint64_t splitmix64_mixer_2pow63 (const uint64_t x)
 
uint64_t hash_combine_ids (const uint64_t *ids, const uint32_t n)
 

Variables

static const uint64_t GOLDEN_RATIO = 0x9e3779b97f4a7c15ULL
 
static const double two_powm52 = 0x1.0p-52
 
static const double two_powm53 = 0x1.0p-53
 

Typedef Documentation

◆ __u_char

typedef unsigned char __u_char

Definition at line 54 of file quickrnd.c.

◆ __u_short

typedef unsigned short int __u_short

Definition at line 55 of file quickrnd.c.

◆ __u_int

typedef unsigned int __u_int

Definition at line 56 of file quickrnd.c.

◆ __u_long

typedef unsigned long int __u_long

Definition at line 57 of file quickrnd.c.

◆ __int8_t

typedef signed char __int8_t

Definition at line 60 of file quickrnd.c.

◆ __uint8_t

typedef unsigned char __uint8_t

Definition at line 61 of file quickrnd.c.

◆ __int16_t

typedef signed short int __int16_t

Definition at line 62 of file quickrnd.c.

◆ __uint16_t

typedef unsigned short int __uint16_t

Definition at line 63 of file quickrnd.c.

◆ __int32_t

typedef signed int __int32_t

Definition at line 64 of file quickrnd.c.

◆ __uint32_t

typedef unsigned int __uint32_t

Definition at line 65 of file quickrnd.c.

◆ __int64_t

typedef signed long int __int64_t

Definition at line 67 of file quickrnd.c.

◆ __uint64_t

typedef unsigned long int __uint64_t

Definition at line 68 of file quickrnd.c.

◆ __int_least8_t

Definition at line 75 of file quickrnd.c.

◆ __uint_least8_t

Definition at line 76 of file quickrnd.c.

◆ __int_least16_t

Definition at line 77 of file quickrnd.c.

◆ __uint_least16_t

Definition at line 78 of file quickrnd.c.

◆ __int_least32_t

Definition at line 79 of file quickrnd.c.

◆ __uint_least32_t

Definition at line 80 of file quickrnd.c.

◆ __int_least64_t

Definition at line 81 of file quickrnd.c.

◆ __uint_least64_t

Definition at line 82 of file quickrnd.c.

◆ __quad_t

typedef long int __quad_t

Definition at line 86 of file quickrnd.c.

◆ __u_quad_t

typedef unsigned long int __u_quad_t

Definition at line 87 of file quickrnd.c.

◆ __intmax_t

typedef long int __intmax_t

Definition at line 95 of file quickrnd.c.

◆ __uintmax_t

typedef unsigned long int __uintmax_t

Definition at line 96 of file quickrnd.c.

◆ __dev_t

typedef unsigned long int __dev_t

Definition at line 104 of file quickrnd.c.

◆ __uid_t

typedef unsigned int __uid_t

Definition at line 105 of file quickrnd.c.

◆ __gid_t

typedef unsigned int __gid_t

Definition at line 106 of file quickrnd.c.

◆ __ino_t

typedef unsigned long int __ino_t

Definition at line 107 of file quickrnd.c.

◆ __ino64_t

typedef unsigned long int __ino64_t

Definition at line 108 of file quickrnd.c.

◆ __mode_t

typedef unsigned int __mode_t

Definition at line 109 of file quickrnd.c.

◆ __nlink_t

typedef unsigned long int __nlink_t

Definition at line 110 of file quickrnd.c.

◆ __off_t

typedef long int __off_t

Definition at line 111 of file quickrnd.c.

◆ __off64_t

typedef long int __off64_t

Definition at line 112 of file quickrnd.c.

◆ __pid_t

typedef int __pid_t

Definition at line 113 of file quickrnd.c.

◆ __clock_t

typedef long int __clock_t

Definition at line 115 of file quickrnd.c.

◆ __rlim_t

typedef unsigned long int __rlim_t

Definition at line 116 of file quickrnd.c.

◆ __rlim64_t

typedef unsigned long int __rlim64_t

Definition at line 117 of file quickrnd.c.

◆ __id_t

typedef unsigned int __id_t

Definition at line 118 of file quickrnd.c.

◆ __time_t

typedef long int __time_t

Definition at line 119 of file quickrnd.c.

◆ __useconds_t

typedef unsigned int __useconds_t

Definition at line 120 of file quickrnd.c.

◆ __suseconds_t

typedef long int __suseconds_t

Definition at line 121 of file quickrnd.c.

◆ __suseconds64_t

typedef long int __suseconds64_t

Definition at line 122 of file quickrnd.c.

◆ __daddr_t

typedef int __daddr_t

Definition at line 124 of file quickrnd.c.

◆ __key_t

typedef int __key_t

Definition at line 125 of file quickrnd.c.

◆ __clockid_t

typedef int __clockid_t

Definition at line 128 of file quickrnd.c.

◆ __timer_t

typedef void* __timer_t

Definition at line 131 of file quickrnd.c.

◆ __blksize_t

typedef long int __blksize_t

Definition at line 134 of file quickrnd.c.

◆ __blkcnt_t

typedef long int __blkcnt_t

Definition at line 139 of file quickrnd.c.

◆ __blkcnt64_t

typedef long int __blkcnt64_t

Definition at line 140 of file quickrnd.c.

◆ __fsblkcnt_t

typedef unsigned long int __fsblkcnt_t

Definition at line 143 of file quickrnd.c.

◆ __fsblkcnt64_t

typedef unsigned long int __fsblkcnt64_t

Definition at line 144 of file quickrnd.c.

◆ __fsfilcnt_t

typedef unsigned long int __fsfilcnt_t

Definition at line 147 of file quickrnd.c.

◆ __fsfilcnt64_t

typedef unsigned long int __fsfilcnt64_t

Definition at line 148 of file quickrnd.c.

◆ __fsword_t

typedef long int __fsword_t

Definition at line 151 of file quickrnd.c.

◆ __ssize_t

typedef long int __ssize_t

Definition at line 153 of file quickrnd.c.

◆ __syscall_slong_t

typedef long int __syscall_slong_t

Definition at line 156 of file quickrnd.c.

◆ __syscall_ulong_t

typedef unsigned long int __syscall_ulong_t

Definition at line 158 of file quickrnd.c.

◆ __loff_t

Definition at line 162 of file quickrnd.c.

◆ __caddr_t

typedef char* __caddr_t

Definition at line 163 of file quickrnd.c.

◆ __intptr_t

typedef long int __intptr_t

Definition at line 166 of file quickrnd.c.

◆ __socklen_t

typedef unsigned int __socklen_t

Definition at line 169 of file quickrnd.c.

◆ __sig_atomic_t

typedef int __sig_atomic_t

Definition at line 174 of file quickrnd.c.

◆ int8_t

typedef __int8_t int8_t

Definition at line 186 of file quickrnd.c.

◆ int16_t

typedef __int16_t int16_t

Definition at line 187 of file quickrnd.c.

◆ int32_t

typedef __int32_t int32_t

Definition at line 188 of file quickrnd.c.

◆ int64_t

typedef __int64_t int64_t

Definition at line 189 of file quickrnd.c.

◆ uint8_t

typedef __uint8_t uint8_t

Definition at line 195 of file quickrnd.c.

◆ uint16_t

Definition at line 196 of file quickrnd.c.

◆ uint32_t

Definition at line 197 of file quickrnd.c.

◆ uint64_t

Definition at line 198 of file quickrnd.c.

◆ int_least8_t

Definition at line 205 of file quickrnd.c.

◆ int_least16_t

Definition at line 206 of file quickrnd.c.

◆ int_least32_t

Definition at line 207 of file quickrnd.c.

◆ int_least64_t

Definition at line 208 of file quickrnd.c.

◆ uint_least8_t

Definition at line 211 of file quickrnd.c.

◆ uint_least16_t

Definition at line 212 of file quickrnd.c.

◆ uint_least32_t

Definition at line 213 of file quickrnd.c.

◆ uint_least64_t

Definition at line 214 of file quickrnd.c.

◆ int_fast8_t

typedef signed char int_fast8_t

Definition at line 220 of file quickrnd.c.

◆ int_fast16_t

typedef long int int_fast16_t

Definition at line 222 of file quickrnd.c.

◆ int_fast32_t

typedef long int int_fast32_t

Definition at line 223 of file quickrnd.c.

◆ int_fast64_t

typedef long int int_fast64_t

Definition at line 224 of file quickrnd.c.

◆ uint_fast8_t

typedef unsigned char uint_fast8_t

Definition at line 226 of file quickrnd.c.

◆ uint_fast16_t

typedef unsigned long int uint_fast16_t

Definition at line 228 of file quickrnd.c.

◆ uint_fast32_t

typedef unsigned long int uint_fast32_t

Definition at line 229 of file quickrnd.c.

◆ uint_fast64_t

typedef unsigned long int uint_fast64_t

Definition at line 230 of file quickrnd.c.

◆ intptr_t

typedef long int intptr_t

Definition at line 232 of file quickrnd.c.

◆ uintptr_t

typedef unsigned long int uintptr_t

Definition at line 235 of file quickrnd.c.

◆ intmax_t

Definition at line 237 of file quickrnd.c.

◆ uintmax_t

Definition at line 238 of file quickrnd.c.

Function Documentation

◆ __assert_fail()

void __assert_fail ( const char *  __assertion,
const char *  __file,
unsigned int  __line,
const char *  __function 
)

◆ __attribute__()

void __leaf__ __attribute__ ( (__noreturn__)  )

◆ __assert_perror_fail()

void __assert_perror_fail ( int  __errnum,
const char *  __file,
unsigned int  __line,
const char *  __function 
)

◆ __assert()

void __assert ( const char *  __assertion,
const char *  __file,
int  __line 
)

◆ u64_to_open01()

double u64_to_open01 ( const uint64_t  x)

Definition at line 276 of file quickrnd.c.

◆ i64_to_open01()

double i64_to_open01 ( const int64_t  x)

Definition at line 280 of file quickrnd.c.

◆ splitmix64_mixer()

uint64_t splitmix64_mixer ( const uint64_t  x)

Definition at line 286 of file quickrnd.c.

◆ splitmix64_mixer_2pow63()

uint64_t splitmix64_mixer_2pow63 ( const uint64_t  x)

Definition at line 293 of file quickrnd.c.

◆ hash_combine_ids()

uint64_t hash_combine_ids ( const uint64_t ids,
const uint32_t  n 
)

Definition at line 298 of file quickrnd.c.

Variable Documentation

◆ GOLDEN_RATIO

const uint64_t GOLDEN_RATIO = 0x9e3779b97f4a7c15ULL
static

Definition at line 268 of file quickrnd.c.

◆ two_powm52

const double two_powm52 = 0x1.0p-52
static

Definition at line 271 of file quickrnd.c.

◆ two_powm53

const double two_powm53 = 0x1.0p-53
static

Definition at line 274 of file quickrnd.c.