commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject Re: [Lang] proposed math extensions
Date Wed, 07 May 2003 04:21:17 GMT
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
( 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 non-positive 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 [math-stat].  I am a
mathematician by training, though, like Henri, not a numerical analyst,
so my own contributions would be limited to simple implementations of
well-known 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 [commons-math] 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 Jakarta-Commons?


> Stephen
> ----- Original Message -----
> From: "Phil Steitz" <>
> To: "Jakarta Commons Developers List" <>
> 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 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.
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message