commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <>
Subject Re: [math] Bessel functions
Date Mon, 25 Nov 2013 14:36:18 GMT
On Mon, 25 Nov 2013 08:46:46 -0500, Brian Wignall wrote:
> Hello, everyone.
> I am new and hoping to make my first contribution. I read through the 
> Wish
> List, and I thought I could help quickly by starting with the special
> functions request.

Thanks for your interest in Commons Math.
Contributions are very welcome, but contributors even more so.

By this, I mean that the most important thing is not to increase the
codebase, but to make it so that it is gracefully integrated in the

I did not read your patch in detail, but it is enough to already detect
the drawbacks of automated translation from Fortran.
[We have an unfortunate example of this in the class 

A few remarks (in no particular order):
* Existing functionality must be reused (e.g. "factorial").
* Public instance variables are forbidden.
* Variable name must not contain underscores (unless it is a global 
* Variables must be defined at the smallest possible scope and must 
   names as meaningful as possible (unlike customary in Fortran!).
* Commons Math's exception must be used exclusively.
* Global constants must be "final" (and their name must be in all 
* Operators must be surrounded by space characters.
* ...

IMO, a very important thing is to make the code as readable as 
I know that you had to work already to obtain this result from the 
of the translator, but some further improvements are needed so that the
contribution looks like a Java source coded from scratch.

Best regards,

> I created a JIRA ( 
> that
> contains a patch for Bessel functions of the first kind. There are 
> other
> Bessel functions that are relevant, but I figured I would post that, 
> to get
> (minor, hopefully) suggestions or tweaks to get it ready, to 
> streamline the
> process for other functions.
> The JIRA is a bit sparse, so some more details on the patch follow.
> Like several other open source packages, I started from Fortran code 
> in
> Netlib; in this case, . As a 
> first
> pass, I enabled the double-precision lines with IEEE values already 
> in the
> code and then put the Fortran code through f2j (
> This handled the straightforward 
> parts,
> but it left in gotos and some other bits that needed cleaning. 
> Getting the
> output of f2j to a decent place took more time and effort than I had
> anticipated, but it is passing the unit tests I put in (based on 
> output
> from R, which uses a translation of the same Fortran code).
> I am looking forward to hearing thoughts and suggestions.
> Kind regards,
> Brian

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

View raw message