Skip to content
Prev 23120 / 63421 Next

passing matrix as argument to a C function

The data in an R matrix is not stored as double **A, but as double *A: it 
is just a vector in R, with attributes.

There are lots of examples of manipulating R matrixes via .C: one is 
src/library/stats/src/kmeans.c.

The code for crossprod is not at all hard to find: it is in 
src/main/array.c.  However, is just a call to an LAPACK function.
The code there for matprod would be more informative.
On Sun, 3 Dec 2006, Christos Hatzis wrote: