Navigation

Operators and Keywords

Function List:

C++ API

randmtzig.c File Reference

#include <stdio.h>
#include <time.h>
#include "lo-math.h"
#include "randmtzig.h"

Include dependency graph for randmtzig.c:


Defines

#define USE_X86_32   0
#define MT_M   397
#define MATRIX_A   0x9908b0dfUL
#define UMASK   0x80000000UL
#define LMASK   0x7fffffffUL
#define MIXBITS(u, v)   ( ((u) & UMASK) | ((v) & LMASK) )
#define TWIST(u, v)   ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
#define randi32   randmt
#define ZIGINT   uint64_t
#define EMANTISSA   9007199254740992.0
#define ERANDI   randi53()
#define NMANTISSA   EMANTISSA
#define NRANDI   randi54()
#define RANDU   randu53()
#define ZIGGURAT_TABLE_SIZE   256
#define ZIGGURAT_NOR_R   3.6541528853610088
#define ZIGGURAT_NOR_INV_R   0.27366123732975828
#define NOR_SECTION_AREA   0.00492867323399
#define ZIGGURAT_EXP_R   7.69711747013104972
#define ZIGGURAT_EXP_INV_R   0.129918765548341586
#define EXP_SECTION_AREA   0.0039496598225815571993

Functions

void oct_init_by_int (uint32_t s)
void oct_init_by_array (uint32_t *init_key, int key_length)
void oct_init_by_entropy (void)
void oct_set_state (uint32_t *save)
void oct_get_state (uint32_t *save)
double oct_randu (void)
double oct_randn (void)
double oct_rande (void)
void oct_fill_randu (octave_idx_type n, double *p)
void oct_fill_randn (octave_idx_type n, double *p)
void oct_fill_rande (octave_idx_type n, double *p)

Define Documentation

#define EMANTISSA   9007199254740992.0

#define ERANDI   randi53()

#define EXP_SECTION_AREA   0.0039496598225815571993

#define LMASK   0x7fffffffUL

#define MATRIX_A   0x9908b0dfUL

#define MIXBITS ( u,
 )     ( ((u) & UMASK) | ((v) & LMASK) )

#define MT_M   397

#define NMANTISSA   EMANTISSA

#define NOR_SECTION_AREA   0.00492867323399

#define NRANDI   randi54()

#define randi32   randmt

#define RANDU   randu53()

#define TWIST ( u,
 )     ((MIXBITS(u,v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))

#define UMASK   0x80000000UL

#define USE_X86_32   0

#define ZIGGURAT_EXP_INV_R   0.129918765548341586

#define ZIGGURAT_EXP_R   7.69711747013104972

#define ZIGGURAT_NOR_INV_R   0.27366123732975828

#define ZIGGURAT_NOR_R   3.6541528853610088

#define ZIGGURAT_TABLE_SIZE   256

#define ZIGINT   uint64_t


Function Documentation

void oct_fill_rande ( octave_idx_type  n,
double p 
)

void oct_fill_randn ( octave_idx_type  n,
double p 
)

void oct_fill_randu ( octave_idx_type  n,
double p 
)

void oct_get_state ( uint32_t *  save  ) 

void oct_init_by_array ( uint32_t *  init_key,
int  key_length 
)

void oct_init_by_entropy ( void   ) 

void oct_init_by_int ( uint32_t  s  ) 

double oct_rande ( void   ) 

double oct_randn ( void   ) 

double oct_randu ( void   ) 

void oct_set_state ( uint32_t *  save  )