Re: [Rcpp-devel] conflict between R_ext/Applic.h and RcppArmadillo.h?

2012-03-02 Thread Richard Chandler
think CRAN would accept the package? Richard On Thu, Mar 1, 2012 at 5:35 PM, Dirk Eddelbuettel wrote: > > Richard, > > On 1 March 2012 at 15:36, Dirk Eddelbuettel wrote: > | > | Hi Richard, > | > | On 1 March 2012 at 16:25, Richard Chandler wrote: > | | Hi, > | | &g

[Rcpp-devel] conflict between R_ext/Applic.h and RcppArmadillo.h?

2012-03-01 Thread Richard Chandler
Hi, I am trying to call Rdqags (from R_ext/Applic.h) in a C++ program that uses RcppArmadillo. Everything seems to work fine except the compiler warns about conflicts. Is there a way to avoid these conflicts? Could they cause any unforeseen problems? Below is a self-contained example illustrating

Re: [Rcpp-devel] Request for help with compiling Rcpp example

2011-10-14 Thread Richard Chandler
You can turn it off by setting the following environment variable CYGWIN=nodosfilewarning Richard On Fri, Oct 14, 2011 at 10:39 AM, Dirk Eddelbuettel wrote: > > Hi Kent, > > On 14 October 2011 at 16:00, Jian Kang wrote: > | Hi, Dirk, > | > | Sorry for delay. > | > | I tried to install the R

[Rcpp-devel] as cube

2011-06-06 Thread Richard Chandler
Hi, I would like to do something like this: src.cube <- " arma::cube a = as(aR); return wrap(a); " fx <- cxxfunction(signature(aR="array"), src.cube, plugin="RcppArmadillo") fx(array(1:27, c(3,3,3))) But it fails. Can someone suggest a good alternative? I tried to create the cube on

Re: [Rcpp-devel] Summing over a numeric vector.

2011-01-03 Thread Richard Chandler
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

Re: [Rcpp-devel] speed fix

2010-12-27 Thread Richard Chandler
glas Bates > wrote: > > On Mon, Dec 27, 2010 at 6:57 AM, Richard Chandler > > wrote: > >> Hi, > >> > >> I am trying to speed up a vectorized R function without much luck. > Perhaps > >> it is not possible, but if it is could someone suggest

[Rcpp-devel] speed fix

2010-12-27 Thread Richard Chandler
Hi, I am trying to speed up a vectorized R function without much luck. Perhaps it is not possible, but if it is could someone suggest how to improve the C++/Rcpp code below? The speed is approximately equal on a 64-bit version of R, but the R code is much faster when using 32-bit R (on windows). H

Re: [Rcpp-devel] speed

2010-08-05 Thread Richard Chandler
- runif(3) isTRUE(all.equal( array(fx5(0:4, omega, gamma), c(5,5,3)), fxR5(0:4, omega, gamma))) # TRUE On Thu, Aug 5, 2010 at 9:55 AM, Richard Chandler wrote: > Thanks so much Romain, I like that sugar, and Rcpp has made my work > much easier. I have one more qu

Re: [Rcpp-devel] speed

2010-08-05 Thread Richard Chandler
Thanks so much Romain, I like that sugar, and Rcpp has made my work much easier. I have one more question if anyone is willing to entertain it. My end goal was to replace the binomial probability 0.5 with a vector (omega), and the poisson mean 1.5 with a vector (gamma). This would result in bpsum b

Re: [Rcpp-devel] speed

2010-08-04 Thread Richard Chandler
Doug and Dirk, thanks, those are extremely helpful suggestions. As for cmin, that was a mistake on my part. It should have been: cmin = seq_len(K[i]+1). I think I know why it worked both ways, but I need to investigate. Regarding the different results you got Dirk, I noticed that you declared lam

[Rcpp-devel] speed

2010-08-04 Thread Richard Chandler
Hi, I wrote my first Rcpp/C++ program in hopes of speeding up an R function, but alas it is slower. I think the C++ program is slower because I have made heavy use of dbinom and dpois from R. Is there a way to do this without calling back to R? Are there any other obvious ways to speed up the C++