Skip to content
Prev 3093 / 10988 Next

[Rcpp-devel] can one modify array in R memory from C++ without copying it?

Not a bug, this is expected behaviour. 

If you pass a matrix of ints to the NumericVector ctor, Rcpp has no choice but to coerce the data to a matrix of double, which means new data, hence the original data does not get modified. 

If you pass a matrix of double, no copy is required, therefore Rcpp operates directly on the data. 

Those are features. 



Le 4 nov. 2011 ? 08:01, Darren Cook <darren at dcook.org> a ?crit :

Thread (18 messages)

Christian Gunning can one modify array in R memory from C++ without copying it? Nov 1 andre zege can one modify array in R memory from C++ without copying it? Nov 1 Christian Gunning can one modify array in R memory from C++ without copying it? Nov 2 andre zege can one modify array in R memory from C++ without copying it? Nov 3 Darren Cook can one modify array in R memory from C++ without copying it? Nov 3 Darren Cook can one modify array in R memory from C++ without copying it? Nov 4 Romain Francois can one modify array in R memory from C++ without copying it? Nov 4 Darren Cook can one modify array in R memory from C++ without copying it? Nov 4 Dirk Eddelbuettel can one modify array in R memory from C++ without copying it? Nov 4 andre zege can one modify array in R memory from C++ without copying it? Nov 4 Dirk Eddelbuettel can one modify array in R memory from C++ without copying it? Nov 4 Steve Lianoglou can one modify array in R memory from C++ without copying it? Nov 4 Dirk Eddelbuettel can one modify array in R memory from C++ without copying it? Nov 4 Steve Lianoglou can one modify array in R memory from C++ without copying it? Nov 4 Douglas Bates can one modify array in R memory from C++ without copying it? Nov 4 Darren Cook can one modify array in R memory from C++ without copying it? Nov 6 Dirk Eddelbuettel can one modify array in R memory from C++ without copying it? Nov 6 Davor Cubranic can one modify array in R memory from C++ without copying it? Nov 6