Rcpp11 3.1.1
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
R 3.1.1 was released a few days ago, and as part of the policy we are trying to follow for Rcpp11 releases, here is Rcpp11 3.1.1. Sorry for the 12 days delay, but I was away in California, and Rcpp11 travelled with me, so I could not properly test the package. I have now tested the package extensively on these combinations:
OS X/clangat home.Ubuntu/gcc 4.6.3through travisWindows/gcc 4.6.3under duress
Here is the extract of the NEWS.md file for this release:
Rcpp11 3.1.1
sugar
sumnow supports complex sugar vector expressionssugar
meanimplements the double pass algorithm fornumericandcomplexcases (#134)more C++ support for Rcomplex:
Rcomplex& operator+=( Rcomplex&, const Rcomplex& )Rcomplex operator/( Rcomplex, double )Internal refactoring/simplification of all api classes. Api classes are now parameterized by a class for the storage policy instead of a template as before.
DotsandNamedDotshandle the border case when...is missing (#123)If the macro
RCPP_DO_BOUNDS_CHECKSis defined, vector classes will perform bounds checks. This is turned off by default because it kills performance. #141Arrayno longer generates spurious warnings. #154Added the concept of lazy vectors. A lazy vector is similar to a sugar expression, but it only knows how to apply itself, i.e. we cannot call
operator[](int)on it. This is used for implementation ofcreateandfusecreatecan now also be used as a free function. For example:IntegerVector x = create(1,2,3) ;. When used as a free function,createchooses to create a lazy vector of the highest type. For example,create(1,2.0)makes a lazy vector of typeREALSXP(what makes sense fordouble).Added the
listfunction. It takes a variadic list of arguments and makes an R list from it. This uses the same underlying implementation asList::createbut is nicer to use.mapplywas reimplemented using variadic templates.mapplynow accepts a function as first parameter, then a variable number of sugar expressions.Arraygains afillmethod to initialize all its data to the same value.is<>was broken.Initial implementation of
ListOf.ListOf<T>is similar toListbut it only exposes constructors that takeTobjects and methods that maintain this requirement. The implementation differs from Kevin Ushey’s implementation in Rcpp, which IMHO tries to do too much.New sugar functions
Filter,ReduceandMap(synonym ofmapply) #140.New function
Negate,Composefor intial attempt at functional programming and function composition #140.Support for long vector has been added. Vectors are now indexed by the
R_xlen_ttype (64 bit on 64 bit platforms).The header
<Rcpp11>has been added. It just includes<Rcpp.h>, but I like it better to have#include <Rcpp11>The
Rcpp11namespace has been added as an alias toRcpp. So that we can typeusing namespace Rcpp11 ;variadic trailing arguments can now be used in
sapply(#189)Logical vectors internally use the
Rbooleantype instead ofint.Added the syntax
x != NAto test if something is not the missing value.New sugar function
import_nso that we can doimport_n( iterator, n )instead ofimport( iterator, iterator + n) ;New sugar function
enumerate(#153).
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.