diff options
author | Brendan Hickey <brendan@bhickey.net> | 2011-04-07 23:54:08 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-04-08 01:18:29 +0200 |
commit | 1491aabfcd8d9fb9874bba38626941f91e6212f1 (patch) | |
tree | 27f6720fcc0fe556bcbabe15a38dd891a845fe09 /crawl-ref/source/asg.h | |
parent | 766b489b3f6d2a7f8a3d3c71e78fb26ab31cc1f0 (diff) | |
download | crawl-ref-1491aabfcd8d9fb9874bba38626941f91e6212f1.tar.gz crawl-ref-1491aabfcd8d9fb9874bba38626941f91e6212f1.zip |
Swapped MT19937 for a 160-bit hybrid alternating step generator
Diffstat (limited to 'crawl-ref/source/asg.h')
-rw-r--r-- | crawl-ref/source/asg.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/asg.h b/crawl-ref/source/asg.h new file mode 100644 index 0000000000..7aeae14bbd --- /dev/null +++ b/crawl-ref/source/asg.h @@ -0,0 +1,19 @@ +#ifndef __LIB_RNG_ASG_HEADER__ +#define __LIB_RNG_ASG_HEADER__ + +#include <stack> +class AsgKISS { + public: + AsgKISS(); + AsgKISS(uint32_t init_key[], int key_length); + uint32_t get_uint32(); + private: + uint32_t m_lcg, m_mwcm, m_mwcc, m_xorshift, m_lfsr; +}; + +void push_asg_state(); +void pop_asg_state(); + +uint32_t get_uint32(); +void seed_asg(uint32_t[], int); +#endif |