Re: [Rcpp-devel] Handling NAs in RcppMatrix

2010-02-06 Thread Leo Alekseyev
The behavior I'm seeing is a bit bizarre. The NaN conversion seems to fail for RcppMatrix and RcppVector, but not for NumericVector. The most interesting bit is this: if I run the test code on e.g. c(NA,1,2), RcppVector works (NA is printed as nan), whereas if I use c(NA,1:2), instead of nan it p

Re: [Rcpp-devel] Handling NAs in RcppMatrix

2010-02-06 Thread Dirk Eddelbuettel
On 6 February 2010 at 22:08, Leo Alekseyev wrote: | Thanks for the response. Your new unit test runs, but I still see the | problem (running 0.7.4 installed from CRAN). Consider this version of | the test -- the only difference is that it uses a 2x2 matrix and | checks for NAs: | | test.RcppMat

Re: [Rcpp-devel] Handling NAs in RcppMatrix

2010-02-06 Thread Leo Alekseyev
Thanks for the response. Your new unit test runs, but I still see the problem (running 0.7.4 installed from CRAN). Consider this version of the test -- the only difference is that it uses a 2x2 matrix and checks for NAs: test.RcppMatrix.double.na <- function() { src <- 'RcppMatrix m(x);

Re: [Rcpp-devel] Handling NAs in RcppMatrix

2010-02-06 Thread Dirk Eddelbuettel
Hi Leo, On 6 February 2010 at 17:56, Leo Alekseyev wrote: | Howdy folks, | I started playing around with Rcpp recently, and so far haven't been | able to figure out how to detect NAs in a matrix that I pass to the | C++ code. | My test code looks something like this: | RcppExport SEXP rcpp_test(S

[Rcpp-devel] Handling NAs in RcppMatrix

2010-02-06 Thread Leo Alekseyev
Howdy folks, I started playing around with Rcpp recently, and so far haven't been able to figure out how to detect NAs in a matrix that I pass to the C++ code. My test code looks something like this: RcppExport SEXP rcpp_test(SEXP N1, SEXP V1, SEXP M1, SEXP parms) { ... RcppMatrix m1(M1);//

Re: [Rcpp-devel] RObject.asFoo

2010-02-06 Thread Dirk Eddelbuettel
On 6 February 2010 at 15:26, Romain Francois wrote: | On 02/06/2010 03:22 PM, Dirk Eddelbuettel wrote: | > | > On 6 February 2010 at 15:08, Romain Francois wrote: | > | On 02/06/2010 02:58 PM, Dirk Eddelbuettel wrote: | > |> | > |> | > |> On 6 February 2010 at 14:28, Romain Francois wrote: | > |>

Re: [Rcpp-devel] RObject.asFoo

2010-02-06 Thread Romain Francois
On 02/06/2010 03:22 PM, Dirk Eddelbuettel wrote: > > On 6 February 2010 at 15:08, Romain Francois wrote: > | On 02/06/2010 02:58 PM, Dirk Eddelbuettel wrote: > |> > |> > |> On 6 February 2010 at 14:28, Romain Francois wrote: > |> | Hello, > |> | > |> | Now with as, we don't need anymore the Rcp

Re: [Rcpp-devel] RObject.asFoo

2010-02-06 Thread Dirk Eddelbuettel
On 6 February 2010 at 15:08, Romain Francois wrote: | On 02/06/2010 02:58 PM, Dirk Eddelbuettel wrote: | > | > | > On 6 February 2010 at 14:28, Romain Francois wrote: | > | Hello, | > | | > | Now with as, we don't need anymore the Rcpp::asFoo() methods. I'd | > | like to remove them from the api.

[Rcpp-devel] RObject.asFoo

2010-02-06 Thread Romain Francois
Hello, Now with as, we don't need anymore the Rcpp::asFoo() methods. I'd like to remove them from the api. Any objections ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/MPYc : RProtoBuf: protocol buffers for R |- h