Re: [Rcpp-devel] [slightly OT] Can std::transform be used in place?

2010-05-05 Thread Dirk Eddelbuettel
On 5 May 2010 at 14:45, Douglas Bates wrote: | I haven't seen in any of the descriptions of the std::transform | template whether it can modify values in place. For example, can I | perform the equivalent of the | | x <- x * mult | | operation in R, where x and mult are both numeric n-dimension

Re: [Rcpp-devel] [slightly OT] Can std::transform be used in place?

2010-05-05 Thread Davor Cubranic
According to www.cplusplus.com/reference/algorithm/transform/, "The function allows for the destination range to be the same as one of the input ranges to make transformations in place." Davor On May 5, 2010 12:45:03 pm Douglas Bates wrote: > I haven't seen in any of the descriptions of the s

[Rcpp-devel] [slightly OT] Can std::transform be used in place?

2010-05-05 Thread Douglas Bates
I haven't seen in any of the descriptions of the std::transform template whether it can modify values in place. For example, can I perform the equivalent of the x <- x * mult operation in R, where x and mult are both numeric n-dimensional vectors, as std::transform(x.begin(), x.end(), mult.begi

Re: [Rcpp-devel] Yet Another Design Question

2010-05-05 Thread Romain Francois
Le 13/04/10 00:14, Douglas Bates a écrit : One of the advantages of using S4 classes and methods in R is that there are formal definitions of classes. I plan eventually to write R code that will take an S4 class definition and create a C++ class definition and constructor code to mirror the R c

Re: [Rcpp-devel] Yet another design question regarding Rcpp

2010-05-05 Thread Romain Francois
Le 04/05/10 22:26, Douglas Bates a écrit : In the files src/MatrixNs.{h,cpp} of the lme4a package (the development version of lme4, available only from R-forge) I create C++ classes that parallel some of the S4 classes in the Matrix package for R. Most of the time I apply operations in those cl