[Random] uniform_int::operator()(Engine &, result_type)
Dear all, I was looking at the uniform_int<>'s reference page: http://www.boost.org/doc/libs/1_43_0/doc/html/boost/uniform_int.html and realised that there is no information whatsoever about what the following overload of its operator () does: template<typename Engine> result_type operator()(Engine & eng, result_type n) ; Do I understand it correctly that this generates a number in [min, n] (probably subject to some good conditions)? TIA, --Hossein
AMDG Hossein Haeri wrote:
I was looking at the uniform_int<>'s reference page:
http://www.boost.org/doc/libs/1_43_0/doc/html/boost/uniform_int.html
and realised that there is no information whatsoever about what the following overload of its operator () does:
template<typename Engine> result_type operator()(Engine & eng, result_type n) ;
Do I understand it correctly that this generates a number in [min, n] (probably subject to some good conditions)?
No. It generates a number in [0, n). The purpose of this
overload is to allow variate_generator
Dear Steven,
template<typename Engine> result_type operator()(Engine & eng, result_type n) ;
Do I understand it correctly that this generates a number in [min, n] (probably subject to some good conditions)?
No. It generates a number in [0, n).
Are you sure it's [0, n) rather than [0, n] -- the usual practice of Boost.Random? And, who should I remind to add the descriptions for this operator ()? Cheers, --Hossein
participants (2)
-
Hossein Haeri
-
Steven Watanabe