[Rcpp-commits] r2802 - pkg/Rcpp/inst/announce

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 19 17:44:10 CET 2010


Author: edd
Date: 2010-12-19 17:44:10 +0100 (Sun, 19 Dec 2010)
New Revision: 2802

Modified:
   pkg/Rcpp/inst/announce/ANNOUNCE-0.9.0.txt
Log:
more on the announcement message for 0.9.0


Modified: pkg/Rcpp/inst/announce/ANNOUNCE-0.9.0.txt
===================================================================
--- pkg/Rcpp/inst/announce/ANNOUNCE-0.9.0.txt	2010-12-18 23:03:50 UTC (rev 2801)
+++ pkg/Rcpp/inst/announce/ANNOUNCE-0.9.0.txt	2010-12-19 16:44:10 UTC (rev 2802)
@@ -1,10 +1,10 @@
 
 ===== Summary =====
 
-Version 0.9.0 of the Rcpp package is now on CRAN and its mirrors. 
-This release marks another step in the development of the package.
-A few key points are highlighted below.  More details are in the NEWS and
-ChangeLog files.
+Version 0.9.0 of the Rcpp package is now on CRAN and its mirrors.  This
+release marks another step in the development of the package, and a few key
+points are highlighted below.  More details are in the NEWS and ChangeLog
+files included in the package.
 
 
 ===== Overview =====
@@ -12,17 +12,17 @@
 Rcpp is an R package and associated C++ library that facilitates integration
 of C++ code in R packages.
 
-The package features a set of C++ classes (Rcpp::IntegerVector,
-Rcpp::Function, Rcpp::Environment, ...) that makes it easier to manipulate R
-objects of matching types (integer vectors, functions, environments, etc
-...).
+The package features a complete set of C++ classes (Rcpp::IntegerVector,
+Rcpp:NumericVector, Rcpp::Function, Rcpp::Environment, ...) that makes it
+easier to manipulate R objects of matching types (integer vectors, functions,
+environments, etc ...).
 
 Rcpp takes advantage of C++ language features such as the explicit
-constructor/destructor lifecycle of objects to manage garbage collection
-automatically and transparently. We believe this is a major improvement over
-use of PROTECT/UNPROTECT. When an Rcpp object is created, it protects the
+constructor / destructor lifecycle of objects to manage garbage collection
+automatically and transparently.  We believe this is a major improvement over
+use of PROTECT/UNPROTECT.  When an Rcpp object is created, it protects the
 underlying SEXP so that the garbage collector does not attempt to reclaim the
-memory. This protection is withdrawn when the object goes out of
+memory.  This protection is withdrawn when the object goes out of
 scope. Moreover, users generally do not need to manage memory directly (via
 calls to new / delete or malloc / free) as this is done by the Rcpp classes
 or the corresponding STL containers.
@@ -38,23 +38,24 @@
  - possibility of inline use permitting definition, compilation, linking and
    loading of C++ functions directly from R
 
- - extensive documentation now covering nine vignettes
+ - extensive documentation now covering eight vignettes
 
  - exception handling and error propagation back to R
 
  - extensive test suite using RUnit covering over 700 tests
 
- - comprehensive documentation in nine vignettes
-
  - extension packages RcppArmadillo and RcppGSL provide easy-to-use
    integration with the Armadillo (linear algebra) and GNU GSL librasries
 
  - increasing adoption among R users and package developers with now
    twenty packages from CRAN or BioConductor depending on Rcpp
 
-Two key features were added during the 0.8.* cycles and are described below.
+ - support for the legacy 'classic' Rcpp is now provided by the RcppClassic
+   package which is being released concurrently with Rcpp 0.9.0 
 
+Several key features were added during the 0.8.* cycles and are described below.
 
+
 ===== Rcpp sugar =====
 
 Rcpp now provides syntactic sugar: vectorised expressions at the C++ level
@@ -63,35 +64,88 @@
 single logical results, mathematical functions and d/p/q/r statistical
 functions). Examples comprises anything from ifelse() to pmin()/pmax() or 
 
+A really simply example is a function
+
+    SEXP foo( SEXP xx, SEXP yy){
+        NumericVector x(xx), y(yy) ;
+        return ifelse( x < y, x*x, -(y*y) ) ;
+    }
+
+which deploys the sugar 'ifelse' function modeled after the corresponding R
+function. Another simple example is
+
+    double square( double x){
+        return x*x ;
+    }
+
+    SEXP foo( SEXP xx ){
+        NumericVector x(xx) ;
+        return sapply( x, square ) ;
+    }
+
+where use the sugar function 'sapply' to sweep a simple C++ function which
+operates elementwise across the supplied vector.
+
 The Rcpp-sugar vignette describes sugar in more detail.
 
 
 ===== Rcpp modules =====
 
-Rcpp modules are inspired by Boost.Python and makes exposing C++ functions or
-classes to R even easier.  Rcpp modules are also described in more detail in
-their own vignette.
+Rcpp modules are inspired by Boost.Python and make exposing C++ functions or
+classes to R even easier.  A first illustration is provided by this simple
+C++ code snippet
 
+    const char* hello( const std::string& who ){
+        std::string result( "hello " ) ;
+        result += who ;
+        return result.c_str() ;
+    }
 
+    RCPP_MODULE(yada){
+        using namespace Rcpp ;
+        function( "hello", &hello ) ;
+    }
+
+which (after compiling and loading) we can access in R as
+
+    yada <- Module( "yada" )
+    yada$hello( "world" )
+
+In a similar way, C++ classes can be exposed very easily.
+
+Rcpp modules are also described in more detail in their own vignette.
+
+
+===== Reference Classes =====
+
+R release 2.12.0 introduced Reference Classes. These are formal S4 classes
+with the corresponding dispatch method, but passed by reference and easy to
+use. Reference Classes can also be exposed to R by using Rcpp modules.
+
+
 ===== Documentation =====
 
-The package contains a total of nine vignette the first of which provides a
+The package contains a total of eight vignettes the first of which provides a
 short and succinct introduction to the Rcpp package along with several
-motivating examples.  
+motivating examples.
 
 
 ===== Links =====
 
-Rcpp main page: http://dirk.eddelbuettel.com/code/rcpp.html
-R-forge project page: http://r-forge.r-project.org/projects/rcpp/
-Dirk's blog section about Rcpp: http://dirk.eddelbuettel.com/blog/code/rcpp/
-Romain's blog section about Rcpp: http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp
+Rcpp main page: 
+    http://dirk.eddelbuettel.com/code/rcpp.html
+R-forge project page: 
+    http://r-forge.r-project.org/projects/rcpp/
+Dirk's blog section about 
+    Rcpp: http://dirk.eddelbuettel.com/blog/code/rcpp/
+Romain's blog section about Rcpp: 
+    http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp
 
 
 ===== Support =====
 
 Questions about Rcpp should be directed to the Rcpp-devel mailing list
-https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
+    https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
 
 
 



More information about the Rcpp-commits mailing list