Rcpp 0.10.5
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
A new version of Rcpp is now
on the CRAN network for
GNU R;
binaries for Debian have been uploaded
as well.
Once more, this release brings a large number of exciting changes to
Rcpp. Some concern
usability, some bring new features, some increase performance; see
below for the detailed list. We have now released three updates on a
quarterly cycle; if we keep this up the next version ought to be ready at the
end of December.
As in the past, we tested the release rather rigorously by checking against all
packages I could (relatively easily) built on my server: this time it
successfully passed \code{R CMD check} for all 107 packages I can build
locally out of a total of 136 packages. (Two failed: one for an error in
\code{Makevars}, and one for the need of an X11 server during tests; this may
get addressed in the in test script next time). As all of these 107 packages
passed, we do not expect any issues with dependent packages. Should
there be issues we would appreciate a note, preferably with reproducible
code, to the
rcpp-devel
mailing list.
The complete NEWS
entry for 0.10.4 is below; more details are in the ChangeLog file in the package and on the
Rcpp Changelog page.
Changes in Rcpp version 0.10.5 (2013-09-28)
Changes in R code:
New R function
demangle
that calls theDEMANGLE
macro.New R function
sizeof
to query the byte size of a
type. This returns an object of S3 classbytes
that has aChanges in Rcpp API:
Add
defined(__sun)
to lists of operating systems to test for when checking for lack ofbacktrace()
needed for stack traces.
as
,as
,as
andas
are now supported, when T is a class exposed by modules, i.e. withRCPP_EXPOSED_CLASS
DoubleVector
as been added as an alias toNumericVector
New template function
is
to identify if an R object
can be seen as aT
. For exampleis
.(x)
This is a building block for more expressive dispatch in various places
(modules and attributes functions).
wrap
can now handle more types, i.e. types that iterate over
std::pair
where KEY can be converted to a
String
andVALUE
is either a primitive type (int, double)
or a type that wraps. Examples :
std::map
: we can make a String from an int, and double is primitive
boost::unordered_map
: we can make>
a String from a double andstd::vector
can wrap itselfOther examples of this are included at the end of the
wrap
unit test
file (runit.wrap.R
andwrap.cpp
).
wrap
now handles containers of classes handled by modules. e.g. if you expose a classFoo
via modules, then you can wrap
vector
, … An example is included in thewrap
unit test file.
RcppLdFlags()
, often used inMakevars
files of
packages using Rcpp, is now exported from the package namespace.Changes in Attributes:
Objects exported by a module (i.e. by a
RCPP_MODULE
call
in a file that is processed bysourceCpp
) are now directly
available in the environment. We used to make the module object
available, which was less useful.A plugin for
openmp
has been added to support use of OpenMP.
Rcpp::export
now takes advantage of the more flexible
as<>
, handling constness and referenceness of the input types.
For users, it means that for the parameters of function exported by modules,
we can now use references, pointers and const versions of them.
The fileModule.cpp
file has an example.No longer call non-exported functions from the tools package
No longer search the inline package as a fallback when loading plugins for the the
Rcpp::plugins
attribute.Changes in Modules:
We can now expose functions and methods that take
T&
orconst T&
as arguments. In these situations
objects are no longer copied as they used to be.Changes in sugar:
is_na
supports classesDatetimeVector
andDateVector
Changes in Rcpp documentation:
The vignettes have been moved from
inst/doc/
to thevignettes
directory which is now preferred.The appearance of the vignettes has been refreshed by switching to the Bistream Charter font, and microtype package.
Deprecation of
RCPP_FUNCTION_*
:
The macros from the
preprocessor_generated.h
file
have been deprecated. They are still available, but they print a message in addition to their expected behavior.The macros will be permanently removed in the first Rcpp release after July 2014.
Users of these macros should start replacing them with more up-to-date code, such as using ‘Rcpp attributes’ or ‘Rcpp modules’.
Thanks to
CRANberries, you can also look at a
diff to the previous release 0.10.4.
As always, even fuller details are on the
Rcpp Changelog page and the
Rcpp page which also
leads to the downloads, the
browseable doxygen docs
and zip files of doxygen output for the standard formats.
A local directory has source and documentation too.
Questions, comments etc should go to the
rcpp-devel mailing list
off the R-Forge page
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.