Math::GSL is still in active development and we have been working hard to make sure that it is compatible with the most recent GSL, which is 1.12 released on Dec 16 2008. This release is mostly for CPANTesters to see what bugs they can shake out of it, but it contains these tasty features:

Compare this new script for calculating eigenvalues and eigenvectors of a nonsymmetric matrix to the old version. Yes, quite an improvement and quite pleasing to the eye now.
Note that $A->eigenvalues; returns a list of Math::Complex objects because in general the eigenvalues of a real matrix can be complex. Only if your matrix is symmetric are you guaranteed real eigenvalues.

I haven't been able to add code to Math::GSL since about a month because of a tricky bug I had with the build process. Not only was it tricky, it was well hidden and pretty stupid to fix once I saw it.

Now that it's fixed I've been able to commit some code concerning overloading operators + and - in Math::GSL::Matrix. It's been tested and documented but it could still enjoy more documentation. End term exams are coming pretty fast to me so I won't finish overloading multiplication of matrices before one or two weeks.

Yes, it has been quiet here but development on Math::GSL has steadily continued behind-the-scenes. I just pushed a dev release (0.15_04) to CPAN, it should be hitting a mirror near you soon. If the CPANTesters don't find anything horribly wrong with it, it will probably become 0.16. Some new features of 0.16 will be:

All test files now keep track of how many tests should run and other important infrastructure changes

Only a few of the changes are user-facing but they are important in terms of the long-term development and health of Math::GSL.

While I have been making these back-end changes I have been prototyping a web-based interface to Math::GSL using jQuery. I have many functional parts but no coherent interface that I am willing to inflict on users. But I promise you that soon you will be able to use Math::GSL via your browser and bypass the whole "what-do-you-mean-i-have-to-compile-it" issue.

After a question arose recently about finding complex eigenvalues of non-symmetric matrices, I wrote this example to show how it can be done with Math::GSL. The current example is called examples/matrix/nonsymmetric_eigen in the Math::GSL source, which will be in the 0.16 Math::GSL release. It uses the gsl_eigen_nonsymmv() function to do all the hard work, the rest is twiddling complex numbers. The documentation for this can be found with perldoc Math::GSL::Eigen or here.(The HTML rendering of the POD needs some work...) You can read the original C documentation for this function here.

It is a well known theorem of linear algebra that symmetric matrices can have only real eigenvalues. Thus it is much easier to find eigenvalues of symmetric matrices because there is no possibility of complex numbers arising. You can do this with Math::MatrixReal, which is written in pure-Perl.

The output of examples/matrix/nonsymmetric_eigen looks like:

Finding eigenvalue/eigenvectors for

[ 0 -1 ]

[ 1 0 ]

Eigenvectors:

u = (0.707106781186547,-0.707106781186547i)

v = (0.707106781186547,0.707106781186547i)

Eigenvalues:

lambda_0 = i

lambda_1 = -i

By the way, sqrt(2)/2 = 0.707106...

I am not quite happy with how long the program is, mainly because I have not written a Perlish interface around Complex Vectors and Matrices yet, so it is all in that script right now. The stringification could be built into the object and therefore reduce the length of that code dramatically.

13731 lines - POD (this actually includes some Perl implementation, probably <5%). Much of this was autogenerated from the GSL C documentation and reformatted, but it stills needs work, especially in making the POD render to HTML in a more pleasant way.

The reason why Math::GSL requires something like SWIG becomes very apparent. The SWIG interface files are roughly 1/280th the length of the raw XS source code. No reasonable person would be hacking on Perl internals, but not even a reasonable Perl hacker wants to write all that error checking boilerplate cruft. Thanks SWIG!

This was made possible by ripping all Perl code out of the SWIG interface files and putting them in the pod/ directory. It is not strictly POD but a simple naming scheme was key and the majority of the files do happen to be POD, so whatev. And now vim correctly syntax highlights the files! I think there is something to be said for sticking to one language per file.

I took a bit of a break after releasing Math::GSL 0.14 and tried not to stare at a screen too much during the GSOC08 conference, when I could be interacting with open source developers from around the world IRL. I met developers from Git, Xmms2, VLC, PHP, Zikula, OpenAFS, Boost, Jikes RVM, Squeak, MusicBrainz, Worldforge, Minix3, the list goes on. People shared many ideas about making sustainable open source projects, getting and keeping members in your community and dealing with "troublesome" members. Daniel Svensson from Xmms2 also showed me some git-fu relating to rebasing.

But that doesn't mean that Math::GSL development has come to a halt! Since 0.14 Thierry added operator overloading for addition in Vector. This sparked my interest and I then did subtraction. The current code will vectorize operations that you learn "don't make sense" in grade school, such as: $v - 5 , where v is a vector. Math::GSL will go ahead and subtract 5 from every element in $v. You can also do 2 + $v and you will get a new vector where 2 has been added to each element of $v.

Also, I reorganized the directory structure so that all SWIG interface files are now in the swig/ subdirectory, instead of clogging up the root directory. All SWIG-generated XS code and object files are thrown in there as well. This should make the Math::GSL codebase easier to navigate.