From osklyar at maninvestments.com  Mon Dec  1 13:49:57 2008
From: osklyar at maninvestments.com (Sklyar, Oleg (London))
Date: Mon, 1 Dec 2008 12:49:57 -0000
Subject: [Rd] handling a matrix and .C
In-Reply-To: <20081124185855.152920@gmx.net>
References: <20081124185855.152920@gmx.net>
Message-ID: <1A68FCB28DE72F4BA3B967E6506CCE430304991E@mildnpexmb01.maninvestments.ad.man.com>

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}}



[Rd] handling a matrix and .C
Sklyar, Oleg (London