Rcpp: How to ensure deep copy of a NumericMatrix?

1.4k views Asked by At

Suppose, I have a Rcpp::NumericMatrix A. I want to make an identical copy (not pointer copy) of A into another Rcpp::NumericMatrix B. Is this the correct way of doing this job?

Rcpp::NumericMatrix B(Rcpp::clone(A));

Also what is the difference between the above line and the following:

Rcpp::NumericMatrix B(A);
0

There are 0 answers