D-Programming-Language/phobos — pull request #727 by monarchdodra (2012-07-30 10:57:41+00:00)
Title: Lagged Fibonacci Generator

Ported from boost:
http://www.boost.org/doc/libs/1_50_0/boost/random/linear_congruential.hpp

While boost provided two different classes for UInt/Real types, this implementation merges both into the same class.

My doubts on the implementation are:
*Aliases: Boost uses doubles as the defaults for the engine, and doesn't provide any aliases for the unsigned types. Should we follow the same scheme? Provided alliases for both?
*Default Alias: Not sure which config to use for the "LaggedFibonacci", so I chose LaggedFibonacci607, but documented it as "implementation chosen".
*Reference type & unseeded engine: The generator is a reference type forward range. In thoery, it can't be used until it has been seeded. I have put in asserts about this. Maybe it should be enforece instead?
*Boost provides a "generate" function, which is used to fill a range of integers. I did not write these, as they can be replaced by simply chosing the correct engine, an manually calling std.algo.fill.

Open to all suggestions/criticism, even the "minor" ones, such as documentation/licensing.