Macros | Typedefs | Functions
mmc_rand_xorshift128p.h File Reference

An interface to use the SFMT-19937 random number generator. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Include dependency graph for mmc_rand_xorshift128p.h:

Go to the source code of this file.

Macros

#define inlinefun   static inline
 
#define MCX_RNG_NAME   "xorshift128+ RNG"
 
#define RAND_BUF_LEN   2
 
#define RAND_SEED_WORD_LEN   4
 

Typedefs

typedef unsigned long long RandType
 
typedef unsigned int uint
 

Functions

inlinefun void rng_init (RandType t[RAND_BUF_LEN], RandType tnew[RAND_BUF_LEN], uint *n_seed, int idx)
 
inlinefun void rand_need_more (RandType t[RAND_BUF_LEN], RandType tbuf[RAND_BUF_LEN])
 
inlinefun float rand_next_scatlen (RandType t[RAND_BUF_LEN])
 generate [0,1] random number for the next scattering length
 
inlinefun float rand_next_aangle (RandType t[RAND_BUF_LEN])
 generate [0,1] random number for the next arimuthal angle
 
inlinefun float rand_next_zangle (RandType t[RAND_BUF_LEN])
 generate random number for the next zenith angle
 
inlinefun float rand_next_reflect (RandType t[RAND_BUF_LEN])
 generate random number for reflection test
 
inlinefun float rand_do_roulette (RandType t[RAND_BUF_LEN])
 generate random number for the next zenith angle
 

Detailed Description

An interface to use the SFMT-19937 random number generator.