diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-12-29 06:21:33 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-12-29 06:21:33 +0100 |
commit | 2d6c8fec45b23a8a28668ecf3ef281139ab778a7 (patch) | |
tree | 75d2a8538992129a83c0c2b83688289443d697e5 /source/kit/mersenne_twister_64.h | |
parent | 820b171245f2f14766f3accdb0246a4e2c0d596a (diff) | |
download | saw-2d6c8fec45b23a8a28668ecf3ef281139ab778a7.zip |
refactor dependencies; include dependencies source code
Diffstat (limited to 'source/kit/mersenne_twister_64.h')
-rw-r--r-- | source/kit/mersenne_twister_64.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source/kit/mersenne_twister_64.h b/source/kit/mersenne_twister_64.h new file mode 100644 index 0000000..ab496a9 --- /dev/null +++ b/source/kit/mersenne_twister_64.h @@ -0,0 +1,37 @@ +#ifndef KIT_MERSENNE_TWISTER_64_H +#define KIT_MERSENNE_TWISTER_64_H + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + KIT_MT64_N = 312, +}; + +typedef struct { + u64 mt[KIT_MT64_N]; + u64 index; +} kit_mt64_state_t; + +void kit_mt64_init_array(kit_mt64_state_t *state, i64 size, + u64 *seed); +void kit_mt64_init(kit_mt64_state_t *state, u64 seed); +void kit_mt64_rotate(kit_mt64_state_t *state); +u64 kit_mt64_generate(kit_mt64_state_t *state); + +#ifdef __cplusplus +} +#endif + +#ifndef KIT_DISABLE_SHORT_NAMES +# define mt64_state_t kit_mt64_state_t +# define mt64_init_array kit_mt64_init_array +# define mt64_init kit_mt64_init +# define mt64_rotate kit_mt64_rotate +# define mt64_generate kit_mt64_generate +#endif + +#endif |