[R] passing a matrix from R to C code

2012-09-24 Thread Erin Hodgess
Dear R People: I'm working on a project that will pass a matrix from an R function to a C subroutine. I tried to write the following: #includeR.h #includeRinternals.h void lu1(int *n, float *a, float *b, float *ab) { int i,k,j,p,na=*n+10; float sum, l[200][200],u[200][200]z[200];

Re: [R] passing a matrix from R to C code

2012-09-24 Thread Peter Langfelder
Erin, you seem to confuse R and C syntax a bit, among other things. See below. On Mon, Sep 24, 2012 at 3:03 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: I'm working on a project that will pass a matrix from an R function to a C subroutine. I tried to write the following:

Re: [R] passing a matrix from R to C code

2012-09-24 Thread Rui Barradas
Hello, Also, R uses doubles, not floats. Hope this helps, Rui Barradas Em 24-09-2012 23:27, Peter Langfelder escreveu: Erin, you seem to confuse R and C syntax a bit, among other things. See below. On Mon, Sep 24, 2012 at 3:03 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: