Skip to content
Prev 2702 / 10988 Next

[Rcpp-devel] Some questions regarding internals of Rcpp objects

Le 06/08/11 06:40, Ulrich Bodenhofer a ?crit :
No mystery.

 > typeof(matrix(1:16, 4, 4))
[1] "integer"

So NumericMatrix has no choice but to coerce your data to numeric, so 
matC and matD are two new objects, different from mat
very dangerous. vec will be garbage collected at some time you don't 
control. don't do that.