Re: [R] matrix to a C function

2010-01-23 Thread Romain Francois
Christophe, That's another question for the R-devel mailing list. A few things however. Short answer : no it is not possible. I don't think x[i,j] is even syntactically valid in C or C++. I'd suggest you to give a go at the .Call interface that lets you manipulate R objects directly. So in

[R] matrix to a C function

2010-01-23 Thread Christophe Genolini
Hi the list, Is there a way to give a matrix to a C function, and then to use it as a matrix ? I write a function to print a matrix, but I use it as a vector : 1. void printMatrix(double *mTraj,int *nbCol, int *nbLigne){ 2. int i=0,j=0; 3. for(i=0 ; i < *nbLigne ; i++){ 4. for(j=0