rand/xorshift: throw on zero seed

zero seeds are a hard runtime error which shouldn't be compiled out in
release mode.
This commit is contained in:
Danny Robson 2016-07-01 16:25:48 +10:00
parent f741986c3f
commit 138cac23fe

View File

@ -28,8 +28,8 @@ template <typename T>
xorshift<T>::xorshift (T seed):
m_state (seed)
{
// state must not be zero, or the period will be zero.
CHECK_NEZ (m_state);
if (!m_state)
throw std::invalid_argument ("xorshift seed must not be zero");
}