[R] passing a matrix to C++ with .C()?

Francisco J Molina FJMolina at lbl.gov
Tue May 7 07:05:20 CEST 2002

It seems that it is possible to pass a matrix to C++ by using .C()

The R part of the interface should be something like:

('C++function', matrix, numberRows, numberColumns )

...I guess.

The C++ part of the interface could be something like

void C++( double matrix[][], int numberRows, numberColumns )

but C++ requires to indicate the number of columns, that is, instead of
matrix[][], it should be double matrix[][ numberColumns ]...

This does not look like the right thing to do though.

Can anyone help me with this?
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list