help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Re: exponential of a matrix


From: Carl Boettiger
Subject: [Help-gsl] Re: exponential of a matrix
Date: Sun, 13 Dec 2009 13:56:41 -0800

Hi again,

The command seems to work fine in my example below.  Output in my example
seems to agree with octave's expm function when the third argument to
exponential_ss is small enough (type gsl_mode_t, I gather this a precision
control ).  Anyone use this function or is some other method preferable?

-Carl

#include <stdio.h>
#include <gsl/gsl_linalg.h>

int
main (void)
{
   double a[9] = {1,2,3,4,5,6,7,8,9};
   double b[9] = {0};

   gsl_matrix_view m
     = gsl_matrix_view_array(a, 3, 3);
   gsl_matrix_view em
     = gsl_matrix_view_array(b, 3, 3);

   gsl_linalg_exponential_ss(&m.matrix, &em.matrix, .01);

   gsl_matrix_fprintf(stdout, &em.matrix, "%g");

   return 0;
}


On Sun, Dec 13, 2009 at 1:14 PM, Carl Boettiger <address@hidden> wrote:

> Hi,
>
> I'm looking to exponentiate a matrix.  It seems there are functions for
> this in exponential.c under linalg, but I don't see anything about them in
> the documentation.  How do I call the exponential of a matrix using
> gsl_linalg_exponential_ss() ?
>
> I understand that the matmult functions in linalg can be replaced by blas,
> but not sure why the exponential is undocumented.  An example of how to
> compute this would be great.  Thanks!
>
> -Carl
>
> --
> Carl Boettiger
> Population Biology, UC Davis
> http://two.ucdavis.edu/~cboettig <http://two.ucdavis.edu/%7Ecboettig>
>



-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig


reply via email to

[Prev in Thread] Current Thread [Next in Thread]