Sun, 31 Jan 2010

Rcpp 0.7.4

Yesterday, and about nine days after release 0.7.3 of Rcpp (a set of R / C++ interface classes), Romain and I released version 0.7.4. It has been uploaded to CRAN and Debian, and mirrors should already have new versions. As before, my local page is also available for downloads and some more details.

The release once again combines a number of necessary fixes with numerous new features:

  • Building on OS X did not support multi-arch, and we are grateful for Simon who once again came to the rescue. Things should be fine now. The big take-away is that under no circumstances, include either a file configure or src/Makefile if you want multi-arch builds for free. As Rcpp is effectively a library to be used by other packages, this mattered.
  • We added a file NEWS from which I include the relevant section below.
  • Much more code re-organisation and enhancement making passage of various C++ types even easier -- see the NEWS entry below.
  • More unit tests, now including ones for the 'old Rcpp API'.
Post-release, I also reworked the doxygen setup slightly so that all examples are now browseable, and the whole documentation is now searchable as well.

Lastly, we had a remaining Windows build issue. Also, Brian Ripley and Uwe Ligges kindly sent us a small patch supporting the new Windows 64-bit builds using the new MinGW 64-bit compiler for Windows -- so release 0.7.5 may follow in due course.

The NEWS file entry for release 0.7.4 is as follows:

0.7.4	2010-01-30

    o	matrix matrix-like indexing using operator() for all vector 
    	types : IntegerVector, NumericVector, RawVector, CharacterVector
    	LogicalVector, GenericVector and ExpressionVector. 

    o	new class Rcpp::Dimension to support creation of vectors with 
    	dimensions. All vector classes gain a constructor taking a 
    	Dimension reference.

    o	an intermediate template class "SimpleVector" has been added. All
    	simple vector classes are now generated from the SimpleVector 
    	template : IntegerVector, NumericVector, RawVector, CharacterVector
    	LogicalVector.

    o	an intermediate template class "SEXP_Vector" has been added to 
    	generate GenericVector and ExpressionVector.

    o	the clone template function was introduced to explicitely
    	clone an RObject by duplicating the SEXP it encapsulates.

    o	even smarter wrap programming using traits and template
        meta-programming using a private header to be include only
        RcppCommon.h

    o 	the as template is now smarter. The template now attempts to 
    	build an object of the requested template parameter T by using the
    	constructor for the type taking a SEXP. This allows third party code
    	to create a class Foo with a constructor Foo(SEXP) to have 
    	as for free.

    o	wrap becomes a template. For an object of type T, wrap uses
    	implicit conversion to SEXP to first convert the object to a SEXP
    	and then uses the wrap(SEXP) function. This allows third party 
    	code creating a class Bar with an operator SEXP() to have 
    	wrap for free.

    o	all specializations of wrap :  wrap, wrap< vector >
    	use coercion to deal with missing values (NA) appropriately.

    o	configure has been withdrawn. C++0x features can now be activated
    	by setting the RCPP_CXX0X environment variable to "yes".

    o	new template r_cast to facilitate conversion of one SEXP
    	type to another. This is mostly intended for internal use and 
    	is used on all vector classes

    o	Environment now takes advantage of the augmented smartness
    	of as and wrap templates. If as makes sense, one can 
    	directly extract a Foo from the environment. If wrap makes
    	sense then one can insert a Bar directly into the environment. 
    	Foo foo = env["x"] ;  /* as is used */
	Bar bar ;
	env["y"] = bar ;      /* wrap is used */    	

    o	Environment::assign becomes a template and also uses wrap to 
    	create a suitable SEXP

    o	Many more unit tests for the new features; also added unit tests
        for older API

As always, even fuller details are in the ChangeLog on the Rcpp page which also leads to the downloads, the browseable doxygen docs and zip files of doxygen output for the standard formats. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page

/code/rcpp | permanent link