randmt.c File Reference

#include "bu.h"
#include "bn.h"
Include dependency graph for randmt.c:

Go to the source code of this file.

Data Structures

struct  _internal_state_s

Defines

#define N   624
#define M   397
#define MATRIX_A   0x9908b0df
#define UPPER_MASK   0x80000000
#define LOWER_MASK   0x7fffffff
#define TEMPERING_MASK_B   0x9d2c5680
#define TEMPERING_MASK_C   0xefc60000
#define TEMPERING_SHIFT_U(y)   (y >> 11)
#define TEMPERING_SHIFT_S(y)   (y << 7)
#define TEMPERING_SHIFT_T(y)   (y << 15)
#define TEMPERING_SHIFT_L(y)   (y >> 18)
#define MERSENNE_MAGIC   0x4D54524E

Functions

void * bn_randmt_state_create ()
void bn_randmt_state_seed (struct _internal_state_s *is, uint32_t seed)
double bn_randmt_state (struct _internal_state_s *is)
void bn_randmt_state_serialize (struct _internal_state_s *UNUSED(is), struct bu_vls *UNUSED(s))
void bn_randmt_state_deserialize (struct _internal_state_s *UNUSED(is), struct bu_vls *UNUSED(s))
void bn_rand_mt_state_set_global (struct _internal_state_s *is)
void bn_randmt_seed (unsigned long seed)
double bn_randmt ()

Define Documentation

#define N   624
#define M   397

Definition at line 39 of file randmt.c.

#define MATRIX_A   0x9908b0df

Definition at line 40 of file randmt.c.

Referenced by bn_randmt_state().

#define UPPER_MASK   0x80000000

Definition at line 41 of file randmt.c.

Referenced by bn_randmt_state().

#define LOWER_MASK   0x7fffffff

Definition at line 42 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_MASK_B   0x9d2c5680

Definition at line 46 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_MASK_C   0xefc60000

Definition at line 47 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_SHIFT_U ( y   )     (y >> 11)

Definition at line 48 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_SHIFT_S ( y   )     (y << 7)

Definition at line 49 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_SHIFT_T ( y   )     (y << 15)

Definition at line 50 of file randmt.c.

Referenced by bn_randmt_state().

#define TEMPERING_SHIFT_L ( y   )     (y >> 18)

Definition at line 51 of file randmt.c.

Referenced by bn_randmt_state().

#define MERSENNE_MAGIC   0x4D54524E

Definition at line 53 of file randmt.c.

Referenced by bn_randmt_state_create().


Function Documentation

void* bn_randmt_state_create (  ) 

Definition at line 64 of file randmt.c.

References MERSENNE_MAGIC, and N.

void bn_randmt_state_seed ( struct _internal_state_s *  is,
uint32_t  seed 
)

Definition at line 78 of file randmt.c.

References N.

Referenced by bn_randmt_seed().

double bn_randmt_state ( struct _internal_state_s *  is  ) 

Definition at line 92 of file randmt.c.

References bn_randmt_seed(), LOWER_MASK, M, MATRIX_A, N, TEMPERING_MASK_B, TEMPERING_MASK_C, TEMPERING_SHIFT_L, TEMPERING_SHIFT_S, TEMPERING_SHIFT_T, TEMPERING_SHIFT_U, UPPER_MASK, and y.

Referenced by bn_randmt().

Here is the call graph for this function:

void bn_randmt_state_serialize ( struct _internal_state_s *  UNUSEDis,
struct bu_vls *  UNUSEDs 
)

Definition at line 133 of file randmt.c.

void bn_randmt_state_deserialize ( struct _internal_state_s *  UNUSEDis,
struct bu_vls *  UNUSEDs 
)

Definition at line 139 of file randmt.c.

void bn_rand_mt_state_set_global ( struct _internal_state_s *  is  ) 

Definition at line 145 of file randmt.c.

Generated on Tue Dec 11 13:14:28 2012 for LIBBN by  doxygen 1.6.3