00001
00013
00019 #ifndef _MCEXTREME_LOGISTIC_RAND_H
00020 #define _MCEXTREME_LOGISTIC_RAND_H
00021
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 #include <math.h>
00025
00026 #define __device__ static inline
00027
00028 #ifndef DOUBLE_PREC_LOGISTIC
00029 typedef float RandType;
00030 #else
00031 typedef double RandType;
00032 #endif
00033
00034 #define MCX_RNG_NAME "Logistic-Lattice"
00035
00036 #define RAND_BUF_LEN 5 //register arrays
00037 #define RAND_SEED_LEN 5 //32bit seed length (32*5=160bits)
00038
00039 __device__ void rand_need_more(RandType t[RAND_BUF_LEN],RandType tbuf[RAND_BUF_LEN]);
00040 __device__ void logistic_init(RandType *t,RandType *tnew,uint seed[],uint idx);
00041
00042 __device__ RandType rand_uniform01(RandType v);
00043 __device__ void rng_init(RandType t[RAND_BUF_LEN], RandType tnew[RAND_BUF_LEN],uint *n_seed,int idx);
00044
00045
00046 __device__ float rand_next_scatlen(RandType t[RAND_BUF_LEN]);
00047
00048 __device__ float rand_next_aangle(RandType t[RAND_BUF_LEN]);
00049
00050 __device__ float rand_next_zangle(RandType t[RAND_BUF_LEN]);
00051 __device__ float rand_next_reflect(RandType t[RAND_BUF_LEN]);
00052 __device__ float rand_do_roulette(RandType t[RAND_BUF_LEN]);
00053 #endif