
1 Jun
2006
1 Jun
'06
11:07 a.m.
Maybe I'm missing something, but the implementation of the exponential dsitribution looks like this: template<class Engine> result_type operator()(Engine& eng) { return -result_type(1) / _lambda * log(result_type(1)-eng()); } That seems to assume that the Engine has a rane of [0, 1). Certainly if I pass it in (say) a mt19937 engine it goes rather badly wrong, attempting to take the log of a large negative number. But the documentation contains no such requirement - it merely says it needs a UniformRandomNumberGenerator, which explicitly allows for any range. - Alan