The implementation looks good an a lot less heftier than what I was anticipating.
Good work, Brent Worden > -----Original Message----- > From: Phil Steitz [mailto:[EMAIL PROTECTED] > Sent: Sunday, May 15, 2005 1:39 PM > To: Jakarta Commons Developers List > Subject: Re: [math] Making PRNG pluggable in o.a.c.m.random classes > > I committed the changes described above. Feedback welcome. > I tested adapting and integration a RngPack generator. > Adaptor for Mersenne Twister looks like this (base adaptor > for all RngPack generators would be similar): > > /** > * AbstractRandomGenerator based on RngPack RanMT generator. > */ > public class TestRngPackGenerator extends AbstractRandomGenerator { > > private RanMT random = new RanMT(); > > public void setSeed(long seed) { > random = new RanMT(seed); > } > > public double nextDouble() { > return random.raw(); > } > > public double nextGaussian() { > return random.gaussian(); > } > > public int nextInt(int n) { > return random.choose(n); > } > > public boolean nextBoolean() { > return random.coin(); > } > } > > I will update the user guide to include this and other > examples assuming all are OK with these changes. > > Phil > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]