Re: [Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread Dirk Eddelbuettel
Or rather this version without a typo: SEXP cppExceptExpr = PROTECT(Rf_lang3(cppExceptSym, Rf_mkString(exception_what.c_str()), Rf_mkString(exception_class.c_str(; Rf_eval(cppExceptE

Re: [Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread Dirk Eddelbuettel
Hi Ben, On 8 October 2012 at 15:15, Dirk Eddelbuettel wrote: | | On 8 October 2012 at 10:21, Douglas Bates wrote: | | On Mon, Oct 8, 2012 at 6:42 AM, Dirk Eddelbuettel wrote: | | > | | > Hi Ben, | | > | | > On 8 October 2012 at 10:24, North, Ben wrote: | | > | Hi, | | > | | | > | I've been usin

Re: [Rcpp-devel] How to use R function mvrnorm in c++?

2012-10-08 Thread Douglas Bates
On Mon, Oct 8, 2012 at 4:23 PM, Victor wrote: > Dear all, > > I want to use R function mvrnorm (package MASS) in my c++ scripts. Below is > the R code: > > library(MASS) > > x<-matrix(c(1.5,0,0,0,1.5,0,0,0,1.5),3,3) > > mvrnorm(1,c(15,33,26),x) > > > I will appreciate you very much if

[Rcpp-devel] How to use R function mvrnorm in c++?

2012-10-08 Thread Victor
Dear all, I want to use R function mvrnorm (package MASS) in my c++ scripts. Below is the R code: library(MASS) x<-matrix(c(1.5,0,0,0,1.5,0,0,0,1.5),3,3) mvrnorm(1,c(15,33,26),x) I will appreciate you very much if you give me some help and advice! Thank you so much! Victor ___

Re: [Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread Dirk Eddelbuettel
On 8 October 2012 at 10:21, Douglas Bates wrote: | On Mon, Oct 8, 2012 at 6:42 AM, Dirk Eddelbuettel wrote: | > | > Hi Ben, | > | > On 8 October 2012 at 10:24, North, Ben wrote: | > | Hi, | > | | > | I've been using Rcpp for a while now, and finding it very useful --- | > | thanks! | > | | > | Re

Re: [Rcpp-devel] Help needed for clang++ testing on OS X and Linux

2012-10-08 Thread Dirk Eddelbuettel
Hi Bob, On 8 October 2012 at 15:13, Bob Carpenter wrote: | On 10/6/12 2:14 PM, Dirk Eddelbuettel wrote: | > R CMD INSTALL Rcpp_0.9.14.2.tar.gz | | When I ran the above on Mac OS X "Mountain Lion", | it worked, but it used g++ (from latest Xcode, 4.5.1) | instead of clang++. | | I'd be happy to

Re: [Rcpp-devel] Help needed for clang++ testing on OS X and Linux

2012-10-08 Thread Bob Carpenter
On 10/6/12 2:14 PM, Dirk Eddelbuettel wrote: > R CMD INSTALL Rcpp_0.9.14.2.tar.gz When I ran the above on Mac OS X "Mountain Lion", it worked, but it used g++ (from latest Xcode, 4.5.1) instead of clang++. I'd be happy to test with clang++ 3.1, which is the default under Xcode now, if you tell m

Re: [Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread Douglas Bates
On Mon, Oct 8, 2012 at 6:42 AM, Dirk Eddelbuettel wrote: > > Hi Ben, > > On 8 October 2012 at 10:24, North, Ben wrote: > | Hi, > | > | I've been using Rcpp for a while now, and finding it very useful --- > | thanks! > | > | Recently, though, I came across strange behaviour when running under > | g

Re: [Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread Dirk Eddelbuettel
Hi Ben, On 8 October 2012 at 10:24, North, Ben wrote: | Hi, | | I've been using Rcpp for a while now, and finding it very useful --- | thanks! | | Recently, though, I came across strange behaviour when running under | gctorture(TRUE) and C++ exceptions were being forwarded to R. The error | me

[Rcpp-devel] Missing PROTECT()s in forward_exception_to_r()?

2012-10-08 Thread North, Ben
Hi, I've been using Rcpp for a while now, and finding it very useful --- thanks! Recently, though, I came across strange behaviour when running under gctorture(TRUE) and C++ exceptions were being forwarded to R. The error message string at the R level was some essentially random pathname, and th