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

Davor Cubranic cubranic at stat.ubc.ca
Thu May 6 01:22:11 CEST 2010


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 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++?
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-dev
> el
> 


More information about the Rcpp-devel mailing list