Add xorshift prng
This commit is contained in:
27
src/prng/xorshift/xorshift.h
Normal file
27
src/prng/xorshift/xorshift.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef XORSHIFT_H
|
||||
#define XORSHIFT_H
|
||||
|
||||
#include "../../common/aliases/aliases.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
BEGIN_C_LINKAGE
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct xor_256_state XOR256State;
|
||||
struct xor_256_state {
|
||||
u64 x;
|
||||
u64 y;
|
||||
u64 z;
|
||||
u64 w;
|
||||
};
|
||||
|
||||
XOR256State wapp_init_xor_256_state(void);
|
||||
u64 wapp_xorshift_256_generate(XOR256State *state);
|
||||
u64 wapp_xoshiro_256ss_generate(XOR256State *state);
|
||||
u64 wapp_xoshiro_256p_generate(XOR256State *state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
END_C_LINKAGE
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // !XORSHIFT_H
|
||||
Reference in New Issue
Block a user