Re: [Rd] NUMERIC_POINTER question

2005-09-13 Thread Huntsinger, Reid
You have to coerce to numeric yourself if that's what you want. Eg in the R code, as.numeric(1:12) rather than 1:12. Or check the type first in C with TYPEOF before doing NUMERIC_POINTER or INTEGER_POINTER (the difference is that the two do different casts; they both point a fixed offset into the R

Re: [Rd] .Call and Segmentation Fault

2005-08-31 Thread Huntsinger, Reid
ction from C. How do you deal with SEXPs? Reid Huntsinger Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo Luiz Andrade Abrantes Sent: Tuesday, August 30, 2005 4:33 PM To: r-devel@r-project.org Subject: Re: [Rd] .Call and Segmentat

Re: [Rd] Calling C from Fortran

2005-06-15 Thread Huntsinger, Reid
GUILLOT [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 15, 2005 11:50 AM To: [EMAIL PROTECTED] Cc: Huntsinger, Reid Subject: Re: [Rd] Calling C from Fortran Thanks for your reply. Am I write if I say that the wrapper shoul be double F77_SUB(mygammafn)(double *x) { return gammafn(*x); } ins

Re: [Rd] Calling C from Fortran

2005-06-14 Thread Huntsinger, Reid
The C wrappers are there to align the linking conventions expected by the Fortran compiler (usually subroutine/function foo has its entry point in the object file indicated by a symbol foo_, but it depends on the platform) to that of the C compiler. (The C compiler just uses the function name.) The