This may already be common knowledge (apologies if it is), but a quick scan of
the (recent) email exchanges did not suggest so, and I have come across a
number of partial questions and answers on this same topic.
I have been struggling with an annoying lambda/template bug in gcc 4.6.3 :
https:
Its just a typo on plugin (no s). And scope Rcpp::wrap.
cfunc <- cxxfunction( signature(start="vector"), body = 'Rcpp::NumericVector
x(start); return Rcpp::wrap(1);', plugin = "Rcpp" )
extra 's' on parameter plugins
or
cfunc <- cxxfunction( signature(start="vector"), body = 'using namespace Rc
This has already been answered by Dirk and Bill. Although the OPs example can,
of course, be reproduced in R, sans Rcpp. I use rep(0.1,9) in place of
rep(0.1,10).
We can use Rcpp to see various differences explicitly:
> options(digits=22)
> vx=rep(0.1,9)
> vx[1]+vx[2]+vx[3]+vx[4]+vx[5]+vx[6]+v
d sorry for the unclear post! Thanks
From: rcpp-devel-boun...@r-forge.wu-wien.ac.at
[rcpp-devel-boun...@r-forge.wu-wien.ac.at] on behalf of Dirk Eddelbuettel
[e...@debian.org]
Sent: 18 August 2011 14:39
To: x...@unm.edu
Cc: rcpp-de...@r-forge.wu-wien.ac.at
Subject: Re: [Rcpp-dev
regardless! :-) ta, chris.
From: icos.atr...@gmail.com [icos.atr...@gmail.com] on behalf of Christian
Gunning [x...@unm.edu]
Sent: 18 August 2011 09:14
To: rcpp-de...@r-forge.wu-wien.ac.at
Cc: Wray, Christopher
Subject: R.e. Speed gain assistance (Wray, Christopher)
T
Hi list - although not strictly (or not really at all..) an Rcpp problem - I
thought that since there are so many 'better-than-I' c++ coders here - whom are
familiar with R... it might be a good place to ask.
I have a "naive" piece of code - that in essence replicates what the R function
"sampl
=
x=matrix(1:12,4,3);
print(ifelse(x<5,x*x,x))
src2='
using namespace Rcpp;
NumericMatrix x(x_);
NumericVector y=ifelse(x<5,x*x,x);
y.attr("dim")=Dimension(x.nrow(),x.ncol());
return y;
'
fun=cxxfunction(signature(x_ ="integer"),src2,plugin="Rcpp")
print(fun(x))
===
does
try:
int min_el_ind = std::min_element(TimeQ.begin(), TimeQ.end()) - TimeQ.begin();
From: rcpp-devel-boun...@r-forge.wu-wien.ac.at
[rcpp-devel-boun...@r-forge.wu-wien.ac.at] on behalf of Silkworth,David J.
[silkw...@airproducts.com]
Sent: 04 June 2011 18:
As Dirk says, using "inline" makes it real simple to start and to prototype
code.
You mention you have R functions you wish to "call" via Rcpp. Im not certain I
fully understand what you require here, but it is pretty simple to pass R-side
functions to C++ via Rcpp, and similarly its simple to
orge.r-project.org] on behalf of Romain Francois
[rom...@r-enthusiasts.com]
Sent: 13 December 2010 10:07
To: rcpp-devel@lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] Sugar/inline and RTools
Hello,
Le 12/12/10 16:28, Dirk Eddelbuettel a écrit :
>
> Hi Chris,
>
> On 12 December
Hi,
Im using windows7, R2.12, Rtools2.12 and all the latest packages of inline,
rcpp, etc. Over the last few weeks I have managed to get loads of the examples
working, and all makes sense and is pretty clear. I had a couple of
questions/comments:
1. RTools: On windows, I understand that Rcpp an
11 matches
Mail list logo