Hi Liam,
Is there a binding for gsl_linalg_exponential_ss (that calculates the exponential of a matrix?) I could not find one.
Thanks,
Tamas
On Wed, Jul 23, 2008 at 9:07 AM, Tamas K Papp tpapp@princeton.edu wrote:
Hi Liam,
Is there a binding for gsl_linalg_exponential_ss (that calculates the exponential of a matrix?) I could not find one.
Thanks,
Tamas _______________________________________________ Gsll-devel mailing list Gsll-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel
Hi Tamas,
No. I'm trying to figure out the reason for this, and the big one I can see is that I don't see it in the GSL documentation. It shows up in my /usr/include/gsl/gsl_linalg.h and in /usr/lib/libgsl.so. It's possible that it was introduced since GSL 1.8, which is where my porting started. One of my long-term goals is to have an accounting of the port status of every symbol in the library so that I'll catch gaps and new functions like this. In the meantime, it shouldn't be hard to make a binding, straightforward use of defmfun I think.
BTW that paper of Moler and Van Loan is a classic and was recently updated Cleve B. Moler and Charles F. Van Loan. Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later. SIAM Rev., 45(1):3–49, 2003.
Liam
On Wed, Jul 23, 2008 at 11:16:27AM -0400, Liam Healy wrote:
Hi Liam,
Hi Tamas,
No. I'm trying to figure out the reason for this, and the big one I can see is that I don't see it in the GSL documentation. It shows up in my /usr/include/gsl/gsl_linalg.h and in /usr/lib/libgsl.so. It's possible that it was introduced since GSL 1.8, which is where my porting started. One of my long-term goals is to have an accounting of the port status of every symbol in the library so that I'll catch gaps and new functions like this. In the meantime, it shouldn't be hard to make a binding, straightforward use of defmfun I think.
Would you please add this binding? I am reading the source, but still haven't figured out defmfun to know how to do this.
BTW that paper of Moler and Van Loan is a classic and was recently updated Cleve B. Moler and Charles F. Van Loan. Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later. SIAM Rev., 45(1):3–49, 2003.
Thanks, I just read this, but didn't feel up to programming the whole thing :-) There is a Fortran library called Expokit which is said to be nice, but I found it impossible to work with CL.
Thanks,
Tamas
Tamas,
I added this function to the future (ffa) version of GSLL, and it works. This is my attempt at a backport to the current version:
(defmfun matrix-exponential (matrix exponential) "gsl_linalg_exponential_ss" (((mpointer matrix) :pointer) ((mpointer exponential) :pointer) :mode) :invalidate (exponential) :return (exponential) :documentation "Calculate the matrix exponential by the scaling and squaring method described in Moler + Van Loan, SIAM Rev 20, 801 (1978). The matrix to be exponentiated is matrix, the returned exponential is exponential. The mode argument allows choosing an optimal strategy, from the table given in the paper, for a given precision.")
I have not tried it, so try it and see how it works. If you give it #2A((0.0d0 1.0d0) (-1.0d0 0.0d0)) it should return #2A((0.5403023058681384d0 0.841470984807895d0) (-0.841470984807895d0 0.5403023058681384d0)) i.e., [[cos(1), sin(1)], [-sin(1), cos(1)]]
Liam
On Wed, Jul 23, 2008 at 11:45 AM, Tamas K Papp tpapp@princeton.edu wrote:
On Wed, Jul 23, 2008 at 11:16:27AM -0400, Liam Healy wrote:
Hi Liam,
Hi Tamas,
No. I'm trying to figure out the reason for this, and the big one I can see is that I don't see it in the GSL documentation. It shows up in my /usr/include/gsl/gsl_linalg.h and in /usr/lib/libgsl.so. It's possible that it was introduced since GSL 1.8, which is where my porting started. One of my long-term goals is to have an accounting of the port status of every symbol in the library so that I'll catch gaps and new functions like this. In the meantime, it shouldn't be hard to make a binding, straightforward use of defmfun I think.
Would you please add this binding? I am reading the source, but still haven't figured out defmfun to know how to do this.
BTW that paper of Moler and Van Loan is a classic and was recently updated Cleve B. Moler and Charles F. Van Loan. Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later. SIAM Rev., 45(1):3–49, 2003.
Thanks, I just read this, but didn't feel up to programming the whole thing :-) There is a Fortran library called Expokit which is said to be nice, but I found it impossible to work with CL.
Thanks,
Tamas
On Sun, Aug 10, 2008 at 06:38:16PM -0400, Liam Healy wrote:
Tamas,
I added this function to the future (ffa) version of GSLL, and it works. This is my attempt at a backport to the current version:
(defmfun matrix-exponential (matrix exponential) "gsl_linalg_exponential_ss" (((mpointer matrix) :pointer) ((mpointer exponential) :pointer) :mode) :invalidate (exponential) :return (exponential) :documentation "Calculate the matrix exponential by the scaling and squaring method described in Moler + Van Loan, SIAM Rev 20, 801 (1978). The matrix to be exponentiated is matrix, the returned exponential is exponential. The mode argument allows choosing an optimal strategy, from the table given in the paper, for a given precision.")
I have not tried it, so try it and see how it works. If you give it #2A((0.0d0 1.0d0) (-1.0d0 0.0d0)) it should return #2A((0.5403023058681384d0 0.841470984807895d0) (-0.841470984807895d0 0.5403023058681384d0)) i.e., [[cos(1), sin(1)], [-sin(1), cos(1)]]
Hi Liam,
I tried to compile this in the :gsl package (after loading it of course), and I got the error that mpointer was undefined.
I am more interested in the FFA version of GSLL. Where can I download it?
Thanks,
Tamas
On Mon, Aug 11, 2008 at 5:08 AM, Tamas K Papp tpapp@princeton.edu wrote:
On Sun, Aug 10, 2008 at 06:38:16PM -0400, Liam Healy wrote:
Tamas,
I added this function to the future (ffa) version of GSLL, and it works. This is my attempt at a backport to the current version:
(defmfun matrix-exponential (matrix exponential) "gsl_linalg_exponential_ss" (((mpointer matrix) :pointer) ((mpointer exponential) :pointer) :mode) :invalidate (exponential) :return (exponential) :documentation "Calculate the matrix exponential by the scaling and squaring method described in Moler + Van Loan, SIAM Rev 20, 801 (1978). The matrix to be exponentiated is matrix, the returned exponential is exponential. The mode argument allows choosing an optimal strategy, from the table given in the paper, for a given precision.")
I have not tried it, so try it and see how it works. If you give it #2A((0.0d0 1.0d0) (-1.0d0 0.0d0)) it should return #2A((0.5403023058681384d0 0.841470984807895d0) (-0.841470984807895d0 0.5403023058681384d0)) i.e., [[cos(1), sin(1)], [-sin(1), cos(1)]]
Hi Liam,
I tried to compile this in the :gsl package (after loading it of course), and I got the error that mpointer was undefined.
I am more interested in the FFA version of GSLL. Where can I download it?
Thanks,
Tamas
Oops sorry, change "mpointer" to "pointer" in both cases. I am pushing the FFA version to a git repository on common-lisp.net as I develop it. If you have a user name and password there, you can clone with git clone ssh://yourusername@common-lisp.net/project/gsll/git gsll Because of a problem with public git service on cl.net, you can't clone it yet if you don't have a user name and password there; I will let you know when they fix that. Please keep in mind that this is an ongoing project, so many things don't work yet. In particular, there is no updated documentation and very few working examples. Also I've changed ffa in a few places from your version.
Liam