Re: Linear Algebra
Bruce J. Weimer, MD <bjweimer <at> charter.net> writes:
>
>
> I'm using LWWPE. Can anyone recommend a
> (preferably free) linear algebra package? I've Googled some, but I'd
> prefer a specific recommendation - if anyone has experience with one that
> they particularly like?
>
> Thanks in advance.
>
> Bruce.
>
>
Bruce,
I've done some research on this. It would help if you could provide
the list with what your requirements are. Do you need sparse
matrices, dense ones, what kinds of operations do you need to perform,
how big are the matrices, etc.
Generally, it would be nice if Matlisp was supported, because I've
found that floating point math isn't as fast as with CMUCL or SBCL.
This would be my favorite option, if it existed. I've looked into
what it would take to port Matlisp to LispWorks. The Matlisp ffi
interface is abstracted pretty well into a single file per
implementation. Being somewhat familiar with LispWork's ffi, I
estimated it be at least several days of solid work, if there's not
show stopper issues.
You might want to ask the same question in the Matlisp user group, as
sometimes there are general discussions about linear algebra and Lisp
there. You might also want to ask if someone's already ported Matlisp
to LispWorks and would be willing to share it.
Without knowing your requirements, here's some other options:
Femlisp. It's pretty full featured and has a subset of what's defined
in Matlisp, although written in CL. As the author points out, Femlisp
using LispWorks will be slow. As an example, solving a system of 1000
equations using Matlisp/CMUCL using LAPACK takes about 2.5 seconds and
0.5 seconds if built with ATLAS. Solving the same size system using
Femlisp/LispWorks takes about 120 seconds and 4 seconds on
SBCL/Femlisp. MATLAB on the same computer & OS takes about 0.5
seconds as well, since it internally uses ATLAS that's not suprising.
I've noticed this same 10-20x speed difference in some of the computer
language shootout benchmarks as well.
Note that Femlisp isn't officially supported for LispWorks, as it took
about 5 very trivial modifications to get it to build.
Another not free, but inexpensive option is to get the Numerical
Recipies CDROM. It's rarely mentioned, but it has Common Lisp
translations of all of the functions in the Fortran 1st edition. You
can't freely distribute it, but if you're just running privately, that
might work for you. I've examined and slightly tested its code and
you'll have the same slowness on LW that Femlisp has.
The CLEM package has some basic matrix operations, nothing like
solving linear systems of equations, but if your needs are light it
might be ok.
NLISP is coming along nicely. It's architected to bind to the GNU GSL
library. It currently works with CMUCL, but the author just ported it
to the new CFFI package which does have LispWorks support.
Good luck.
Glenn Ehrlich