Skip to content
Prev 3090 / 10988 Next

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

Chris, i set a tiny matrix


mm<-matrix(1:10, nr=2),

cut your code  pasted it into R

after i run myfun(mm), i still have exactly the same matrix when i print mm
as before, not a doubled matrix

The function myfun did return a doubled matrix, but original matrix mm
stayed the same, so it still appears that original R memory was not changed
from C++

I maybe missing something very obvious, i don't understand how it's
possible that the same code seems to give you a different result, just
reporting what i personally observe when i go exactly through the motions
you suggested
On Wed, Nov 2, 2011 at 9:53 PM, Christian Gunning <xian at unm.edu> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20111103/932f2220/attachment.htm>

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