Newbie question: Random numbers.
I have a simple question, is there a very fast and effecient way to generate
random numbers that are fast on the fly. The numbers are really randomize
and distorted...
/***************************************************
* generates a random number between a and b *
* @param a the starting range *
* @param b the integer ending range *
* @return N such that a <= N <= b *
**************************************************/
template <class T>
T randint(const T& a, const T& b)
{
BOOST_STATIC_ASSERT(boost::is_integral<T>::value);
assert (b >= a);
typedef boost::minstd_rand base_generator_type;
typedef boost::uniform_int<> distribution_type;
typedef boost::variate_generator
participants (1)
-
chun ping wang