This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

modifying matrix allocation functions for use with R



Dear People,

Here is a relatively esoteric question. Some of you may be familiar with
R (sometimes called GNU S) which does statistical stuff. It is possible to
use C code compiled into a shared library as a backend for R. Now, I was
wanting to use some GSL routines in this code.

In particular, I need to use allocation functions like gsl_matrix_alloc.
Unfortunately, I'm not sure whether standard calloc/malloc that are used
work with R. I'm going to check this, but I think the answer is most
likely no. R uses a routine called R_alloc which takes storage from the R
heap and manages the cleanup itself (so you don't need to use free).

One option I was considering was rewriting gsl_matrix_alloc (leaving out
the error checking) in terms of R_alloc. However, I can't find the code
for FUNCTION(gsl_block, alloc) (I assume this means gsl_block_alloc)
used in the code for gsl_matrix_alloc. gsl_matrix_alloc itself seems to be
in matrix/init_source.c. Can someone point me to the code for
gsl_block_alloc, or suggest any other options?

I'm not subscribed to the list, so I would be obliged if you would cc me.

                            Sincerely, Faheem Mitha.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]