surfrand.h
#ifndef BGLIBS__SURFRAND__H__
#define BGLIBS__SURFRAND__H__
#include "surf.h"
struct surfrand
{
unsigned left;
uint32 generated[SURF_OUT_U32];
uint32 seed[SURF_SEED_U32];
uint32 counter[SURF_IN_U32];
};
void surfrand_init(struct surfrand* c, const uint32* data, unsigned words);
uint32 surfrand_uint32(struct surfrand* c);
double surfrand_double(struct surfrand* c);
void surfrand_fill(struct surfrand* c, unsigned char* buf, unsigned len);
uint32 surfrand_uniform(struct surfrand* c, uint32 bound);
#endif
surfrand
Definition: surfrand.h:10
surfrand_double
double surfrand_double(struct surfrand *c)
Definition: surfrand.c:93
surfrand_fill
void surfrand_fill(struct surfrand *c, unsigned char *buf, unsigned len)
Definition: surfrand.c:101
surfrand::generated
uint32 generated[SURF_OUT_U32]
Definition: surfrand.h:16
SURF_SEED_U32
#define SURF_SEED_U32
Definition: surf.h:14
surfrand::counter
uint32 counter[SURF_IN_U32]
Definition: surfrand.h:20
surfrand::left
unsigned left
Definition: surfrand.h:14
surfrand_uint32
uint32 surfrand_uint32(struct surfrand *c)
Definition: surfrand.c:81
SURF_OUT_U32
#define SURF_OUT_U32
Definition: surf.h:10
surfrand_uniform
uint32 surfrand_uniform(struct surfrand *c, uint32 bound)
Definition: surfrand.c:121
surfrand_init
void surfrand_init(struct surfrand *c, const uint32 *data, unsigned words)
Definition: surfrand.c:51
SURF_IN_U32
#define SURF_IN_U32
Definition: surf.h:12
surfrand::seed
uint32 seed[SURF_SEED_U32]
Definition: surfrand.h:18