[Rcpp-devel] [ANN] RcppArmadillo 0.4.300.0

Dirk Eddelbuettel edd at debian.org
Tue May 6 04:43:10 CEST 2014


Armadillo 4.300 came out a few days ago; I stuck this into a new branch of
the GitHub repo right away. 

But between testing for the now 65 RcppArmadillo Depends: and a request from
CRAN to improve my simple configure check for external LAPACK vs R-internal
LAPACK coupled with a test for R before/after 3.0.3 (related to the new-ish
divide-and-conquer SVD added last fall), it took two more days for it to
eventually hit CRAN. It is there now, including the Windows build.  

See eg my blog for a short announcement.

The nice thing is that Conrad responded to my suggestion to add element-wise
'finite' versus 'infinite' tests; these wrap into the elem() member function.

A quick example:

  R> cppFunction('arma::vec fnf(arma::vec x) { return(x.elem( find_nonfinite(x) )); }', depends="RcppArmadillo")
  R> cppFunction('arma::vec ff(arma::vec x) { return(x.elem( find_finite(x) )); }', depends="RcppArmadillo")
  R> fnf(c(1.0,NA,NaN,Inf,5.0))
       [,1]
  [1,]   NA
  [2,]  NaN
  [3,]  Inf
  R> ff(c(1.0,NA,NaN,Inf,5.0))
       [,1]
  [1,]    1
  [2,]    5
  R> 

This is actually exceedingly clever on all counts. R adds it peculiar NA type
(which is unbeknown to IEEE or the rest of the world) but as it does that as
an IEEE-NaN extension, the code which Conrad added and which tests for
standard IEEE-NaN also flags NA for us.

Very, very nice.  I am sure we'll get a lot of mileage out of this.

Thanks again to Conrad for Armadillo, and this newest feature addition.

Cheers, Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list