[Rcpp-devel] good style for std::vector of C++ struct -> named list of named lists

2015-06-24 Thread Dr Gregory Jefferis
Hello all, I am wrapping a very simple C++ library in a package (to read wavefront 3D obj files). The results come back as a std::vector of a struct which contains various fields using datatypes such as float, float[], std::string. I am going to return this as a list of lists. Each of the sub

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Matt D.
On 6/22/2015 12:31, Ramon Diaz-Uriarte wrote: Actually, I just noticed that things will not work if you need your package to run on Windoze: Rtools uses gcc 4.6.3 there, and this will not work with gcc 4.6 (neither in Linux nor Windows) with flag -std=c++0x or -std=gnu++0x. I guess this should b

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Ramon Diaz-Uriarte
Hi Matt, Thanks a lot for the details and the work. That is great! There is a problem, though: in my particular case, I am uploading my package to BioConcutor, and there the compiler for Win is 4.6.3 so I am restricted to that. Including randutils will lead to an error during building the package

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Matt D.
On 6/24/2015 15:07, Ramon Diaz-Uriarte wrote: Hi Matt, Thanks a lot for the details and the work. That is great! There is a problem, though: in my particular case, I am uploading my package to BioConcutor, and there the compiler for Win is 4.6.3 so I am restricted to that. Including randutils wi

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Charles Determan
Thank you John, I am familiar with bigmemory (I am one of the current developers actually). The project I am working on doesn't need the shared memory aspect so was intending to avoid the dependency and just leverage the more familiar and developed Armadillo library. However your response inform

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Dirk Eddelbuettel
On 24 June 2015 at 08:22, Charles Determan wrote: | Thank you John, | | I am familiar with bigmemory (I am one of the current developers actually).  | The project I am working on doesn't need the shared memory aspect so was | intending to avoid the dependency and just leverage the more familiar a

Re: [Rcpp-devel] mixing R's and C++'s RNGs and distributions

2015-06-24 Thread Ramon Diaz-Uriarte
On Wed, 24-06-2015, at 15:22, Matt D. wrote: > On 6/24/2015 15:07, Ramon Diaz-Uriarte wrote: >> Hi Matt, >> >> Thanks a lot for the details and the work. That is great! There is a >> problem, though: in my particular case, I am uploading my package to >> BioConcutor, and there the compiler for

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Charles Determan
The fastLm examples are nice but they don't contain anything relating to passing an XPtr between functions. Regarding your comment about making an XPtr around arma::mat 'innards' I'm not sure I fully understand. I tried creating an XPtr around a arma::mat but no success on passing the object betw

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Krzysztof Sakrejda
Hi Charles, comments inline 2015-06-24 11:03 GMT-04:00 Charles Determan : > The fastLm examples are nice but they don't contain anything relating to > passing an XPtr between functions. Regarding your comment about making an > XPtr around arma::mat 'innards' I'm not sure I fully understand. I t

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Charles Determan
Many thanks Krzysztof, your suggestion works. I can explicitly create a 'new' arma::mat object and pass the resulting XPtr between functions. I will work on making everything prettier and document for a submission to Rcpp Gallery unless someone is aware of one that already exists that I somehow o

Re: [Rcpp-devel] rsession memory consumption blows up

2015-06-24 Thread Fabio Tordini
Searching a little bit on the Internet I found a bug report on bugzilla related to the issue I have. From this comment https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14611#c3 on, Simon Urbanek clarifies that all this has nothing to do with R. Rather, it is about memory allocation in Lin

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Hadley Wickham
On Wed, Jun 24, 2015 at 11:08 AM, Charles Determan wrote: > Many thanks Krzysztof, your suggestion works. I can explicitly create a > 'new' arma::mat object and pass the resulting XPtr between functions. I > will work on making everything prettier and document for a submission to > Rcpp Gallery

[Rcpp-devel] Map Eigen MatrixXf?

2015-06-24 Thread Charles Determan
I have been exploring the use of RcppEigen more recently and stumbled upon an issue when passing R objects. Is there a way to pass an R matrix and get it in to a mapped Eigen MatrixXf object? I know R doesn't have a native float type so I am not overly surprised that I have run in to this issue.

Re: [Rcpp-devel] Passing XPtr between functions

2015-06-24 Thread Charles Determan
Thanks Hadley, much more concise :) On Wed, Jun 24, 2015 at 2:22 PM, Hadley Wickham wrote: > On Wed, Jun 24, 2015 at 11:08 AM, Charles Determan > wrote: > > Many thanks Krzysztof, your suggestion works. I can explicitly create a > > 'new' arma::mat object and pass the resulting XPtr between fu

Re: [Rcpp-devel] rsession memory consumption blows up

2015-06-24 Thread Dirk Eddelbuettel
On 24 June 2015 at 20:31, Fabio Tordini wrote: | Searching a little bit on the Internet I found a bug report on bugzilla | related to the issue I have. | | From this comment | https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14611#c3 on, Simon | Urbanek clarifies that all this has nothing

Re: [Rcpp-devel] Map Eigen MatrixXf?

2015-06-24 Thread Yixuan Qiu
Hi Charles, The Map class is designed to reuse the memory allocated by some other program such as R, and due to this reason the memory layout must be consistent with the declared matrix type. In R there is no such float arrays, so there is no way to directly map it to a MatrixXf object. I suppose y