38 #ifndef _MCEXTREME_SFMT_RAND_H 39 #define _MCEXTREME_SFMT_RAND_H 46 #define inlinefun static inline 49 typedef unsigned long long RandType;
50 typedef unsigned int uint;
52 #if defined(_WIN32) || defined(__APPLE__) 53 typedef unsigned long long ulong;
56 #define MCX_RNG_NAME "xorshift128+ RNG" 57 #define RAND_BUF_LEN 2 //register arrays 58 #define RAND_SEED_WORD_LEN 4 //48 bit packed with 64bit length 60 inlinefun
void rng_init(RandType t[RAND_BUF_LEN], RandType tnew[RAND_BUF_LEN], uint* n_seed,
int idx);
62 inlinefun
void rand_need_more(RandType t[RAND_BUF_LEN], RandType tbuf[RAND_BUF_LEN]);
72 #ifdef MMC_USE_SSE_MATH 73 inlinefun
void rand_next_aangle_sincos(RandType t[RAND_BUF_LEN],
float* si,
float* co);
74 inlinefun
float rand_next_scatlen_ps(RandType t[RAND_BUF_LEN]);
inlinefun float rand_next_reflect(RandType t[RAND_BUF_LEN])
generate random number for reflection test
Definition: mmc_rand_common.h:58
inlinefun float rand_do_roulette(RandType t[RAND_BUF_LEN])
generate random number for the next zenith angle
Definition: mmc_rand_common.h:62
inlinefun float rand_next_scatlen(RandType t[RAND_BUF_LEN])
generate [0,1] random number for the next scattering length
Definition: mmc_rand_common.h:46
inlinefun float rand_next_zangle(RandType t[RAND_BUF_LEN])
generate random number for the next zenith angle
Definition: mmc_rand_common.h:54
inlinefun float rand_next_aangle(RandType t[RAND_BUF_LEN])
generate [0,1] random number for the next arimuthal angle
Definition: mmc_rand_common.h:50