简体   繁体   中英

linear_congruential library in boost

I am trying to use random::linear_congruential in boost (http://www.boost.org/doc/libs/1_33_1/libs/random/random-generators.html#linear_congruential) to generate uniform random numbers. The declaration is defined as:

template<class IntType, IntType a, IntType c, IntType m, IntType val>

Does anyone know what the last parameter IntType val means? It is not documented and I could not find any reference. I am setting up my parameters as follows but don't understand how to set val:

random::linear_congruential<long, 39373L, 0, 2147483647L, ??> generator;

Given seed = 1, the 10,000th value returned by the generator must be val . This is apparently a common practice among PRNG implementors to use the 10,000th value as a test.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM