36 #include <cugar/basic/types.h> 61 #define CUGAR_RAND_A 1664525 62 #define CUGAR_RAND_C 1013904223 68 static const uint32 MAX = 0xFFFFFFFF;
70 CUGAR_FORCEINLINE CUGAR_HOST_DEVICE
IRandom(
const uint32 s = 0) : m_s(s) {}
72 CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 next() { m_s = m_s*CUGAR_RAND_A + CUGAR_RAND_C;
return m_s; }
81 CUGAR_FORCEINLINE CUGAR_HOST_DEVICE
Random(
const uint32 s = 0) : m_irand(s) {}
83 CUGAR_FORCEINLINE CUGAR_HOST_DEVICE
float next() {
return float(m_irand.next())/
float(IRandom::MAX); }
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38