>> ### For the Rcpp part, set aside working space in the global environment
>> workspace <- lapply(1:K, function(k) matrix(0.0, N, M))
>
> Then I try to access the matrices in the 'workspace' list and modify them,
> but so far I have had no success. The first attemp, bolow, does not compile...
>
>
> Giovanni,
>
> Anything you pass from R into your C++ routine should be considered
> read-only. It's typically a bad idea to do in-place updates of the R
> object you passed in as an argument.
Really? I was under the impression that the ability of in-place
modification was a conscious design dec
On 19 October 2012 at 01:19, Christian Gunning wrote:
| > Anything you pass from R into your C++ routine should be considered
| > read-only. It's typically a bad idea to do in-place updates of the R
| > object you passed in as an argument.
|
| Really? I was under the impression that the ability
On 18 October 2012 at 21:54, Davor Cubranic wrote:
| OK, 'sweep' is a fair bit (15x) slower than the Rcpp code Giovanni
| wrote, but you still should be using the return value of the C++
| function to get the result back to R, rather than writing directly into
| function arguments.
|
| Here is