[R] include C functions from nmath in my own C functions

yyan liu zhliur at yahoo.com
Tue Feb 22 19:48:10 CET 2005


Hi:
  I am writing a C program which need a gamma random
number generator. I download the source file of R and
compile, make it myself. There is a "rgamma.c"
function in the installing directory of
R("/home/zhliu/Backup/R-2.0.1/src/nmath/rgamma.c"). My
question is how to call this function in my own
program which is in another directory. I can not copy
this "rgamma.c" to my working directory and use
#inclucde"rgamma.c" because in the file "rgamma.c", it
includes other header files. Or I can use makefile,
but I do not know how to edit my makefile to do this
job. 
  A related question is whether are similar .c files
contains the matrix functions(product, invert) in the
nmath library which I can use for my own C program?
  Thanks a lot!

liu




More information about the R-help mailing list