You could also use this:
Summing3 <- cxxfunction(signature(x="numeric"), '
Rcpp::NumericVector Dvec(x);
double out = sum(Dvec);
return Rcpp::wrap(out);
',plugin="Rcpp")
x <- rnorm(100)
Summing3(x); sum(x)
Richard
On Mon, Jan 3, 2011 at 11:04 AM, Cedric Ginestet <
c.gineste...@go
Thanks Douglas,
How stupid of me!
Cheers,
On 03/01/11 16:00, Douglas Bates wrote:
You forgot to initialize i in both loops. It should be
for(int i = 0; i< Ne; i++)
On Mon, Jan 3, 2011 at 9:50 AM, Cedric Ginestet
wrote:
Dear Rcpp experts,
I have the following bizarre problem. Although the
You forgot to initialize i in both loops. It should be
for(int i = 0; i < Ne; i++)
On Mon, Jan 3, 2011 at 9:50 AM, Cedric Ginestet
wrote:
> Dear Rcpp experts,
>
> I have the following bizarre problem. Although the second summing C++
> function seems easier than the former, it does not produce t