This page is outdated, since starting with IDL 5.6, most of the LAPACK routines are supported natively. However, for users of older IDL version the following might still be useful.


LAPACK for IDL

Unluckily, IDL is not too powerful when dealing with linear algebra problems. Many of the build-in linear algebra routines are implemented in IDL itself, and therefore not very efficient. For processing SAR data, often the a specific operation has to be performed nearly on every single pixel, and this can take very long when using them. Another problem is, that not all of the build-in routines work with complex input.

A nice and efficient solution for this is to use an external linear algebra library, like LAPACK, via the call_external() command. As the human interface to LAPACK can be quite annoying for an IDL user, I wrote a small wrapper in C to simplify the calling process. For example, with this interface you can calculate the eigenvectors and eigenvalues of a complex 3x3 matrix simply by:

dummy=call_external("liblidl.so","c_eigen_all",matrix,3l,e_val,e_vec)

Speed:

The speed improvement is significant. Calculating the eigenvector / eigenvalues of one million random complex 3x3 matrices, I obtain the following results:

Routines:

Currently only the LAPACK functions are implemented, which were of particular interest for me:

Of course, all the other LAPACK routines can also be called, using directly the LAPACK libraries. But of course only using the normal, not simplified way. Maybe I'll add some more routines to the wrapper in the future, but don't thrust me too much on this. I would appreciate very much any contribution.

Installation:

Quite simple. First you need to have the CLAPACK libraries (version 3 or later). This is the C version of LAPACK, in particular you need the files "blas.a", "lapack.a", "libF77.a" and "libI77.a". Please refer to the manual of CLAPACK how to compile them. Unpack the lidl-archive and copy these four files into the resulting lidl-directory. Type "make". This compiles "lidl.so". Then place "lidl.so" at a place where IDL will find it.

Alternatively you can take directly the pre-compiled library (only for linux-i386), available for download. That's all.

Download:

Todo:

It doesn't work?