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

Douglas Bates bates at stat.wisc.edu
Wed May 5 21:45:03 CEST 2010


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.begin(), x.begin(),
std::multiplies<double>());

in Rcpp-based C++?


More information about the Rcpp-devel mailing list