Added RNG unit test.

This commit is contained in:
Branimir Karadžić
2017-10-29 09:26:15 -07:00
parent 58c8c68062
commit bf39e556b0
3 changed files with 88 additions and 37 deletions

View File

@@ -28,25 +28,6 @@ namespace bx
return (m_z<<16)+m_w;
}
inline RngFib::RngFib(uint32_t _a, uint32_t _b)
: m_a(_a)
, m_b(_b)
{
}
inline void RngFib::reset(uint32_t _a, uint32_t _b)
{
m_a = _a;
m_b = _b;
}
inline uint32_t RngFib::gen()
{
m_b = m_a+m_b;
m_a = m_b-m_a;
return m_a;
}
inline RngShr3::RngShr3(uint32_t _jsr)
: m_jsr(_jsr)
{

View File

@@ -30,24 +30,6 @@ namespace bx
uint32_t m_w;
};
/// George Marsaglia's FIB
class RngFib
{
public:
///
RngFib(uint32_t _a = 9983651, uint32_t _b = 95746118);
///
void reset(uint32_t _a = 9983651, uint32_t _b = 95746118);
///
uint32_t gen();
private:
uint32_t m_a;
uint32_t m_b;
};
/// George Marsaglia's SHR3
class RngShr3
{