Re: [Rcpp-devel] Rcpp-quickref patch - Inline, Random

2010-12-08 Thread Christian Gunning
Attached is a patch relative to pkg/Rcpp/inst/doc/Rcpp-quickref that supercedes the previous patch. Advice on using stats functions is provided, and examples include doubles for distribution-specific parameters. best, xian On Tue, Dec 7, 2010 at 3:15 AM, Christian Gunning wrote: > Attached is a

Re: [Rcpp-devel] Step-by-Step Plan to Code Writing and Testing withRcpp, RcppGSL or RcppArmadillo

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 20:05, Savitsky, Terrance wrote: | Hello Dirk, I sincerely apologize for how I started the dialogue. May | I have a do-over? Sure. | I am an inexperienced developer. So I'm looking | forward to using Rcpp to improve my productivity and output quality with | writing C++

Re: [Rcpp-devel] more on stats functions

2010-12-08 Thread Christian Gunning
> With that I simply do > >   $ ~/bin/runit.sh -p Rcpp,inline inst/unitTests/runit.stats.R > > as shown below. Thanks, works for me. -xian -- A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama! ___ Rcpp-devel mailing list Rcpp-devel@l

Re: [Rcpp-devel] more on stats functions

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 20:54, Christian Gunning wrote: | On Wed, Dec 8, 2010 at 1:18 AM, Romain Francois | wrote: | > | > It might make sense to get rid of the log = argument and maybe add a ldnorm, | > or log_dnorm, or dnorm_log instead. so that there is no ambiguity. | | One nice part about the

Re: [Rcpp-devel] Step-by-Step Plan to Code Writing and Testing withRcpp, RcppGSL or RcppArmadillo

2010-12-08 Thread Savitsky, Terrance
Hello Dirk, I sincerely apologize for how I started the dialogue. May I have a do-over? I am an inexperienced developer. So I'm looking forward to using Rcpp to improve my productivity and output quality with writing C++ for R implementation. I will re-read the documents and presentations yo

Re: [Rcpp-devel] more on stats functions

2010-12-08 Thread Christian Gunning
On Wed, Dec 8, 2010 at 1:18 AM, Romain Francois wrote: > > It might make sense to get rid of the log = argument and maybe add a ldnorm, > or log_dnorm, or dnorm_log instead. so that there is no ambiguity. One nice part about the current setup is that R-exts.pdf chapter 6 serves as a (mostly) defi

Re: [Rcpp-devel] Step-by-Step Plan to Code Writing and Testing with Rcpp, RcppGSL or RcppArmadillo

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 17:44, Savitsky, Terrance wrote: | I?m having difficulty to find ?How-to? documentation; the papers and | presentations (including the RcppExamples package) are exciting, but focus on | marketing use, Nice way to start a dialogue with us by telling us we're idiots. Keep go

[Rcpp-devel] Step-by-Step Plan to Code Writing and Testing with Rcpp, RcppGSL or RcppArmadillo

2010-12-08 Thread Savitsky, Terrance
I'm having difficulty to find "How-to" documentation; the papers and presentations (including the RcppExamples package) are exciting, but focus on marketing use, rather than providing instructions. I'd appreciate any help to get started to: 1. Code C++ using the Rcpp, RcppGSL and RcppA

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 16:27, Andrew Redd wrote: | Thanks for pointing that out.  I don't pretend to understand the reasons but | that method seems to be much more responsive than the throw/catch method.  It | seems like the throw catch should be just as efficient, and should add very | little over

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Andrew Redd
Thanks for pointing that out. I don't pretend to understand the reasons but that method seems to be much more responsive than the throw/catch method. It seems like the throw catch should be just as efficient, and should add very little overhead. It does not add overhead, but the R_CheckUserInter

Re: [Rcpp-devel] Modules docs

2010-12-08 Thread Dominick Samperi
On Wed, Dec 8, 2010 at 6:15 PM, Romain Francois wrote: > I'm not sure which version of the vignette you are referring to, but the > one on CRAN (related to Rcpp 0.8.9) recommends to have this in the > NAMESPACE: > > import(Rcpp) > > This might be conservative and you might end up importing too muc

Re: [Rcpp-devel] Modules docs

2010-12-08 Thread Romain Francois
I'm not sure which version of the vignette you are referring to, but the one on CRAN (related to Rcpp 0.8.9) recommends to have this in the NAMESPACE: import(Rcpp) This might be conservative and you might end up importing too much. I don't see much of a downside to it. Le 08/12/10 21:21, Do

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Davor Cubranic
How about just using R_CheckUserInterrupt()? Davor On 2010-12-08, at 1:02 PM, Dirk Eddelbuettel wrote: > > On 8 December 2010 at 13:41, Andrew Redd wrote: > | I have an MCMC chain that runs entirely in c++ with Rcpp. It sometimes runs > | for a vary long time and I want to interrupt it. Is t

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 15:31, Douglas Bates wrote: | > void intHandler(int dummy=0) { | >  std::cerr << "In intHandler" << std::endl; | >  throw std::runtime_error("Interception caught"); | > } | | Gee, I wouldn't have pictured you as an American football fan. I | think you meant "interrupt caugh

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Douglas Bates
On Wed, Dec 8, 2010 at 3:02 PM, Dirk Eddelbuettel wrote: > > On 8 December 2010 at 13:41, Andrew Redd wrote: > | I have an MCMC chain that runs entirely in c++ with Rcpp.  It sometimes runs > | for a vary long time and I want to interrupt it.  Is there an efficient easy > | way to include catching

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Dirk Eddelbuettel
On 8 December 2010 at 13:41, Andrew Redd wrote: | I have an MCMC chain that runs entirely in c++ with Rcpp.  It sometimes runs | for a vary long time and I want to interrupt it.  Is there an efficient easy | way to include catching an interupt signal and either aborting or returning | results to t

Re: [Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Tama Ma
Ctrl-C for abort? Tama On Dec 8, 2010, at 9:41 PM, Andrew Redd wrote: > I have an MCMC chain that runs entirely in c++ with Rcpp. It sometimes runs > for a vary long time and I want to interrupt it. Is there an efficient easy > way to include catching an interupt signal and either aborting

[Rcpp-devel] Interrupts in compiled code.

2010-12-08 Thread Andrew Redd
I have an MCMC chain that runs entirely in c++ with Rcpp. It sometimes runs for a vary long time and I want to interrupt it. Is there an efficient easy way to include catching an interupt signal and either aborting or returning results to that point? This might be understood well, if so I apolog

Re: [Rcpp-devel] Modules docs

2010-12-08 Thread Dominick Samperi
To be more concrete, I define a module in foo.cpp and do something like this: foo = Module("MyClass", PACKAGE="MyPack") foo$myfunc() Where myfunc() is defined using function() in the RCPP_MODULE macro. I can also extract the underlying reference and work with that as well. This works without the

[Rcpp-devel] Modules docs

2010-12-08 Thread Dominick Samperi
I have a question about the modules vignette. At the end it says client packages must importClassesFrom(...), and there are comments about using .onLoad() as well. But before reading this I already implemented the use of modules in another (client) package without using these constructions. They

Re: [Rcpp-devel] more on stats functions

2010-12-08 Thread Romain Francois
Le 08/12/10 05:25, Christian Gunning a écrit : Your contributions are useful. It helps us understanding how people from outside the team use Rcpp. Thanks. As per Dirk's comment, I went back to the unit tests and will use those as guidance for quickref. The problem I got stuck on looks to be t