- Timestamp:
- Mar 20, 2023, 3:45:23 PM (17 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c3ed603
- Parents:
- 4c6ba5a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/random.hfa
r4c6ba5a ra6bb5fc 10 10 // Created On : Fri Jan 14 07:18:11 2022 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 22 20:54:22 202213 // Update Count : 1 7812 // Last Modified On : Mon Mar 20 10:01:40 2023 13 // Update Count : 180 14 14 // 15 15 … … 46 46 // Define C/CFA PRNG name and random-state. 47 47 48 // SKULLDUGGERY: typedefs name struct and typedef with the same name to deal with CFA typedef numbering problem.49 50 48 #ifdef XOSHIRO256PP 51 49 #define PRNG_NAME_64 xoshiro256pp 52 50 #define PRNG_STATE_64_T GLUE(PRNG_NAME_64,_t) 53 typedef struct PRNG_STATE_64_T{ uint64_t s0, s1, s2, s3; } PRNG_STATE_64_T;51 typedef struct { uint64_t s0, s1, s2, s3; } PRNG_STATE_64_T; 54 52 #endif // XOSHIRO256PP 55 53 … … 57 55 #define PRNG_NAME_32 xoshiro128pp 58 56 #define PRNG_STATE_32_T GLUE(PRNG_NAME_32,_t) 59 typedef struct PRNG_STATE_32_T{ uint32_t s0, s1, s2, s3; } PRNG_STATE_32_T;57 typedef struct { uint32_t s0, s1, s2, s3; } PRNG_STATE_32_T; 60 58 #endif // XOSHIRO128PP 61 59 … … 93 91 #define PRNG_NAME_64 kiss_64 94 92 #define PRNG_STATE_64_T GLUE(PRNG_NAME_64,_t) 95 typedef struct PRNG_STATE_64_T{ uint64_t z, w, jsr, jcong; } PRNG_STATE_64_T;93 typedef struct { uint64_t z, w, jsr, jcong; } PRNG_STATE_64_T; 96 94 #endif // KISS_^64 97 95 … … 99 97 #define PRNG_NAME_32 xorwow 100 98 #define PRNG_STATE_32_T GLUE(PRNG_NAME_32,_t) 101 typedef struct PRNG_STATE_32_T{ uint32_t a, b, c, d, counter; } PRNG_STATE_32_T;99 typedef struct { uint32_t a, b, c, d, counter; } PRNG_STATE_32_T; 102 100 #endif // XOSHIRO128PP 103 101 … … 189 187 190 188 #ifndef XOSHIRO256PP 191 typedef struct xoshiro256pp_t{ uint64_t s0, s1, s2, s3; } xoshiro256pp_t;189 typedef struct { uint64_t s0, s1, s2, s3; } xoshiro256pp_t; 192 190 #endif // ! XOSHIRO256PP 193 191 … … 220 218 uint64_t seed4 = wyhash64( state ); 221 219 state = (xoshiro256pp_t){ seed1, seed2, seed3, seed4 }; 222 xoshiro256pp( state ); 220 xoshiro256pp( state ); // prime 223 221 } // xoshiro256pp_set_seed 224 222 … … 233 231 234 232 #ifndef XOSHIRO128PP 235 typedef struct xoshiro128pp_t{ uint32_t s0, s1, s2, s3; } xoshiro128pp_t;233 typedef struct { uint32_t s0, s1, s2, s3; } xoshiro128pp_t; 236 234 #endif // ! XOSHIRO128PP 237 235 … … 315 313 // The state must be seeded with a nonzero value. 316 314 #ifndef KISS_64 317 typedef struct kiss_64_t{ uint64_t z, w, jsr, jcong; } kiss_64_t;315 typedef struct { uint64_t z, w, jsr, jcong; } kiss_64_t; 318 316 #endif // ! KISS_64 319 317 … … 337 335 // The state array must be initialized to non-zero in the first four words. 338 336 #ifndef XORWOW 339 typedef struct xorwow_t{ uint32_t a, b, c, d, counter; } xorwow_t;337 typedef struct { uint32_t a, b, c, d, counter; } xorwow_t; 340 338 #endif // ! XORWOW 341 339
Note: See TracChangeset
for help on using the changeset viewer.