Rcpp: How to ensure deep copy of a NumericMatrix?

六月ゝ 毕业季﹏ 提交于 2021-01-27 06:22:06

问题


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);

来源:https://stackoverflow.com/questions/31015321/rcpp-how-to-ensure-deep-copy-of-a-numericmatrix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!