我正在尝试使用boost (http://www.boost.org/doc/libs/1_33_1/libs/random/random-generators.html#linear_congruential)中的random::linear_congruential来生成均匀随机数。声明定义为:
template<class IntType, IntType a, IntType c, IntType m, IntType val>有人知道最后一个参数IntType val是什么意思吗?它没有文档,我也找不到任何参考资料。我的参数设置如下,但不知道如何设置val:
random::linear_congruential<long, 39373L, 0, 2147483647L, ??> generator;发布于 2010-10-13 04:06:57
给定seed = 1,生成器返回的第10,000个值必须为val。这显然是PRNG实现者使用第10,000个值作为测试的常见做法。
https://stackoverflow.com/questions/3918344
复制相似问题