Hello Dear Community,
I am learning RcppParallel and have this issue while trying to convert a Rcpp::CharacterMatrix to RcppParallel::RMatrix using following codes:
struct CharMatDist : RcppParallel::Worker {
const RcppParallel::RMatrix<std::string> A;
const RcppParallel::RMatrix<std::string> B;
const NumericVector w;
RcppParallel::RMatrix<double> ret;
int n;
CharMatDist(CharacterMatrix A, CharacterMatrix B, NumericVector w, NumericMatrix ret)
: A(A), B(B), w(w), ret(ret) {
n = B.nrow();
}
...
}
As the gallery suggests, I would expect the convertion to be carried out automatically in A(A) etc. but it is not working and gives me following error:
cannot convert 'Rcpp:Matrix<16>::iterator (aka Rcpp::internal::Proxy_iterator<Rcpp::internal::string_proxy<16> >)' to 'char*' in initialization
I also tried
RMatrix<char>
and even manual cast in body but also without success. Where am I doing wrong??
Any suggestions and help would be highly appreciated.
YYA