From: Paul Griffioen
Subject: Looking for linear algebra lib
Date: 
Message-ID: <b369e$43c68bb2$3ec27694$15357@news.chello.nl>
 
Hi everybody,

I need to solve a recursive linear matrix equation in Lisp so I googled 
around for libraries for Gauss-Jordan, linear algebra etc. but couldn't find 
anything usefull. What I found were mostly lecture notes, Fortran 
implementations or references to Mathematica etc., and no matter what I 
tried I could not filter the hits to Lisp stuff. Does anybody have any 
pointers?

I have some square matrix with the nr. rows/columns up to a few hundred 
items at most. Although I think the matrix is usually pretty sparse I'm not 
certain I want to make this assumption immediately. I think a LU factoring 
of this matrix would give me the solution I need but I want to experiment 
some more to see what is possible.

Any help or suggestions are appreciated.

Paul 

From: ··············@hotmail.com
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <1137087157.049279.88320@g14g2000cwa.googlegroups.com>
Paul Griffioen wrote:
> Hi everybody,
>
> I need to solve a recursive linear matrix equation in Lisp so I googled
> around for libraries for Gauss-Jordan, linear algebra etc. but couldn't find
> anything usefull. What I found were mostly lecture notes, Fortran
> implementations or references to Mathematica etc., and no matter what I
> tried I could not filter the hits to Lisp stuff. Does anybody have any
> pointers?


http://matlisp.sourceforge.net/ is a Lisp wrapper around BLAS and
LAPACK.
From: Thomas A. Russ
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <ymiy81lgru8.fsf@sevak.isi.edu>
"Paul Griffioen" <·@dont.want.spam> writes:

> Hi everybody,
> 
> I need to solve a recursive linear matrix equation in Lisp so I googled 
> around for libraries for Gauss-Jordan, linear algebra etc. but couldn't find 
> anything usefull. What I found were mostly lecture notes, Fortran 
> implementations or references to Mathematica etc., and no matter what I 
> tried I could not filter the hits to Lisp stuff. Does anybody have any 
> pointers?
> 
> I have some square matrix with the nr. rows/columns up to a few hundred 
> items at most. Although I think the matrix is usually pretty sparse I'm not 
> certain I want to make this assumption immediately. I think a LU factoring 
> of this matrix would give me the solution I need but I want to experiment 
> some more to see what is possible.
> 
> Any help or suggestions are appreciated.

There is some code in the CMU AI repository:

  http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/lang/lisp/code/math/

You may need to do some surgery on the URL, since it is likely to break
across lines.

I don't know if it solves your particular problem, though.

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Sam Steingold
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <ufyntgy3m.fsf@gnu.org>
> * Paul Griffioen <·@qbag.jnag.fcnz> [2006-01-12 18:02:15 +0100]:
>
>  
> I need to solve a recursive linear matrix equation in Lisp

CLOCC/CLLIB/matrix.lisp - matrix operations in Lisp.
matlisp interfaces to lapack using FFI, so it is faster, but not as
portable and limited to doubles.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
http://www.mideasttruth.com http://ffii.org http://pmw.org.il
http://www.dhimmi.com http://www.memri.org http://www.savegushkatif.org
NY survival guide: when crossing a street, mind cars, not streetlights.
From: Paul Griffioen
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <b00df$43c698e4$3ec27694$14604@news.chello.nl>
 
Thanks,

CLOCC/CLLIB/matrix.lisp looks like what I'm looking for. I'll check that out 
before considering matlisp because I prefer a direct Lisp implementation. 
Also not being an 'object' fan I am a little turned of by the following 
sentence on MatLisp's website:

"This allows you to write clean, object-oriented code that can utilize the 
LAPACK matrix routines.  Thus, you can think about your problem in the 
natural way instead of trying to force-fit your problem in matrices, like 
some other packages do."

Is it me or is this inverse advertisement?

Paul

"Sam Steingold" <···@gnu.org> schreef in bericht 
··················@gnu.org...
>> * Paul Griffioen <·@qbag.jnag.fcnz> [2006-01-12 18:02:15 +0100]:
>>
>>
>> I need to solve a recursive linear matrix equation in Lisp
>
> CLOCC/CLLIB/matrix.lisp - matrix operations in Lisp.
> matlisp interfaces to lapack using FFI, so it is faster, but not as
> portable and limited to doubles.
>
> -- 
> Sam Steingold (http://www.podval.org/~sds) running w2k
> http://www.mideasttruth.com http://ffii.org http://pmw.org.il
> http://www.dhimmi.com http://www.memri.org http://www.savegushkatif.org
> NY survival guide: when crossing a street, mind cars, not streetlights.
> 
From: ··············@hotmail.com
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <1137091505.076597.21680@g44g2000cwa.googlegroups.com>
Paul Griffioen wrote:
> Thanks,
I am a little turned of by the following
> sentence on MatLisp's website:
>
> "This allows you to write clean, object-oriented code that can utilize the
> LAPACK matrix routines.  Thus, you can think about your problem in the
> natural way instead of trying to force-fit your problem in matrices, like
> some other packages do."
>
> Is it me or is this inverse advertisement?

The issue that is being addressed is that many matrix-oriented
environments do not have the full support that Common Lisp does for
general-purpose programming.

And, if they have accumulated it after years of evolution, it is an
ugly thing.

The idea (which I can neither confirm nor deny) is that you can treat
the "matrix"-y part of your problem in a LAPACK way, and the
non-matrixy parts in a (clean) Common Lisp way.
From: Paul Griffioen
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <9e206$43c6d6af$3ec27694$18994@news.chello.nl>
 
It just made me wonder if it also allows me to write clean, 
non-object-oriented code without thinking about my problem in an unnatural 
way :)

Paul

···············@hotmail.com" <············@gmail.com> schreef in bericht 
····························@g44g2000cwa.googlegroups.com...
>
> Paul Griffioen wrote:
>> Thanks,
> I am a little turned of by the following
>> sentence on MatLisp's website:
>>
>> "This allows you to write clean, object-oriented code that can utilize 
>> the
>> LAPACK matrix routines.  Thus, you can think about your problem in the
>> natural way instead of trying to force-fit your problem in matrices, like
>> some other packages do."
>>
>> Is it me or is this inverse advertisement?
>
> The issue that is being addressed is that many matrix-oriented
> environments do not have the full support that Common Lisp does for
> general-purpose programming.
>
> And, if they have accumulated it after years of evolution, it is an
> ugly thing.
>
> The idea (which I can neither confirm nor deny) is that you can treat
> the "matrix"-y part of your problem in a LAPACK way, and the
> non-matrixy parts in a (clean) Common Lisp way.
>
> 
From: Paolo Amoroso
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <87ace1kxc7.fsf@plato.moon.paoloamoroso.it>
"Paul Griffioen" <·@dont.want.spam> writes:

> I need to solve a recursive linear matrix equation in Lisp so I googled 
> around for libraries for Gauss-Jordan, linear algebra etc. but couldn't find 
> anything usefull. What I found were mostly lecture notes, Fortran 
> implementations or references to Mathematica etc., and no matter what I 
> tried I could not filter the hits to Lisp stuff. Does anybody have any 

I can't help with your problem.  But your experience with looking for
Lisp software is part of the reason why this resource has been
created:

  The Common Lisp Directory
  http://www.cl-user.net
  http://www.cl-user.net/asp/root-dir

The CL Gardeners:

  CL Gardeners - Tending the Common Lisp garden
  http://www.lispniks.com/cl-gardeners/

are helping add entries to the database.  Right now there are about
260, but we started just around a week ago and the number increases
daily.


Paolo
-- 
Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
The Common Lisp Directory: http://www.cl-user.net
From: Paul Griffioen
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <98b11$43c6dd9f$3ec27694$22193@news.chello.nl>
 
I regularly lurked around c.l.l. lately so I noticed the initiative. Great! 
I think it is extremely helpful to have a single point for Lisp resources.



Since I knew of the dictionary I checked it before googling, but it doesn't 
have what I was looking for. Off course at this point I should offer to add 
it to the dictionary myself but I am pretty much a newbie at numerical stuff 
so I don't think I'm qualified (besides being lazy and wanting to go back to 
lurking mode asap :).



Thanks to the answers from the other posters in the thread I found some nice 
material and also http://www.numerical-recipes.com/index.html. At the 
website it says



"If you'd like your translations to be included, with attribution to you, in 
the next version of the Numerical Recipes Multi-Language Code CDROM, we're 
usually happy to oblige; but, alas, we are not able to offer you any 
financial compensation for this contribution. (The CDROM now has Modula 2, 
BASIC, and Lisp versions contributed in this manner.)"



Any information on this Lisp contribution? Is there something like this 
freely available? Something like that would be nice for the dictionary.



Paul


"Paolo Amoroso" <·······@mclink.it> schreef in bericht 
···················@plato.moon.paoloamoroso.it...
> "Paul Griffioen" <·@dont.want.spam> writes:
>
>> I need to solve a recursive linear matrix equation in Lisp so I googled
>> around for libraries for Gauss-Jordan, linear algebra etc. but couldn't 
>> find
>> anything usefull. What I found were mostly lecture notes, Fortran
>> implementations or references to Mathematica etc., and no matter what I
>> tried I could not filter the hits to Lisp stuff. Does anybody have any
>
> I can't help with your problem.  But your experience with looking for
> Lisp software is part of the reason why this resource has been
> created:
>
>  The Common Lisp Directory
>  http://www.cl-user.net
>  http://www.cl-user.net/asp/root-dir
>
> The CL Gardeners:
>
>  CL Gardeners - Tending the Common Lisp garden
>  http://www.lispniks.com/cl-gardeners/
>
> are helping add entries to the database.  Right now there are about
> 260, but we started just around a week ago and the number increases
> daily.
>
>
> Paolo
> -- 
> Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
> The Common Lisp Directory: http://www.cl-user.net
> 
From: ··············@hotmail.com
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <1137166020.443412.23330@o13g2000cwo.googlegroups.com>
Paul Griffioen wrote:
> Thanks to the answers from the other posters in the thread I found some nice
> material and also http://www.numerical-recipes.com/index.html. At the
> website it says
>
>
>
> "If you'd like your translations to be included, with attribution to you, in
> the next version of the Numerical Recipes Multi-Language Code CDROM, we're
> usually happy to oblige; but, alas, we are not able to offer you any
...
> Any information on this Lisp contribution? Is there something like this
> freely available? Something like that would be nice for the dictionary.

Numerical Recipes is notoriously mediocre (or worse) code. The
interfaces also are very Fortran-oriented.

Matrix computation is one of the most highly developed and specialized
areas of algorithmic research. In general, it is best to rely on
expert-written libraries. Numerical Recipes was not written by
numerical experts.

Also, Lisp implementations are only rarely optimized for these
operations to the extent that Fortran compilers or platform-specific
BLAS or LAPACK libraries are. For small scale problems, or where high
accuracy is not required, it may be possible to get acceptable results
with mediocre code, random stuff from the Internet, or roll-your-own
routines. For large-scale problems, or where you want the most robust
accuracy, you are unlikely to get acceptable results unless you use
supported industrial-strength libraries.
From: Paul Griffioen
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <88edc$43c8d84f$3ec27694$19062@news.chello.nl>
 
Thanks for the info/advice. For now I'll try roll-your-own routines and see 
how far I get.

Is it common knowledge that Numerical Recipes is mediocre and not written by 
numerical experts or is it that you know the people who wrote it?

Paul

···············@hotmail.com" <············@gmail.com> schreef in bericht 
····························@o13g2000cwo.googlegroups.com...
>
> Paul Griffioen wrote:
>> Thanks to the answers from the other posters in the thread I found some 
>> nice
>> material and also http://www.numerical-recipes.com/index.html. At the
>> website it says
>>
>>
>>
>> "If you'd like your translations to be included, with attribution to you, 
>> in
>> the next version of the Numerical Recipes Multi-Language Code CDROM, 
>> we're
>> usually happy to oblige; but, alas, we are not able to offer you any
> ...
>> Any information on this Lisp contribution? Is there something like this
>> freely available? Something like that would be nice for the dictionary.
>
> Numerical Recipes is notoriously mediocre (or worse) code. The
> interfaces also are very Fortran-oriented.
>
> Matrix computation is one of the most highly developed and specialized
> areas of algorithmic research. In general, it is best to rely on
> expert-written libraries. Numerical Recipes was not written by
> numerical experts.
>
> Also, Lisp implementations are only rarely optimized for these
> operations to the extent that Fortran compilers or platform-specific
> BLAS or LAPACK libraries are. For small scale problems, or where high
> accuracy is not required, it may be possible to get acceptable results
> with mediocre code, random stuff from the Internet, or roll-your-own
> routines. For large-scale problems, or where you want the most robust
> accuracy, you are unlikely to get acceptable results unless you use
> supported industrial-strength libraries.
>
> 
From: John Thingstad
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <op.s3dhniu3pqzri1@mjolner.upc.no>
On Sat, 14 Jan 2006 11:53:33 +0100, Paul Griffioen <·@dont.want.spam>  
wrote:

> Thanks for the info/advice. For now I'll try roll-your-own routines and  
> see
> how far I get.
>
> Is it common knowledge that Numerical Recipes is mediocre and not  
> written by
> numerical experts or is it that you know the people who wrote it?
>
> Paul
>

Well I must admit having used numerical recipes and his critisism is a bit  
of
a suprise to me. I am, of course, not a numerical analysis expert but I do
have a couple of courses in it. The exposition in the couses was too
teoretical and Numerical recipies really hit the spot.
To my knowlege it is in use by scientist's around the world.
It is quite old though. Today I hardly ever use it. Matematica has
more power and I can access the kernel from any program.
I have to agree that LAPACK would be much better paricularly for sparse
matrises. (I might mention Maple too, not a bad library.)

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
From: rif
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <wj0hd86rftb.fsf@five-percent-nation.mit.edu>
"John Thingstad" <··············@chello.no> writes:

> I have to agree that LAPACK would be much better paricularly for sparse
> matrises. (I might mention Maple too, not a bad library.)

I don't believe that LAPACK has any facilities for handling general
sparse matrices.  My apologies if the questioner was specifically
interested in banded matrices, which LAPACK does handle.  A number of
packages for general sparse matrices are at
http://www.cise.ufl.edu/research/sparse/, although I haven't heard of
any public CL bindings to any of these.

Cheers,

rif
From: Robert Dodier
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <1137178139.248134.236430@z14g2000cwz.googlegroups.com>
Paul Griffioen wrote:

> Any information on this Lisp contribution? Is there something like this
> freely available? Something like that would be nice for the dictionary.

No, the Numerical Recipes code is not free as in free speech,
although it is free as in free beer.

See: http://www.numerical-recipes.com/infotop.html
and http://www.numerical-recipes.com/com/info-copyright.html

Robert Dodier
From: Andreas Eder
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <hm8n93-lml.ln1@eder.homelinux.net>
>>>>> "Robert" == Robert Dodier <·············@gmail.com> writes:

    Robert> No, the Numerical Recipes code is not free as in free speech,
    Robert> although it is free as in free beer.

    Robert> See: http://www.numerical-recipes.com/infotop.html
    Robert> and http://www.numerical-recipes.com/com/info-copyright.html

And in this case you really get what you pay for!
Ask any numerical analyst what he thinks of this code, and you will not
hear goo things said about it. The code is sometimes outright dangerous.
There are far better libraries around, though somtimes they cost money -
buut for linear algebra you could hardly do better than to use LAPACK.
And there are even some Lisp bindings for it.

Andreas
-- 
Wherever I lay my .emacs, there's my $HOME.
From: Paolo Amoroso
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <877j94dzwt.fsf@plato.moon.paoloamoroso.it>
"Paul Griffioen" <·@dont.want.spam> writes:

> I regularly lurked around c.l.l. lately so I noticed the initiative. Great! 
> I think it is extremely helpful to have a single point for Lisp resources.
[...]
> Since I knew of the dictionary I checked it before googling, but it doesn't 
> have what I was looking for. Off course at this point I should offer to add 

It will: we are going to crank new entries more or less until doomsday :)
The project's motto is "the sky is the limit".


Paolo
-- 
Why Lisp? http://wiki.alu.org/RtL%20Highlight%20Film
The Common Lisp Directory: http://www.cl-user.net
From: Steven M. Haflich
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <6tGxf.395$Jd.124@newssvr25.news.prodigy.net>
Paul Griffioen wrote:

> I need to solve a recursive linear matrix equation in Lisp so I googled 
> around for libraries for Gauss-Jordan, linear algebra etc. but couldn't find 
> anything usefull. What I found were mostly lecture notes, Fortran 
> implementations or references to Mathematica etc., and no matter what I 
> tried I could not filter the hits to Lisp stuff. Does anybody have any 
> pointers?

You might want to examine Maxima, a version of the famous Macsyma, that is
coded in Common Lisp.  I have no idea whether it will address your specific
problem, but it is freely downloadable from maxima.sourceforge.net and there
is also a mailing list described there where you might ask about your needs.
From: Robert Dodier
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <1137177686.092466.99850@g43g2000cwa.googlegroups.com>
Steven M. Haflich wrote:

> You might want to examine Maxima, a version of the famous Macsyma, that is
> coded in Common Lisp.  I have no idea whether it will address your specific
> problem, but it is freely downloadable from maxima.sourceforge.net and there
> is also a mailing list described there where you might ask about your needs.

Maxima's linear algebra code has been expanded lately.
See share/linearalgebra in http://cvs.sf.net/viewcvs.py/maxima/maxima/
.

Maxima's code works for matrices which have symbolic elements
so it is probably suboptimal for strictly numeric problems.
However, it might be fast enough anyway.

It might be possible to pull out the linear algebra code as a separate
library; I don't know how much Maxima-specific stuff it assumes.
You could use all of Maxima as a library in a Lisp program, too.

Btw Maxima is GPL.

Robert Dodier
From: Debian User
Subject: Re: Looking for linear algebra lib
Date: 
Message-ID: <43c7afcd$0$51325$dbd49001@news.wanadoo.nl>
Have a look at xlispstat.  It has linear algebra stuf already built in
and is quite common lisp like (except CLOS).

You could also have a look at lush (lisp universal shell).  It has an
interface to quite a lot of numerical libraries and its own
matrix/tensor lib.


yours,

Marc