QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
mersenne-twister.cpp File Reference
#include <stdio.h>
#include "mersenne-twister.h"
Include dependency graph for mersenne-twister.cpp:

Macros

#define M32(x)   (0x80000000 & x)
#define L31(x)   (0x7FFFFFFF & x)
#define ODD(x)   (x & 1)
#define MD_UINT32_MAX   std::numeric_limits<uint32_t>::max()
#define UNROLL

Functions

static void generate_numbers ()
void seed (uint32_t value)
uint32_t rand_u32 ()
int mt_rand ()
void mt_srand (unsigned value)
float randf_cc ()
float randf_co ()
float randf_oo ()
double randd_cc ()
double randd_co ()
double randd_oo ()
uint64_t rand_u64 ()

Variables

static const unsigned SIZE = 624
static const unsigned PERIOD = 397
static const unsigned DIFF = SIZE - PERIOD
static uint32_t MT [SIZE]
static unsigned index = 0

Macro Definition Documentation

#define L31 (   x)    (0x7FFFFFFF & x)
#define M32 (   x)    (0x80000000 & x)
#define MD_UINT32_MAX   std::numeric_limits<uint32_t>::max()
#define ODD (   x)    (x & 1)
#define UNROLL
Value:
y = M32(MT[i]) | L31(MT[i+1]); \
MT[i] = MT[i-DIFF] ^ (y>>1) ^ MATRIX[ODD(y)]; \
++i;

Function Documentation

static void generate_numbers ( )
inlinestatic
int mt_rand ( )
void mt_srand ( unsigned  value)
uint32_t rand_u32 ( )
uint64_t rand_u64 ( )
double randd_cc ( )
double randd_co ( )
double randd_oo ( )
float randf_cc ( )
float randf_co ( )
float randf_oo ( )
void seed ( uint32_t  value)

Variable Documentation

const unsigned DIFF = SIZE - PERIOD
static
unsigned index = 0
static
uint32_t MT[SIZE]
static
const unsigned PERIOD = 397
static
const unsigned SIZE = 624
static