30 #ifndef FLAGACCEPTEDREJECTED_H_
31 #define FLAGACCEPTEDREJECTED_H_
36 #include <thrust/random.h>
61 a = (a + 0x7ed55d16) + (a << 12);
62 a = (a ^ 0xc761c23c) ^ (a >> 19);
63 a = (a + 0x165667b1) + (a << 5);
64 a = (a + 0xd3a2646c) ^ (a << 9);
65 a = (a + 0xfd7046c5) + (a << 3);
66 a = (a ^ 0xb55a4f09) ^ (a >> 16);
76 thrust::default_random_engine randEng(seed);
77 thrust::uniform_real_distribution<GReal_t> uniDist(0.0, wmax);
80 GBool_t flag = (uniDist(randEng) < weight) ? 1 : 0;
FlagAcceptReject(const GReal_t _wmax)
FlagAcceptReject constructor.
__host__ __device__ GBool_t operator()(GLong_t idx, GReal_t weight)
operator().
long GLong_t
Signed long integer 4 bytes (long)
unsigned int GUInt_t
Unsigned integer 4 bytes (unsigned int)
bool GBool_t
Boolean (0=false, 1=true) (bool)
GReal_t wmax
maximum weight
Flags generated events as accepted (1) or rejected (0).
double GReal_t
Double 8 bytes or float 4 bytes.
__host__ __device__ GUInt_t hash(GUInt_t a)
hash function.