Sha256: 21d920f21ad199d9068a4da5507e4a0f835d313d04907593fe3540ecbbe3e734

Contents?: true

Size: 937 Bytes

Versions: 20

Compression:

Stored size: 937 Bytes

Contents

#ifndef COKUS_H
#define COKUS_H

#include <stdio.h>
#include <stdlib.h>

//
// uint32 must be an unsigned integer type capable of holding at least 32
// bits; exactly 32 should be fastest, but 64 is better on an Alpha with
// GCC at -O3 optimization so try your options and see what's best for you
//

typedef unsigned long uint32;

#define N              (624)                 // length of state vector
#define M              (397)                 // a period parameter
#define K              (0x9908B0DFU)         // a magic constant
#define hiBit(u)       ((u) & 0x80000000U)   // mask all but highest   bit of u
#define loBit(u)       ((u) & 0x00000001U)   // mask all but lowest    bit of u
#define loBits(u)      ((u) & 0x7FFFFFFFU)   // mask     the highest   bit of u
#define mixBits(u, v)  (hiBit(u)|loBits(v))  // move hi bit of u to hi bit of v

void seedMT(uint32 seed);
uint32 reloadMT(void);
uint32 randomMT(void);

#endif

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
lda-ruby-0.3.9 ext/lda-ruby/cokus.h
ealdent-lda-ruby-0.1.1 cokus.h
ealdent-lda-ruby-0.1.2 cokus.h
ealdent-lda-ruby-0.1.3 lib/cokus.h
ealdent-lda-ruby-0.1.4 lib/cokus.h
ealdent-lda-ruby-0.1.5 lib/cokus.h
ealdent-lda-ruby-0.1.6 lib/cokus.h
ealdent-lda-ruby-0.1.7 lib/cokus.h
ealdent-lda-ruby-0.2.0 lib/cokus.h
ealdent-lda-ruby-0.2.1 lib/cokus.h
ealdent-lda-ruby-0.2.2 lib/cokus.h
ealdent-lda-ruby-0.2.3 lib/cokus.h
ealdent-lda-ruby-0.3.0 ext/lda-ruby/cokus.h
ealdent-lda-ruby-0.3.1 ext/lda-ruby/cokus.h
lda-ruby-0.3.8 ext/lda-ruby/cokus.h
lda-ruby-0.3.7 ext/lda-ruby/cokus.h
lda-ruby-0.3.6 ext/lda-ruby/cokus.h
lda-ruby-0.3.5 ext/lda-ruby/cokus.h
lda-ruby-0.3.4 ext/lda-ruby/cokus.h
lda-ruby-0.3.1 ext/lda-ruby/cokus.h