Emmanuel Hamel
Emmanuel Hamel

Reputation: 2223

How to convert a NumericVector to RcppParallel::RVector<float> or a NumericMatrix to RcppParallel::RMatrix<float>?

In a parallel code with Rcpp, I convert a NumericVector variable to RcppParallel::RVector<double>. I also convert a NumericMatrix variable to RcppParallel::RMatrix<double>.

To speed up the code, I would like to use float variables instead of double. Hence, I would like to convert a NumericVector variable to something like RcppParallel::RVector<float> and a NumericMatrix variable to something like RcppParallel::RMatrix<float>.

Is it possible? If so, could you provide an example?

Upvotes: 0

Views: 47

Answers (0)

Related Questions