Re: [Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread Joshua Wiley
Definitely, once I get things working correctly/safely very happy to contribute to the gallery! -- Joshua F. Wiley, Ph.D. http://joshuawiley.com/ Postdoctoral Research Fellow Mary MacKillop Institute for Health Research Australian Catholic University Senior Analyst - Elkhart Group Ltd. http://

Re: [Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread JJ Allaire
Yes, we'd LOVE to see this turned into an Rcpp Gallery article once you've got everything ironed out! Details on creating Gallery articles here: https://github.com/jjallaire/rcpp-gallery/wiki/Contributing-to-the-Rcpp-Gallery On Tue, Apr 14, 2015 at 5:36 PM, Joshua Wiley wrote: > Hi JJ, > > Thank

Re: [Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread Dirk Eddelbuettel
On 15 April 2015 at 07:36, Joshua Wiley wrote: | Thank you, that worked wonderfully.   THis *clearly* calls for an Rcpp Gallery post as you evidently best the 'faster lm' approaches in parallel. Can we count on you? Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _

Re: [Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread Joshua Wiley
Hi JJ, Thank you, that worked wonderfully. Thanks to your help, I've been able to add a simple way of bootstrapping with some success, that seems about 25x faster than direct lm() calls using 4 threads. I've put it online in case anyone else runs across this and is interested: https://gist.gith

Re: [Rcpp-devel] Pass matrix by copy

2015-04-14 Thread Kevin Ushey
This is by design; we pass objects by reference for efficiency. Use `Rcpp::clone()` to explicitly duplicate objects. On Tue, Apr 14, 2015 at 10:15 AM, wrote: > Hello, > > I have just noticed that my small Rcpp function changes the original > matrix on the R side -- why and how to pass by copy? >

[Rcpp-devel] Pass matrix by copy

2015-04-14 Thread soeren . vogel
Hello, I have just noticed that my small Rcpp function changes the original matrix on the R side -- why and how to pass by copy? Thanks Sören #include using namespace Rcpp; // [[Rcpp::export]] NumericMatrix test_min( NumericMatrix M ) { int n = M.nrow(); for ( int i = 0; i <

Re: [Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread JJ Allaire
The initialization of your const fields needs to happen within the initializer list (rather than inline where the fields are declared). If you substitute this code for the code in your example everything will compile: // QR Decomposition const CPivQR PQR; const Permutation Pmat; const int

[Rcpp-devel] Integrating RcppParallel and RcppEigen

2015-04-14 Thread Joshua Wiley
Hi, I'm interested in combining faster linear model estimation via QR decompositions from RcppEigen with JJs new(er) RcppParallel package to do cross validation and bootstrapping on linear models. As a first step, I've been trying to merge the JSS paper on RcppEigen ( http://www.jstatsoft.org/v52