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
Dear Rcpp experts,
I have the following bizarre problem. Although the second summing C++
function seems easier than the former, it does not produce the correct
answer. See the following reproducible codes:
##
Summing1 <- cxxfunction(signature(x="numeric
Rainer,
Please use the rcpp-devel list for questions. You need to subscribe to post,
or you can use a web-to-list interface to gmane.org.
On 3 January 2011 at 11:54, Rainer Hurling wrote:
| I want to build and install Rcpp_0.9.0.tar.gz in R-2.12.1 on FreeBSD
| 9.0-CURRENT (amd64). The build pro