Re: [Rcpp-devel] How to put the code 2013-01-05-r-function-from-c++.cpp in the src/ directory of a package?

2013-05-26 Thread Dirk Eddelbuettel
On 26 May 2013 at 22:12, Peng Yu wrote: | > Sorry but that is once again incorrect. Read the "Rcpp attributes" vignette, | | I'd rather not to put it as incorrect or correction. I did not know | "compileAttributes". Maybe because you refuse to read documentation? | I have downloaded all the 10

Re: [Rcpp-devel] How to put the code 2013-01-05-r-function-from-c++.cpp in the src/ directory of a package?

2013-05-26 Thread Peng Yu
On Sun, May 26, 2013 at 6:00 PM, Dirk Eddelbuettel wrote: > > On 26 May 2013 at 17:39, Peng Yu wrote: > | The straight forward answer to my question in the title is that > | 2013-01-05-r-function-from-c++.cpp should not be directly put to src/ > | direction in an R package. > > Sorry but that is o

Re: [Rcpp-devel] How to put the code 2013-01-05-r-function-from-c++.cpp in the src/ directory of a package?

2013-05-26 Thread Dirk Eddelbuettel
On 26 May 2013 at 17:39, Peng Yu wrote: | The straight forward answer to my question in the title is that | 2013-01-05-r-function-from-c++.cpp should not be directly put to src/ | direction in an R package. Sorry but that is once again incorrect. Read the "Rcpp attributes" vignette, and learn ab

Re: [Rcpp-devel] How to put the code 2013-01-05-r-function-from-c++.cpp in the src/ directory of a package?

2013-05-26 Thread Peng Yu
I knew what you posted in the previous email and I did not ask to you post it. Why did you complain that you were tied of it? The straight forward answer to my question in the title is that 2013-01-05-r-function-from-c++.cpp should not be directly put to src/ direction in an R package. The functio

Re: [Rcpp-devel] Access Rcpp::List element

2013-05-26 Thread Simon Zehnder
Hi Dirk, thanks for this bunch of information. I will work through it the next days. Your point with the rnorm-Function is indeed an essential one. It takes the most time, so that the remaining time is almost negligible. A timing inside a loop with a a lot of memory writing makes more sense,

Re: [Rcpp-devel] Could Rcpp class(like NumericVector) be implemented in c++?

2013-05-26 Thread Dirk Eddelbuettel
On 26 May 2013 at 11:28, Kevin Ushey wrote: | If you're trying to compile this as a standalone application, I guess you have | to link against both libRcpp and (a generated?) libR. Try R-exts; | specifically, http://cran.r-project.org/doc/manuals/r-devel/R-exts.html# | Compiling-against-the-R-libr

Re: [Rcpp-devel] Could Rcpp class(like NumericVector) be implemented in c++?

2013-05-26 Thread Kevin Ushey
If you're trying to compile this as a standalone application, I guess you have to link against both libRcpp and (a generated?) libR. Try R-exts; specifically, http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Compiling-against-the-R-library. -Kevin On Sun, May 26, 2013 at 10:52 AM, Dirk

Re: [Rcpp-devel] Could Rcpp class(like NumericVector) be implemented in c++?

2013-05-26 Thread Dirk Eddelbuettel
On 26 May 2013 at 10:23, Qing Xia wrote: | Dear All, | | I tried to use NumericVector in class declaration, Eclipse could compile the | code, but could not run it (something to do with the R.dll). I tried replacing | NumericVector with vector and it worked with no problem. I want to use | Numeric

Re: [Rcpp-devel] Access Rcpp::List element

2013-05-26 Thread Dirk Eddelbuettel
On 26 May 2013 at 18:41, Simon Zehnder wrote: | Apologize for being imprecise in my second question. I try to rephrase it here, so more members can understand: | | 2'. As performance is always a matter in statistical computations, | especially in simulations, it is of special interest to know,

[Rcpp-devel] Could Rcpp class(like NumericVector) be implemented in c++?

2013-05-26 Thread Qing Xia
Dear All, I tried to use NumericVector in class declaration, Eclipse could compile the code, but could not run it (something to do with the R.dll). I tried replacing NumericVector with vector and it worked with no problem. I want to use NumericVector so that I could use Rcpp sugar to compute the m

Re: [Rcpp-devel] Access Rcpp::List element

2013-05-26 Thread Simon Zehnder
Dear Dirk, thanks for your fast reply to my questions. Apologize for being imprecise in my second question. I try to rephrase it here, so more members can understand: 2'. As performance is always a matter in statistical computations, especially in simulations, it is of special interest to kno

Re: [Rcpp-devel] Access Rcpp::List element

2013-05-26 Thread Dirk Eddelbuettel
Simon, On 26 May 2013 at 15:20, Simon Zehnder wrote: | Dear Rcpp::Devels and Rcpp::Users, | | I have maybe some trivial questions. | | 1. If I use | | Rcpp::NumericVector A(someVector), | | does it reuse memory from someVector for A? From http://cran.r-project.org/web/package

[Rcpp-devel] Access Rcpp::List element

2013-05-26 Thread Simon Zehnder
Dear Rcpp::Devels and Rcpp::Users, I have maybe some trivial questions. 1. If I use Rcpp::NumericVector A(someVector), does it reuse memory from someVector for A? From http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-quickref.pdf I would say it does, whereas