Re: [Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Romain Francois
Definitely. I'm doing some polishing of the code and making it more general so that it works with arbitrary sugar expressions too. But yes. it will go in at some point today. Romain Le 15/11/12 08:36, Søren Højsgaard a écrit : Thanks a lot; that seems elegant. Could one imagine that this go

Re: [Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Søren Højsgaard
Thanks a lot; that seems elegant. Could one imagine that this goes into the next version of Rcpp? That would be nice. Regards Søren -Original Message- From: Romain Francois [mailto:rom...@r-enthusiasts.com] Sent: 15. november 2012 00:50 To: Søren Højsgaard Cc: rcpp-devel@lists.r-forge.r

[Rcpp-devel] Compilation error in Rcpp

2012-11-14 Thread Karl Millar
In the Rcpp 0.10.0, inst/include/Rcpp/sugar/logical/SingleLogicalResult.h there is the code: template class conversion_to_bool_is_forbidden : conversion_to_bool_is_forbidden{ Which obviously can't be instantiated. Presumably the code should be: template class conversion_to_bool_is_forbidden :

Re: [Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

2012-11-14 Thread Dirk Eddelbuettel
On 14 November 2012 at 21:25, Christian Gunning wrote: | | | On Wed, Nov 14, 2012 at 6:14 AM, Dirk Eddelbuettel wrote: | | | Thank you, got both emails!  Will take a closer look -- we were busy with | releasing Rcpp 0.10.0 which will rock :) | | | Sorry, I posted to list from wrong

Re: [Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

2012-11-14 Thread Christian Gunning
On Wed, Nov 14, 2012 at 6:14 AM, Dirk Eddelbuettel wrote: > > Thank you, got both emails! Will take a closer look -- we were busy with > releasing Rcpp 0.10.0 which will rock :) > Sorry, I posted to list from wrong address; 0.10.0 looks great. I found the copious informational links at the bot

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread JJ Allaire
> > 2. If my package already has a namespace named ernm, is an extra one > wrapped around it, so that extending packages would have to use > ernm::ernm::bar()? > No, the generated header file for a package exports functions within the package namespace but that doesn't preclude other headers from

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Romain Francois
Le 15/11/12 01:02, Darren Cook a écrit : so when the object returns from this as, a copy is involved. We return a T, not a T*, or a T& I wonder if this gets optimized away, though? E.g. http://blog.knatten.org/2011/08/26/dont-be-afraid-of-returning-by-value-know-the-return-value-optimization/

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Darren Cook
> so when the object returns from this as, a copy is involved. We return a > T, not a T*, or a T& I wonder if this gets optimized away, though? E.g. http://blog.knatten.org/2011/08/26/dont-be-afraid-of-returning-by-value-know-the-return-value-optimization/ Definitely worth profiling and/or looki

Re: [Rcpp-devel] [ANN] Rcpp 0.10.0

2012-11-14 Thread Darren Cook
Hello Dirk, Romain, JJ, Very interesting-looking new release. Thank-you for all your efforts! > Rcpp attributes derive their syntax from C++11 style attributes ... Does this depend on g++ and/or c+11 support? Or do you the do the parsing yourself? Darren -- Darren Cook, Software Researcher/De

Re: [Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Romain Francois
Ah. Things are particularly interesting if you want to deal with strings. The code below implements a c++ version of match for character vectors. beware it uses trickery related to tricking the write barrier (but not an issue as we are not "writing"). require(Rcpp) sourceCpp( code = ' #inclu

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Romain Francois
Le 15/11/12 00:14, Richard Downe a écrit : Thanks. I had recently been playing with using XPtr to do some of the passing RcppModule objects back into c++, with only limited success, so this will be a welcome change. Also, I can probably finally cull my hackery of calling Rcpp::internal::make_ne

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Richard Downe
Thanks. I had recently been playing with using XPtr to do some of the passing RcppModule objects back into c++, with only limited success, so this will be a welcome change. Also, I can probably finally cull my hackery of calling Rcpp::internal::make_new_object in my factory methods, which alw

Re: [Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Søren Højsgaard
Thanks! What I need to do is this > match(c("b","k"), letters) [1] 2 11 Regards Søren -Original Message- From: rcpp-devel-boun...@lists.r-forge.r-project.org [mailto:rcpp-devel-boun...@lists.r-forge.r-project.org] On Behalf Of Romain Francois Sent: 15. november 2012 00:01 To: rcpp-de

Re: [Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Romain Francois
Le 14/11/12 23:48, Søren Højsgaard a écrit : Dear all, I need to call R's match function from a c++ program so I can do Rcpp::Function R_match("match"); Rcpp::NumericVector out = R_match(x_, table_); However, I wonder if there is such a "match" function in C++ that I can call (to avoid the

[Rcpp-devel] Rcpp "version" of R's match function

2012-11-14 Thread Søren Højsgaard
Dear all, I need to call R's match function from a c++ program so I can do Rcpp::Function R_match("match"); Rcpp::NumericVector out = R_match(x_, table_); However, I wonder if there is such a "match" function in C++ that I can call (to avoid the extra overhead)? Any ideas would be welcome Re

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Dirk Eddelbuettel
On 14 November 2012 at 13:46, Ian Fellows wrote: | | So,… um… Wow! | | This is some pretty incredible work, and lines up almost to the letter with the real world issues that I was experiencing with my package. Reading over the vignette, a couple of questions popped into my head. Thanks :) We'

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Romain Francois
nonzero probabilities given). This is intended to be used solely in C++ code, and is not exported. best, Christian University of New Mexico -- A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal ? Panama! -- next part -- An HTML attachment was scrubbed... URL: <

Re: [Rcpp-devel] Rcpp 0.10.0

2012-11-14 Thread Ian Fellows
delbuettel | e...@debian.org | http://dirk.eddelbuettel.com > > > -- > > Message: 2 > Date: Wed, 14 Nov 2012 06:05:48 -0700 > From: Christian Gunning > To: rcpp-devel@lists.r-forge.r-project.org > Subject: [Rcpp-devel] Sample functi

Re: [Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

2012-11-14 Thread Romain Francois
Le 14/11/12 14:05, Christian Gunning a écrit : Dear all, The attached file is for inclusion in RcppArmadillo/src. It's a templated implementation of R's sample that relies on a few Armadillo functions. It should produce results identical to R, except when R uses Walker's alias method (with rep

Re: [Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

2012-11-14 Thread Dirk Eddelbuettel
Christian, On 14 November 2012 at 06:05, Christian Gunning wrote: | Dear all, | | The attached file is for inclusion in RcppArmadillo/src.  It's a templated | implementation of R's sample that relies on a few Armadillo functions.  It | should produce results identical to R, except when R uses Wa

[Rcpp-devel] Sample function(s) for inclusion in RcppArmadillo

2012-11-14 Thread Christian Gunning
Dear all, The attached file is for inclusion in RcppArmadillo/src. It's a templated implementation of R's sample that relies on a few Armadillo functions. It should produce results identical to R, except when R uses Walker's alias method (with replacement, more than 200 nonzero probabilities giv

[Rcpp-devel] [ANN] Rcpp 0.10.0

2012-11-14 Thread Dirk Eddelbuettel
We are very excited about Rcpp 0.10.0 which appeared on CRAN this morning. The announcement text included in the package is below -- see in particular the new vignette Rcpp-attributes. We will probably provide more example in the following days and weeks. Cheers, Dirk = Summary = Ve