Hi Josh,
On 7 July 2012 at 17:05, Joshua Wiley wrote:
| Thank you so much! That worked and helped me understand why it was
| happening :) The idea of pointers is new to me so I think I need to
| spend more time learning about that.
You can think of the Rcpp::* objects as 'proxies' for the R ob
On 8 July 2012 at 01:46, Alexandre Bujard wrote:
| Hi Joshua,
|
| When you declare "NumericVector xx(x)" xx is a copy of the pointer x. But they
| both address the same location in the memory.
+1
| What you need here is to do a "deep copy" of the vector x. The best was to do
| that in Rcpp is t
Hi Alexandre,
Thank you so much! That worked and helped me understand why it was
happening :) The idea of pointers is new to me so I think I need to
spend more time learning about that.
Thanks again,
Josh
On Sat, Jul 7, 2012 at 4:46 PM, Alexandre Bujard
wrote:
> Hi Joshua,
>
> When you decl
Hi Joshua,
When you declare "NumericVector xx(x)" xx is a copy of the pointer x. But
they both address the same location in the memory.
What you need here is to do a "deep copy" of the vector x. The best was to
do that in Rcpp is to use the function "clone".
Also declaring your vector xx with "con
Hi,
I am familiar with R but quite new to C++. I am reading a C++
textbook, so if this is an obvious question just resulting in my
ignorance of C++, please let me know.
I tried to translate someone else's R loop that was slow into c++ to
use with Rcpp and the inline package:
require(Rcpp)
requi