[Rd] handling a matrix and .C

Sklyar, Oleg (London) osklyar at maninvestments.com
Mon Dec 1 13:49:57 CET 2008


You should not have started with R/C API without reading this (first
link in google): "Writing R Extensions". For your particular question
you want pages 72+ and sections 5.9.3 and 5.9.4, possibly further as
well

Dr Oleg Sklyar
Research Technologist
AHL / Man Investments Ltd
+44 (0)20 7144 3107
osklyar at maninvestments.com 

> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of Wilm Schumacher
> Sent: 24 November 2008 18:59
> To: r-devel at r-project.org
> Subject: [Rd] handling a matrix and .C
> 
> Hello R-devel,
> 
> I want to write extensions for R in C (maybe C++ and Fortran 
> later) and it works fine, but there is one problem, which I 
> cannot solve (in my view).
> 
> I want to handle a matrix from R in C. For arrays there is 
> "as.double(...)", but nothing for a matrix.
> 
> I searched a while, but didn't find something.
> 
> Last I looked at the source code of e1071 and of the core 
> itself and recognized (I hope I understood this), that you 
> (and the "e1071" people) use "as.double()" and give ".C" an 
> array and one have to "parse" the matrix again in the C function.
> 
> This sounds a little complicate. Isn't there another way? A 
> more adapted way?
> 
> Greetings
> 
> Wilm
> 
> ps: I joined the R-devel list, but didn't get an confirmation 
> mail. I hope this is normal
> --
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 

**********************************************************************
Please consider the environment before printing this email or its attachments.

The contents of this email are for the named addressees ...{{dropped:19}}



More information about the R-devel mailing list