On 07.05.2011, at 11:15, Romain Francois wrote:

> Try having do_bar with this signature:
> 
> void do_bar(NumericVector data);
> 
> And my advice would probably also to have your C field either as a 
> NumericVector. NumericVector is just a thin wrapper around the internal R 
> data structure.
> 
> Having data members as direct pointers is dangerous and not a very C++ way of 
> doing things.
> 
> If you want to learn about the STL, there are many books that cover it and 
> plenty of online resources. I use this : http://cplusplus.com/reference/stl/. 
> Using the STL is easier than dealing with pointers and stuff.
> 
> If your game is to pass down a double* to some api you use, you can use the 
> begin method of NumericVector, this will give you the array pointer (as would 
> REAL do on the underlying SEXP):

[...]

For the files: the discussion continues here:

http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2011-May/002261.html

Regards
Sören

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to