modifying matrix allocation functions for use with R

Brian Gough bjg@network-theory.co.uk
Wed Dec 19 13:20:00 GMT 2001


Faheem Mitha writes:

 > Surely, this should be "...the input matrix A contain the matrix U"?

Thanks. Now fixed.

 > Incidentally, it is a little awkward to compute the inverse of a matrix,
 > since this involves calling both int gsl_linalg_LU_decomp and int
 > gsl_linalg_LU_invert. Would it not be useful to have a "wrapper" function
 > which uses both together?

Maybe, but in this case computing the inverse matrix is not something
I want to encourage, as it's usually better to solve Ax=b instead.

 > I have one (slighly idle) question. I have noticed that macros are used
 > quite liberally in the gsl source code, for example you have a macro
 > called TYPE which seems to do nothing at all, there is another macro
 > called PUNCTION(foo, bar) which concatenates foo and bar etc. I'm just
 > wondering what purpose some of these serve, like the TYPE macro for
 > example. Do they just make the code easier to write?

These macros are used to make the functions for different types,
gsl_vector_float, gsl_vector_int, etc.  See the file templates_on.h
for details.

Brian



More information about the Gsl-discuss mailing list