[Rcpp-devel] Creating an R interface to non-copyable C++ class

2018-04-11 Thread Cris Luengo
I have some functionality in C++ that I need to access from R. My impression was that Rcpp was the simplest way to accomplish this, but I haven't been able to make it work yet. The core problem, I think, is that data created is not copyable. One of these functions returns a `std::unique_ptr` ownin

Re: [Rcpp-devel] segmentation fault when wrapping a big Eigen 2-d array

2018-04-11 Thread Dirk Eddelbuettel
On 9 April 2018 at 09:51, Jack Wasey wrote: | I seem to tread in unusual code paths often, which is | why I appreciate so much your guidance. I can't reproduce the error now | I've converted from integer Eigen matrix to Rcpp::IntegerMatrix, then | within Rcpp, Integer to Logical matrices. I thin

Re: [Rcpp-devel] Creating an R interface to non-copyable C++ class

2018-04-11 Thread Dirk Eddelbuettel
Hi Chris, Thanks for bringing this over here from StackOverflow. On 11 April 2018 at 17:19, Cris Luengo wrote: | I have some functionality in C++ that I need to access from R. My | impression was that Rcpp was the simplest way to accomplish this, but I | haven't been able to make it work yet. |

Re: [Rcpp-devel] Creating an R interface to non-copyable C++ class

2018-04-11 Thread Cris Luengo
> On Apr 11, 2018, at 19:14, Dirk Eddelbuettel wrote: > > On 11 April 2018 at 17:19, Cris Luengo wrote: > | Ideally, an R variable would hold on to this pointer (with or without the > | `std::unique_ptr` around it), and delete the object when it is cleared (or > | garbage collected, or whatever