
2010.03.25 19:50, Steven Watanabe rašė:
AMDG Ad maiorem
For validation, Boost.Random uses the 10,000th value produced by a default constructed generator.
It certainly matches.
Some notes: 1) Initialization is pretty fast. To initialize NB2 state is a lot of work, and some of it is alleviated by (I hope) judicious use of metaprogramming. I did not measure really rigorously, but the impression is that initialization is about twice as fast.
This is fine. Generators should not generally be initialized very often.
Agreed.
2) I am not exactly a Boost.Random guru, so I probably missed some conceptual requirements, but it works just fine with uniform_01 template (see dim2demo.cpp).
A few things that you could add a) non-default seeding. b) stream operators.
Non default seeding is an interesting question in this case, because it is not really clear whether this means "allow the user to initialize the lattice as she wishes", because in this case we would (potentially) lose quasirandomness, which is the whole point of this generator, or does this mean "allow the user to initialize the current state"? This could probably be used to fast-forward to the desired state, but I am not sure that semantically this is the same as "seeding". I think the latter would be The Right Thing in case of streaming.
Would you be willing to write documentation for this as well?
Certainly. I think I will come up with something by the next week. J.