-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandommw.h
39 lines (32 loc) · 1.19 KB
/
randommw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*==========================================================================
* randommw.h
* combines Doornik's zigrandom.h and zignor.h, with modifications
*
* Some elements have been moved to randommw.c and made static.
*
* Werts, 2024
*==========================================================================*/
#include <stdint.h>
/* PRNG interface */
typedef double ( * DRANFUN)(void);
typedef uint32_t ( * U32RANFUN)(void);
typedef void ( * RANSETSEEDFUN)(uint64_t);
typedef void ( * RANJUMPFUN)(uint64_t);
typedef void ( * RANSEEDJUMPFUN)(uint64_t, uint64_t);
void RanSetRan(const char *sRan);
void RanSetRanExt(DRANFUN DRanFun, U32RANFUN U32RanFun,
RANSETSEEDFUN RanSetSeedFun, RANJUMPFUN RanJumpFun,
RANSEEDJUMPFUN RanSeedJumpFun);
void RanSetSeed(uint64_t uSeed);
void RanJumpRan(uint64_t uJumpsize);
void RanSeedJump(uint64_t uSeed, uint64_t uJumpsize);
double DRanU(void);
uint32_t U32RanU(void);
/* from zignor.h */
double DRanNormalZig(void);
/* Fully initialize PRNG */
void RanInit(const char *sRan, uint64_t uSeed, uint64_t uJumpsize);
/* from zigtimer.h */
void StartTimer(void);
void StopTimer(void);
char * GetLapsedTime(void);