Java GNU Scientific Library 0.1.0 released

I have released version 0.1.0 of the Java GNU Scientific Library (JGSL) project, its first public release. You can download it from here.

This first release provides Java wrapper classes for the Special Functions module of the GNU Scientific Library (log, exp, airy, bessel, etc). I’ve run some preliminary tests on the log function, that suggest the JGSL version are about 10% faster than Java’s built-in function.

Java GNU Scientific Library project update

The GNU Scientific Library (GSL) is a rich state-of-the-art C library of mathematical routines. Pretty much everything you could think of—special functions, linear algebra, function optimization, fast Fourier transforms, and much, much more—is covered by this library.

I have taken over the open-source Java GNU Scientifc Library project at SourceForge. The plan is to write a Java wrapper around this library and make it available for Java developers. There is, for the time being, strictly nothing to see on SourceForge—I’m still planning this whole thing.

I have done some preliminary testing and compared the speed for calculating natural logarithms. I wrote the appropriate JNI wrappers and this test class:

import java.util.Random;
public class LogTest {
public static void main(String argv[]) {
        System.loadLibrary("gsl_sf_log");
        double[] sample = new double[5000000];
        Random rnd = new Random();
        for (int i=0; i<sample.length; i++) {
            sample[i] = rnd.nextDouble();
        }
        double tmp;
        long tic = System.currentTimeMillis();
        for (int i=0; i<sample.length; i++) {
            tmp = Math.log(sample[i]);
        }
        long toc = System.currentTimeMillis();
        System.out.println("Built-in log: " + (toc-tic) + " ms.");
        tic = System.currentTimeMillis();
        for (int i=0; i<sample.length; i++) {
            tmp = gsl_sf_log.gsl_sf_log(sample[i]);
        }
        toc = System.currentTimeMillis();
        System.out.println("GSL log: " + (toc-tic) + " ms.");
    }
}

In this program I time the computation of five million randomly chosen doubles between 0 and 1, first with Java’s built-int Math.log function (which I understand is based on netlib), and then with GSL’s. This is the output:

[lindelof@lesopriv3 jgsl_test]$ java -D -Djava.library.path=./ LogTest
Built-in log: 1327 ms.
GSL log: 1164 ms.

Not a big difference, except the GSL version runs slightly faster.

My idea is to cross-compile the GSL library and its Java wrappers, at least for the i386 and arm targets, and package it together with the Java classes in target-specific jarfiles.

The idea is to start work on this right after I finish writing my PhD manuscript, by the end of June at the latest. Help and contributions welcome. I will regularly post updates about this project in this column.

IBPSA Swiss regional affiliate created

The first General Assembly of IBPSA-CH took place on 1 September 2006 in Lucerne, Switzerland, at the University of Applied Sciences. International Building Performance Simulation Association, the biggest international society of building performance simulation professionals, has now affiliates in sixteen countries or regions.
This first General Assembly focused on presenting the goals and projects of IBPSA-CH. All participating individuals being automatically members, we reviewed and voted on the proposed bylaws of the new association (which can be found on the association’s website above).

Darren Robinson, Jessen Page and yours truly represented LESO-PB.