Stephen Colebourne wrote:
> In theory, much of this sounds useful. However the problem is where to stop.
> A maths library could grow and grow to be bigger than [lang] itself. So care
> must be taken.
>
> Some of the simpler addditions to RandomUtils sound fine. Reseeding, extra
> methods etc.
>
> I am less sure about the need for Gaussian, Exponential, Poisson, Binomial,
> Geometric, or HyperGeometric distribution random numbrs  I don't even know
> what most of these are. The solution may be to have a plugin style, that can
> generate numbers from Random, SecureRandom or any of the above
> distributions.
>
> Computing densities and statistitics sounds out of scope for [lang] to
> me.
>
> Given this, perhaps you could discuss each item/submit small patches with
> test cases to gradually introduce those features that make sense.
>
Based on all the feedback below, I will take this approach, at least
regarding [lang]. I have already submitted one small patch
(http://issues.apache.org/bugzilla/show_bug.cgi?id=19365) and I will
follow this post with a sequence of small extensions to what is already
in [lang.math] including patches and test cases. I will stick to things
that just logially complete what is already there. I assume that the
right way to do this is by submitting the patches + test cases as
Bugzilla bug reports. The patch referenced above adds nextLong(n) plus
a math test suite. It also modifies nextInt(n) to throw an
IllegalArgumentException if n<=0. Since this last item could break code
that uses nextInt with nonpositive arguments, I am not sure in
retrospect if that was the best thing to do. Should I submit a revised
patch to the ticket with the IllegalArgumentException removed?
I am interested in also discussing [math] or [mathstat]. I am a
mathematician by training, though, like Henri, not a numerical analyst,
so my own contributions would be limited to simple implementations of
wellknown algorithms for common problems and reviewing code/test
cases/docs for more complex algorithms implemented by others. I have
implemented several of these things myself since either a) I could not
find OS implementations that did what I needed or b) what I could find
had extra baggage (sometimes legal :) attached that made it difficult
to use.
I am pretty much an OS newbie in terms of contribution, so I would need
some help/gentle guidance getting something like [commonsmath] going,
but I am willing to put some time into it and help out in any way that I
can. How exactly would something like this get started? Should I start
by preparing a proposal based on the idea of starting with lang.math and
adding some simple stat and numerical analysis extensions? Or is this
just not something suitable for JakartaCommons?
Phil
> Stephen
>
>  Original Message 
> From: "Phil Steitz" <phil@steitz.com>
> To: "Jakarta Commons Developers List" <commonsdev@jakarta.apache.org>
> Sent: Sunday, April 27, 2003 8:36 PM
> Subject: [Lang] proposed math extensions
>
>
>
>>I have code (and tests :) for each of the following that I would be
>>willing to contribute. Is any of this appropriate for lang.math?
>>
>>1. Generate random numbers from Gaussian, Exponential, Poisson,
>>Binomial, Geometric, or HyperGeometric distributions.
>>2. Use SecureRandom to provide cryptographically secure random sequences
>>for each of the above, plus the stuff already in RandomUtils, plus
>>secure random strings (useful for generating "unpredictable" session id's)
>>3. Compute binomial coeffiecients and binomial, geometric,
>>hypergeometric densities
>>4. Generate univariate statistics or frequency distributions from input
>
> data
>
>>I could include the stuff in 1.as a patch to math.RandomUtils. Not sure
>>where (if anywhere) the other things belong.
>>
>>I would also like to see math.RandomUtils modified to support the
>
> following:
>
>>a) reseeding the Random number generator. I could submit a patch to do
>>this by adding a static Random to use in generating the uniform variates
>>in place of math.random().
>>b) add nextInt(min,max) (inclusive) and/or nextInt(IntRange r)
>>I could submit a patch for this small extension as well.
>>
>>Phil
>>
>>
>>
>>To unsubscribe, email: commonsdevunsubscribe@jakarta.apache.org
>>For additional commands, email: commonsdevhelp@jakarta.apache.org
>>
>
>

To unsubscribe, email: commonsdevunsubscribe@jakarta.apache.org
For additional commands, email: commonsdevhelp@jakarta.apache.org
