commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [Math] "RandomDataGenerator.nextInt" vs "UniformIntegerDistribution.sample"
Date Mon, 29 Jul 2013 14:06:09 GMT
On 7/25/13 4:50 AM, Gilles wrote:
> Hi.
>
> The classes
>   RandomDataGenerator
> and
>  UniformIntegerDistribution
> use different codes for providing random integers in a range.
>
> Shouldn't the same code be used in both?
> Are both equally valid on the whole integer range?

The version in RandomDataGenerator is more robust (see MATH-936). 
Probably the impl there should be moved to the sample method of
UniformIntegerDistribution and RandomDataGenerator should create and
use a UIDist instance.

Phil
>
>
> Regards,
> Gilles
>
> [1] Or better (IMO) shouldn't "RandomDataGenerator" be a client
>     of "UniformIntegerDistribution"?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message