Hi Dirk and Romain,
Thanks for your help. I see now that I was treating the NumericMatrix
declarations as copy constructors, but rather should be thinking of them
as wrapper objects, and I need to be careful to only assign one Rcpp
variable to each SEXP. Also, a good catch of the difference
Le 25/05/10 04:38, Dirk Eddelbuettel a écrit :
Hi Erica,
Thanks for your interest in Rcpp, and for posting on the list!
On 24 May 2010 at 20:58, Yi-Hsin Erica Tsai wrote:
| Hi,
|
| I've just started using Rcpp with the hopes of speeding up some R loops
| through replacement with C++ code. I'
Hello,
This has nothing to do with default arguments, wrappers, etc ... on the
R side.
The issue is the difference between :
> typeof( matrix((1:9), 3, 3) )
[1] "integer"
> typeof( matrix(seq(1,9)^2, ncol=3) )
[1] "double"
The constructor of NumericMatrix has no choice but to cast the input