Dirk Eddelbuettel Thinking inside the box
 
Fri, 30 Dec 2011

RcppExamples 0.1.3
A minor new release of the RcppExamples package is now on CRAN. RcppExamples contains a few illustrations of how to use Rcpp. It grew out of documentation for the classic API (now in its own package RcppClassic), and while we added a few more functions documenting how to do the same with the new API, the package is still nowhere near completion.

The two ChangeLog entries since the last release are below. One new example was added, and some things were changed in order to make R CMD check (and the CRAN gate keepers) happy.

2011-12-28  Dirk Eddelbuettel  

        * DESCRIPTION: Release 0.1.3

        * src/newRcppDateExample.cpp: switch from std::cout to the new
        Rcpp::Rcout device available since Rcpp 0.9.8
        * src/classicRcppDateExample.cpp: idem

        * DESCRIPTION: Depends on Rcpp (>= 0.9.9) for Rcpp::Rcout

2011-04-08  Dirk Eddelbuettel  

        * R/RcppDataFrame.R: Added new example for Rcpp::DataFrame
        * src/RcppDataFrame.cpp: C++ source for new example
        * man/RcppDataFrame.Rd: Documentation

        * man/RcppParams.Rd: Small change to suppres a warning
Thanks to CRANberries, you can also look at a diff to the previous release 0.1.2. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page

/code/rcpp | permanent link

Tue, 27 Dec 2011

Rcpp 0.9.9
Release 0.9.9 of Rcpp is now on CRAN and getting into Debian too. This is mainly a bug fix release: our addition of int64 support in 0.9.8 came at the expense of support for long and unsigned long which broke some packages using Rcpp, and expecting those types. Ooops.

The complete NEWS entry for 0.9.9; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.9   2012-12-25

    o   Reverting the 'int64' changes from release 0.9.8 which adversely
        affect packages using Rcpp: We will re-apply the 'int64' changes in a 
        way which should cooperate more easily with 'long' and 'unsigned long'.

    o   Unit test output directory fallback changed to use Rcpp.Rcheck

    o   Conditioned two unit tests to not run on Windows where they now break
        whereas they passed before, and continue to pass on other OSs

Thanks to CRANberries, you can also look at a diff to the previous release 0.9.8. 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

/code/rcpp | permanent link

Thu, 22 Dec 2011

Rcpp 0.9.8
A new release 0.9.8 of Rcpp is now on CRAN and will also get into Debian shortly (once I finish building R 2.14.1).

This release contains a few incremental changes. Romain, sponsored by by the Open Source Programs Office at Google, had released a new package int64 bringing larger integers to R, and this is now supported by Rcpp as well. John Chambers contributed some code to have Reference Classes extend existing C++ classes (typically brought in via Rcpp Modules). Jelmer Ypma sent us a patch to add a Rcout device not unlike cout, but aligned with R's io buffering. We added some more unit tests, and made a few small fixes here or there.

The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.8   2011-12-21

    o   wrap now handles 64 bit integers (int64_t, uint64_t) and containers 
        of them, and Rcpp now depends on the int64 package (also on CRAN).
        This work has been sponsored by the Google Open Source Programs
        Office.

    o   Added setRcppClass() function to create extended reference classes 
        with an interface to a C++ class (typically via Rcpp Module) which
        can have R-based fields and methods in addition to those from the C++.

    o   Applied patch by Jelmer Ypma which adds an output stream class
        'Rcout' not unlike std::cout, but implemented via Rprintf to
        cooperate with R and its output buffering.
        
    o   New unit tests for pf(), pnf(), pchisq(), pnchisq() and pcauchy()

    o   XPtr constructor now checks for corresponding type in SEXP

    o   Updated vignettes for use with updated highlight package

    o   Update linking command for older fastLm() example using external 
        Armadillo

Thanks to CRANberries, you can also look at a diff to the previous release 0.9.7. 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

/code/rcpp | permanent link

Tue, 13 Dec 2011

RcppArmadillo 0.2.34
And another quick bugfix release by Conrad Sanderson made it version 2.4.2 bug of Armadillo. And this is in RcppArmadillo release 0.2.34 which got to CRAN this morning The NEWS entry below summarises the changes.

0.2.34	2011-12-12

    o   Upgraded to Armadillo release 2.4.2

          * clarified documentation for .reshape()
          * fix for handling of empty matrices by .resize()

Courtesy of CRANberries, there is also a diffstat reports for 0.2.34 relative to 0.2.33 As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Thu, 08 Dec 2011

Rcpp talk at Seattle RUG
Thanks to Zach and the Seattle R User Group for the invitation. Earlier this evening I gave a talk about R, C++ and our Rcpp package, focussing on the why, how, what, who, and "one more thing" higher-level aspects of extending R. This was supposed to be an hour long, and with the examples at the end went a little over, butat least nobody started to snore.

The slides are now up at the top of my presentations page.

/code/rcpp | permanent link

Wed, 07 Dec 2011

RcppArmadillo 0.2.33
Conrad Sanderson made a first 2.4.1 bug fix release of Armadillo. We now have RcppArmadillo release 0.2.33 on CRAN which contains it. earlier today. The NEWS entry below summarises the changes.

0.2.33  2011-12-07

    o   Upgraded to Armadillo release 2.4.1

          * added .resize()
          * fix for vector initialisation

Courtesy of CRANberries, there is also a diffstat reports for 0.2.33 relative to 0.2.32 As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Mon, 05 Dec 2011

RcppArmadillo 0.2.32
Conrad Sanderson made the official 2.4.0 release of Armadillo last evening. This was wrapped into RcppArmadillo release 0.2.32 which arrived on CRAN earlier today.

The NEWS entries summarising the changes since the 2.2.* series, we already saw most of this with the two prerelease 0.2.30 and 0.2.31:

0.2.32  2011-12-04

    o   Upgraded to Armadillo test release 2.4.0 "Loco Lounge Lizard"

    o   Minimal changes relative to 0.2.31 based on 2.3.92, next section is
        relative to the previous stable release series 2.2.* of Armadillo

          * added shorter forms of transposes: .t() and .st()
          * added optional use of 64 bit indices, allowing matrices to have
            more than 4 billion elements 
          * added experimental support for C++11 initialiser lists
          * faster pinv()
          * faster inplace transpose
          * faster handling of expressions with diagonal views
          * fixes for handling expressions with aliasing and submatrices
          * fixes for linking on Ubuntu and Debian systems
          * fixes for inconsistencies in interactions between matrices and
            cubes 
          * refactored code to eliminate warnings when using the Clang C++
            compiler 
          * .print_trans() and .raw_print_trans() are deprecated

Courtesy of CRANberries, there is also a diffstat reports for 0.2.32 relative to 0.2.31 As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Tue, 29 Nov 2011

RcppArmadillo 0.2.31
Conrad Sanderson just released the second pre-release 2.3.92 of what will be Armadillo 2.4.*. This is now in RcppArmadillo release 0.2.31 which is already on CRAN as of this morning.

The NEWS entries summarising the changes for both are below:

0.2.31  2011-11-28

    o   Upgraded to Armadillo test release 2.3.92 "Loco Lounge Lizard (Beta 2)"

          * fixes for linking on Ubuntu and Debian systems
          * fixes for inconsistencies in interactions between matrices and
            cubes

Courtesy of CRANberries, there is also a diffstat reports for 0.2.31 relative to 0.2.30 As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Sun, 20 Nov 2011

RcppArmadillo 0.2.30 (and 0.2.29)
A few days ago, Conrad Sanderson released the first pre-release version of what will be Armadillo 2.4.*, giving it the 2.3.91 release handle. We folded this into RcppArmadillo release 0.2.30, with Romain making a few adjustments to our template structure to accomodate Conrad's underlying changes in Armadillo itself.

Armadillo is a wonderfully expressive (thanks to clever modern template programming), powerful yet simple-to-use C++ library for linear algebra, making expressions in C++ as easy as writing in Matlab or R. By deploying our seamless Rcpp glue between R and C++, RcppArmadillo brings this nice C++ library to R users. The CRAN page for RcppArmadillo now lists ten packages using the RcppArmadillo package.

There was also an earlier bug-fix release 0.2.29 which I had not blogged about separately. The NEWS entries summarising the changes for both are below:

0.2.30  2011-11-19

    o   Upgraded to Armadillo test release 2.3.91 "Loco Lounge Lizard (Beta 1)"

          * added shorter forms of transposes: .t() and .st()
          * added optional use of 64 bit indices, allowing matrices to have
            more than 4 billion elements
          * added experimental support for C++11 initialiser lists
          * faster pinv()
          * faster inplace transpose
          * bugfixes for handling expressions with aliasing and submatrices
          * refactored code to eliminate warnings when using the Clang C++
            compiler
          * .print_trans() and .raw_print_trans() are deprecated 

0.2.29  2011-09-01

    o   Upgraded to Armadillo release 2.2.3

          * Release fixes a speed issue in the as_scalar() function.

Courtesy of CRANberries, there are also diffstat reports for 0.2.30 relative to 0.2.29 and for 0.2.29 relative to 0.2.28. As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Sun, 06 Nov 2011

Rcpp talk at Seattle RUG next month
The Seattle R User Group was kind enough to invite me to give a talk about R, C++ and Rcpp.

So if you can make it to the Thomas building of the Fred Hutchinson Cancer Research Center in Seattle, WA, on December 7, I would love to see you there. I have some ideas about freshening up the presentation(s) based on material Romain and I have used in the past. This should make the why as well as how a little clearer; now I just have to find some to put this together. And if there are particular aspects you would like to see covered, please do get in touch with me.

/code/rcpp | permanent link

Sat, 01 Oct 2011

Reminder: One week til Rcpp class in San Francisco
Just a quick note to remind everyone that the Rcpp class in San Francisco, which I am holding together with Revolution Analytics, will take place a week from today.

We are happy to report that the number of registrations has met our initial targets. But as a number of open slots remain, we have decided to offer a few places at discounts of 25% for academics (with code acad1) and 50% for students (with code student). Course details are at the Revolution course page, registration is at the Eventbrite page.

And just for completeness, here is what I wrote in the previous announcement:

The format will follow the workshop Romain and I gave during the tutorial day preceding this year's R/Finance conference. The style will once again be hands-on, with copious concrete examples and solid coverage of most aspects of Rcpp and related packages such as RInside, RcppArmadillo and others. The eight-hour schedule contains about six hours of instruction, split into four sessions of around ninety minutes. This leaves ample time for both lunch and coffee breaks, and for informal discussions and Q+A.

The one-day class will be offered in San Franciso on Saturday, October 8, 2011. Please see the official course page for more details, concrete location info and maps as well as registration details.

Feel free to contact me at the usual email address with questions. Or with suggestions for the after-party in San Francisco :)

/code/rcpp | permanent link

Fri, 30 Sep 2011

Rcpp 0.9.7
A fresh maintenance release version 0.9.7 of Rcpp went onto CRAN and into Debian earlier today.

This release contains two contributed fixes. The first, suggested by Darren Cook via the rcpp-devel mailing list, corrects how we had set up exceptions specifications, reflecting a bit of Java-think on our part. The idiom is generally discouraged in C++, and we now conform. The second came in two excellent patches by R Core member Martyn Plummer which finally get us compilation on Solaris. This is much appreciated as our hands were tied here for lack of access to such a box.

Otherwise, two new examples and a new unit test were added. The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.7   2011-09-29

    o   Applied two patches kindly provided by Martyn Plummer which provide
        support for compilation on Solaris using the SunPro compiler

    o   Minor code reorganisation in which exception specifiers are removed;
        this effectively only implements a run-time (rather than compile-time) 
        check and is generally seen as a somewhat depreated C++ idiom. Thanks
        to Darren Cook for alerting us to this issue.

    o   New example 'OpenMPandInline.r' in the OpenMP/ directory, showing how
        easily use OpenMP by modifying the RcppPlugin output

    o   New example 'ifelseLooped.r' showing Rcpp can accelerate loops that may
        be difficult to vectorise due to dependencies

    o   New example directory examples/Misc/ regrouping the new example as
        well as the fibonacci example added in Rcpp 0.9.6

    o   New Rcpp-FAQ example warning of lossy conversion from 64-bit long
        integer types into a 53-bit mantissa which has no clear fix yet.

    o   New unit test for accessing a non-exported function from a namespace

Thanks to CRANberries, you can also look at a diff to the previous release 0.9.6. 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

/code/rcpp | permanent link

Thu, 08 Sep 2011

Faster (recursive) function calls: Another quick Rcpp case study
There was another question recently on StackOverflow that I had meant to discuss in a follow-up post here. User deltanovember asked about slow recursive functions and used the very classic Fibonacci number as an example. To recap, Fibonacci number are defined with two initial values F(0) = 0 and F(1) = 1; thereafter the Fibonacci number F(n) is defined as the sum of the two preceding numbers: F(n) = F(n-2) + F(n-1).

This leads to very straightforward implementations using recursion:

## R implementation of recursive Fibonacci sequence
fibR <- function(n) {
    if (n == 0) return(0)
    if (n == 1) return(1)
    return (fibR(n - 1) + fibR(n - 2))
}

Unfortunately, this elegant implementation which remain close to the abtract formulation of the recurrence algorithm performs very poorly in R as there is noticeable overhead in function calls which becomes dominant in a recursion. This lead to the original question on StackOverflow, and the accepted answer uses a trick presented by Pat Burns in his lovely R Inferno: rewrite the solution using a computer science trick called memoization:

fibonacci <- local({
    memo <- c(1, 1, rep(NA, 100))
    f <- function(x) {
        if(x == 0) return(0)
        if(x < 0) return(NA)
        if(x > length(memo))
        stop("'x' too big for implementation")
        if(!is.na(memo[x])) return(memo[x])
        ans <- f(x-2) + f(x-1)
        memo[x] <<- ans
        ans
    }
})

That is a fair answer, and even more was suggested with a link to a terrific analysis calling the Fibonacci recurrence the worst algorithm in the world. That is also fair, but all the basic research into better algorithms exploiting some structure of the problem to advance performance (and of course understanding) is overlooking one crucial part: algorithm analysis is essentially independent of the language. So whatever improvements we obtain by thinking really hard about a problem are then available for other implementations too.

So with a tip of the hat to the old Larry Wall quote about Lazyness, Impatience and Hubris, I would like to suggest what I consider a much simpler route to much better performance: recode it in C++ using both Rcpp (for the R/C++ integration) and inline for the on-the-fly compilation, linking and loading of C++ code into R.

## inline to compile, load and link the C++ code
require(inline)

## we need a pure C/C++ function as the generated function
## will have a random identifier at the C++ level preventing
## us from direct recursive calls
incltxt <- '
  int fibonacci(const int x) {
     if (x == 0) return(0);
     if (x == 1) return(1);
     return (fibonacci(x - 1)) + fibonacci(x - 2);
  }'

## now use the snippet above as well as one argument conversion
## in as well as out to provide Fibonacci numbers via C++
fibRcpp <- cxxfunction(signature(xs="int"),
                       plugin="Rcpp",
                       incl=incltxt,
                       body
                       ='
   int x = Rcpp::as<int>(xs);
   return Rcpp::wrap( fibonacci(x) );
')

This single R function call cxxfunction() takes the code embedded in the arguments to the body variable (for the core function) and the incltxt variable for the helper function we need to call. This helper function is needed for the recursion as cxxfunction() will use an randomized internal identifier for the function called from R preventing us from calling this (unknown) indentifier. But the rest of the algorithm is simple, and as beautiful as the initial recurrence. Three lines, three statements, and three cases for F(0), F(1) and the general case F(n) solved by recursive calls. This also illustrates how easy it is to get an integer from R to C++ and back: the as and wrap simply do the right thing converting to and from the SEXP types used internally by the C API of R.

A performance comparison of the basic R version fibR, its byte-compiled variant fibRC and and the C++ version fibRcpp shown above is very compelling. We have added a file fibonacci.r to the large and still growing set of examples included with Rcpp, and we can just execute that script with Rscript or (as here) r from the littler package:

edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/Misc$ r fibonacci.r
Loading required package: inline
Loading required package: methods
Loading required package: compiler
        test replications elapsed relative user.self sys.self
3 fibRcpp(N)            1   0.092   1.0000      0.09     0.00
2   fibRC(N)            1  61.480 668.2609     61.47     0.00
1    fibR(N)            1  61.877 672.5761     61.83     0.02
edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/Misc$ 
So the recursion for the original argument of N=35 takes just over a minute at about 61.5 and 61.9 seconds, respectively, for the R version and its byte-compiled variant (as per the column titled elapsed). So byte-compilation essentially offers no help for the bottleneck of slow function calls.

The C++ versions relying on Rcpp which created in a few lines of code and a single call to cxxfunction however takes just 92 milliseconds---or a relative gain of well over six-hundred times.

That provides another nice demonstration of what Rcpp can do. Improved algorithms for well-understood problems are surely one way to accelerate solutions. But there are (many ?) times when we do not have the luxury of being able to think through to a new and improved approach. Or worse, such an approach may even introduce new errors or inaccurracies if we get it wrong on a first try. With Rcpp, we are able to the express the problem as written in its original statement: a simple recursion. The gain relative to a slow R implementation is noteworthy---and could of course be improved further if we really needed to by relying on better algorithms like memoization. But for day to day tasks, I gladly take speedups of (up to) a few hundred times thanks to Rcpp without having to do hard algorithmic work.

Before closing, a quick reminder that I will be giving two classes on Rcpp in a few weeks. These will be in New York on September 24, and San Franciso on October 8, see this blog post as well as this page at Revolution Analytics (who are a co-organiser of the classes) for details and registration information.

/code/rcpp | permanent link

Tue, 23 Aug 2011

Accelerating path-dependent loops: A quick Rcpp case study
User BobH asked on StackOverflow about accelerating path-dependent loops. He provided a simple example in which a vector gets filled conditional on the value of the preceding element. Simple to code, but hard to vectorise.

By the time I saw that question yesterday evening, Josh Ulrich had already posted a nice answer suggesting to switch from ifelse to if to escape the overhead of a vectorised expression on simple scalars. I meekly added a comment suggesting that Rcpp would likely do well on this and that someone should volunteer such an answer. Well, it is still August and Mr. Someone is on holiday, so this morning I followed up with such an answer. And as it turns out to work quite well indeed, we will repost it here.

Let's start with the general setup, and the two functions supplied by Josh. We also byte-compile these using the compiler package which is the culmination of several years of work by R core member Luke Tierney. This package was added to R during the last major release, and we assessed it in this earlier blog post as well as several Rcpp-related follow-ups. We also load the packages for on-the-fly 'inline' compilation and easy benchmarking:

library(inline)
library(rbenchmark)
library(compiler)

fun1 <- function(z) {
  for(i in 2:NROW(z)) {
    z[i] <- ifelse(z[i-1]==1, 1, 0)
  }
  z
}
fun1c <- cmpfun(fun1)


fun2 <- function(z) {
  for(i in 2:NROW(z)) {
    z[i] <- if(z[i-1]==1) 1 else 0
  }
  z
}
fun2c <- cmpfun(fun2)

We see that basic worker just assign to the i-th element based on the preceding element. Function two uses the aforementioned if statement, and both are also byte-compiled.

Writing the same code in C++ using both Rcpp (for the R/C++ integration) and inline for the on-the-fly compilation, linking and loading of C++ code into R is pretty straightforward too:

funRcpp <- cxxfunction(signature(zs="numeric"), plugin="Rcpp", body="
  Rcpp::NumericVector z = Rcpp::NumericVector(zs);
  int n = z.size();
  for (int i=1; i<n; i++) {
    z[i] = (z[i-1]==1.0 ? 1.0 : 0.0);
  }
  return(z);
")

This single R function call takes the code embedded in the argument to the body variable, builds a complete function in temporary file, and then compiles, links and loads it. We can now call funRcpp() just like the other four functions and do so via the benchmark() function of the rbenchmark package.

R> z <- rep(c(1,1,0,0,0,0), 100)
R> identical(fun1(z),fun2(z),fun1c(z),fun2c(z),funRcpp(z))
[1] TRUE
R> 
R> res <- benchmark(fun1(z), fun2(z),
+                  fun1c(z), fun2c(z),
+                  funRcpp(z),
+                  columns=c("test", "replications", "elapsed", "relative", "user.self", "sys.self"),
+                  order="relative",
+                  replications=1000)
R> print(res)
        test replications elapsed relative user.self sys.self
5 funRcpp(z)         1000   0.005      1.0      0.01        0
4   fun2c(z)         1000   0.482     96.4      0.48        0
2    fun2(z)         1000   1.989    397.8      1.98        0
3   fun1c(z)         1000  11.365   2273.0     11.37        0
1    fun1(z)         1000  13.210   2642.0     13.21        0

We can focus on the columns labelled elapsed and relative. The C++ version is faster by a factor of almost one-hundred compared to the byte-compiled version of funtion2, and almost four-hundred times faster than the plain-R variant of function2. And function1 is even worse, coming at well over twenty-two-hundred times the run-time of the C++ version. Byte-compilation also helps little here.

For comparison, we also ran the original example of a very short vector, called more frequently:

R> z <- c(1,1,0,0,0,0)
R> res2 <- benchmark(fun1(z), fun2(z),
+                  fun1c(z), fun2c(z),
+                  funRcpp(z),
+                  columns=c("test", "replications", "elapsed", "relative", "user.self", "sys.self"),
+                  order="relative",
+                  replications=10000)
R> print(res2)
        test replications elapsed relative user.self sys.self
5 funRcpp(z)        10000   0.047  1.00000      0.04        0
4   fun2c(z)        10000   0.134  2.85106      0.13        0
2    fun2(z)        10000   0.328  6.97872      0.32        0
3   fun1c(z)        10000   1.080 22.97872      1.08        0
1    fun1(z)        10000   1.243 26.44681      1.24        0
The qualitative ranking is unchanged: the Rcpp version dominates. Function2 using if instead of the vectorised ifelse is second-best with the byte-compiled version being about twice as fast that the plain R variant, but still almost three times slower than the C++ version. And the relative differences are less pronounced: relatively speaking, the function call overhead matters less here and the actual looping matters more: C++ gets a bigger advantage on the actual loop operations in the longer vectors. That it is an important result as it suggests that on more real-life sized data, the compiled version may reap a larger benefit.

All in all a nice demonstration of Rcpp, and a gain of almost one-hundred to the best byte-compiled version is nothing to sneeze at---especially when it is so easy to write and load a five-line C++ function thanks to Rcpp.

Before closing, a quick reminder that I will giving two classes on Rcpp in a few weeks. These will be in New York on September 24, and San Franciso on October 8, see this blog post as well as this page at Revolution Analytics (who are a co-organiser of the classes) for details and registration information.

/code/rcpp | permanent link

Thu, 04 Aug 2011

New Rcpp master classes scheduled for New York and San Francisco
Together with Revolution Analytics, I will be offering two more one-day classes on the Rcpp package for seamless integration of R and C++.

The format will follow the workshop Romain and I gave during the tutorial day preceding this year's R/Finance conference. The style will once again be hands-on, with copious concrete examples and solid coverage of most aspects of Rcpp and related packages such as RInside, RcppArmadillo and others. The eight-hour schedule contains about six hours of instruction, split into four sessions of around ninety minutes. This leaves ample time for both lunch and coffee breaks, and for informal discussions and Q+A.

Two one-day classes will be offered: The first in New York on Saturday, September 28, 2011 and the second one two weeks later in San Franciso on Saturday, October 8, 2011. Please see the official course page for more details, concrete location info and maps as well as registration details.

Feel free to contact me at the usual email address with questions.

/code/rcpp | permanent link

Tue, 02 Aug 2011

RcppArmadillo 0.2.28
Armadillo 2.2.1 came out today (and it looks like 2.2.0 was skipped, tst, tst). It has now been wrapped into release 0.2.28 of RcppArmadillo which is already on CRAN.

The NEWS entry is below; a number of these changes were already in the preceding 0.2.27 release of RcppArmadillo which was base on the beta for Armadillo 2.2.0.

0.2.28  2011-08-02

    o   Upgraded to Armadillo release 2.2.1 "Blue Skies Debauchery"

          * faster multiplication of small matrices
          * faster trans()
          * faster handling of submatrices by norm()
          * added economical singular value decomposition: svd_thin()
          * added circ_toeplitz()
          * added .is_colvec() & .is_rowvec()
          * fixes for handling of complex numbers by cov(), cor(),
            running_stat_vec

CRANberries provides a diffstat report for 0.2.28 relative to 0.2.27. As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Wed, 27 Jul 2011

Rcpp 0.9.6
A new maintenance release version 0.9.6 of Rcpp went onto CRAN and into Debian earlier today.

This release contains a fix which helps the RppEigen package (mentioned previously on this blog), as well as an addition which permits user-defined finalizers for external pointer objects (following a suggestion on the mailing list). Two new examples where added: a Gibbs sampler illustration (blogged about as well) and a Rcpp-based Fibonacci implementation following a question on StackOverflow. And while that last example is clearly degenerate, the 700+ fold net speedup (as shown in my answer) is still pretty neat.

The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.6   2011-07-26

    o   Added helper traits to facilitate implementation of the RcppEigen
        package: The is_eigen_base traits identifies if a class derives from
        EigenBase using SFINAE; and new dispatch layer was added to wrap() to
        help RcppEigen

    o   XPtr now accepts a second template parameter, which is a function
        taking a pointer to the target class. This allows the developper to
        supply his/her own finalizer. The template parameter has a default
        value which retains the original behaviour (calling delete on the
        pointer)

    o   New example RcppGibbs, extending Sanjog Misra's Rcpp illustration of
        Darren Wilkinson's comparison of MCMC Gibbs Sampler implementations;
        also added short timing on Normal and Gaussian RNG draws between Rcpp
        and GSL as R's rgamma() is seen to significantly slower

    o   New example on recursively computing a Fibonacci number using Rcpp and
        comparing this to R and byte-compiled R for a significant speed gain

Thanks to CRANberries, you can also look at a diff to the previous release 0.9.5. 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

/code/rcpp | permanent link

Sat, 23 Jul 2011

RcppArmadillo 0.2.26 and 0.2.27
Earlier this week, Conrad Sanderson issued a minor bug fix release 2.0.2 of his Armadillo library which provides templated C++ code for linear algebra. We wrapped that into a new RcppArmadillo release 0.2.26 and shipped it to CRAN. Due to it being summer and the otherwise tirelesss human operator behind the curtain being on a well-deserved vacation, it sat in the incoming queue til this morning---but is now on CRAN.

Conrad did not rest either and just yesterday released version 2.1.91 as a first step towards a new 2.2.0 release sometime soon. And also yesterday, we wrapped that new version into RcppArmadillo release 0.2.27. With CRAN being back in full swing, we pushed it over there this morning and it already made its way into the repository.

The NEWS entries summarising the changes---which are exclusively upstream---are below:

0.2.27  2011-07-22

    o   Upgraded to Armadillo release 2.1.91 "v2.2 beta 1"

          * faster multiplication of small matrices
          * faster trans()
          * faster handling of submatrices by norm()
          * added economical singular value decomposition: svd_thin()
          * added circ_toeplitz()
          * added .is_colvec() & .is_rowvec()

0.2.26  2011-07-17

    o   Upgraded to Armadillo release 2.0.2 

          * fix for handling of conjugate transpose by as_scalar()
          * fix for handling of aliasing by diagmat()
          * fix for handling of empty matrices by symmatu()/symmatl()

Courtesy of CRANberries, there are also diffstat reports for 0.2.27 relative to 0.2.26 and for 0.2.26 relative to 0.2.25. As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Thu, 14 Jul 2011

MCMC and faster Gibbs Sampling using Rcpp
Sanjog Misra, who uses Rcpp for Monte Carlo Markov Chain (MCMC) analyses in quantitative marketing, kindly set me a short example of Rcpp use.

The example is based on a blog post by Darren Wilkinson which itself discusses and compares the suitability of R, Python, Java or C for MCMC analysis, using the Gibbs sampler as a concrete example. Darren's post is worth checking out: he stresses the rather pragmatic aspects of how fast and/or easy it is to write the code, rather than just the mere runtime. As such, he is not too concerned with a speed advantage of Python over R which he sees at a factor of around 2.4, leaving him to continue to prototype in R. Similarly, with C 'only' being faster than Java by a factor of two, he prefers Java for the numerically more demanding parts.

We do of course advocate the use of Rcpp to combine the best aspects of R and C++, respectively. This Gibbs sampler example provides a nice backdrop. So working with Darren's example, consider the same Gibbs sampler for a bivariate distribution (and apologies for the lack of latex typesetting on my blog)

f(x,y) = k x^2 exp( -x y^2 - y^2 + 2y - 4x)
where the conditional distributions are
f(x|y) = (x^2)*exp(-x*(4+y*y))               ## a Gamma density kernel
f(y|x) = exp(-0.5*2*(x+1)*(y^2 - 2*y/(x+1))  ## a Gaussian kernel
Sanjog then spotted and corrected a small error in the variance expression in Darren's derivation; this is now acknowledged on Darren's website. Full details are in the R script now committed in SVN. The R code for the Gibbs sample can therefore be written as follows below. Note that this uses thinning to minimize serial correlation in the conditional densities--which renders the computation more demanding as 'N times thin' draws have to be generated:
## Here is the actual Gibbs Sampler
## This is Darren Wilkinsons R code (with the corrected variance)
## But we are returning only his columns 2 and 3 as the 1:N sequence
## is never used below
Rgibbs <- function(N,thin) {
    mat <- matrix(0,ncol=2,nrow=N)
    x <- 0
    y <- 0
    for (i in 1:N) {
        for (j in 1:thin) {
            x <- rgamma(1,3,y*y+4)
            y <- rnorm(1,1/(x+1),1/sqrt(2*(x+1)))
        }
        mat[i,] <- c(x,y)
    }
    mat
}
A second variant can be computed using the R bytecode compiler which appeared with the recent release of R 2.13.0 (and which we analysed in this blog post from April). This is as easy as
## We can also try the R compiler on this R function
RCgibbs <- cmpfun(Rgibbs)
Thanks to Rcpp and the inline package, we can also write a C++ variant that can be built and launched from R with ease. The C++ code is assigned to an R text variable gibbscode. (And we used to typeset such code on the blog as a character string, ie in a faint red color---but have now switched to highlight it as if it were freestanding C++ code. It really is passed as a single string to R which then uses the cxxfunction() to compile, link and load a C++ function built around the code. See previous posts on the inline package for more.)
## Now for the Rcpp version -- Notice how easy it is to code up!
gibbscode <- '

  using namespace Rcpp;   // inline does that for us already

  // n and thin are SEXPs which the Rcpp::as function maps to C++ vars
  int N   = as<int>(n);
  int thn = as<int>(thin);

  int i,j;
  NumericMatrix mat(N, 2);

  RNGScope scope;         // Initialize Random number generator

  // The rest of the code follows the R version
  double x=0, y=0;

  for (i=0; i<N; i++) {
    for (j=0; j<thn; j++) {
      x = ::Rf_rgamma(3.0,1.0/(y*y+4));
      y = ::Rf_rnorm(1.0/(x+1),1.0/sqrt(2*x+2));
    }
    mat(i,0) = x;
    mat(i,1) = y;
  }

  return mat;             // Return to R
'
# Compile and Load
RcppGibbs <- cxxfunction(signature(n="int", thin = "int"),
                         gibbscode, plugin="Rcpp")

It is noteworthy how the code logic is essentially identical between the basic R version, and the C++ version. Two nested loops control draws of x from a Gamma distribution, conditional on y, as well as draws of y from a Normal, conditional on x. Add a small amount of parameter passing to obtain the parameters N and thin, allocation of a results matrix and setup of the random number generator state to remain consistent with R, as well as a return of the matrix---and that is all.

As Darren's code uses the GNU GSL in its C variant, I also became interested in seeing how a C/C++ hybrid variant using our RcppGSL package would fare. The code is below.

gslgibbsincl <- '
  #include <gsl/gsl_rng.h>
  #include <gsl/gsl_randist.h>

  using namespace Rcpp;  // just to be explicit
'

gslgibbscode <- '
  int N = as<int>(ns);
  int thin = as<int>(thns);
  int i, j;
  gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937);
  double x=0, y=0;
  NumericMatrix mat(N, 2);
  for (i=0; i<N; i++) {
    for (j=0; j<thin; j++) {
      x = gsl_ran_gamma(r,3.0,1.0/(y*y+4));
      y = 1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2));
    }
    mat(i,0) = x;
    mat(i,1) = y;
  }
  gsl_rng_free(r);

  return mat;           // Return to R
'

## Compile and Load
GSLGibbs <- cxxfunction(signature(ns="int", thns = "int"),
                        body=gslgibbscode, includes=gslgibbsincl,
                        plugin="RcppGSL")
This code is similar to the version using just Rcpp, but we need to allocate space for the GSL random generator object (and later release that memory allocation), and we do of course call the GSL functions. This also necessitates declaring the function using the two header files listed as arguments for the include argument of cxxfunction().

So how is the performance? The script (now committed in Rcpp's SVN repo as examples/RcppGibbs/RcppGibbs.R, and also part of the next release) creates the output below when running in non-interactive mode (whereas interactive mode creates a few charts too):

edd@max:~/svn/rcpp/pkg/Rcpp/inst/examples/RcppGibbs$ r RcppGibbs.R
Replication # 1 complete 
Replication # 2 complete 
Replication # 3 complete 
Replication # 4 complete 
                    N=1000 N=5000 N=10000 N=20000
Elasped Time (R)     0.124  2.650  10.511  41.773
Elasped Time (RC)    0.081  1.916   7.594  30.280
Elapsed Time (Rcpp)  0.003  0.076   0.306   1.221
Elapsed Time (Rgsl)  0.002  0.049   0.196   0.784
SpeedUp Rcomp.       1.530  1.380   1.380   1.380
SpeedUp Rcpp        41.330 34.870  34.350  34.210
SpeedUp GSL         62.000 54.080  53.630  53.280

               test replications elapsed  relative user.self sys.self
4  GSLGibbs(N, thn)           10   7.845  1.000000      7.84        0
3 RcppGibbs(N, thn)           10  12.218  1.557425     12.22        0
2   RCgibbs(N, thn)           10 312.296 39.808286    311.98        0
1    Rgibbs(N, thn)           10 420.953 53.658764    420.59        0
The first block is a hand-computed comparison using four sets of parameters; the second block uses the excellent rbenchmark package to compare ten runs at twenty-thousand draws.

We see a nominal increase in performance due to the bytecode compiler, saving roughly 38 percent which seems appropriate given that the R code mostly controls the loops; actual work in undertaken in the already compiled RNG functions. The Rcpp variant is about 34 times faster than the pure R code. Sanjog reported higher increases on his OS X machines (and Darren's post echos a similar order of magnitude). However, on my i7 running Linux I always obtained an improvement in the mid- to high thirties. That is certainly already a rather pleasant result.

What surprised and stunned me at first was that the GSL solution scores an improvement of around 53 times (close to the factor of 60 reported by Darren). A closer look at the code (shown above) makes it clear that there are very few compute-intensive operations outside of the RNG draws. I validated this further with a second study timing just one million draws each from a Gaussian and Gamma using R via Rcpp, and using the GSL. It turns out that the R code is about 2.5 times slower for random draws from the Gamma distribution than the GSL. Inspection of the source code---in files src/nmath/rgamma.c for R and randist/gamma.c for the GSL shows why. R uses a much more complex (and presumably more precise) algorithm. I may follow up with Martin Maechler to see if we can illustrative the numerical benefits of this more expensive approach---this blog entry is getting long enough already.

So to sum up: Gibbs sampling is a somewhat resource-heavy Monte Carlo Markov Chain method for investigating multivariate distributions. R excels at quick and simple explorations, albeit at somewhat slower execution speed. The Rcpp package can help by providing easy means to accelerate simulations by a significant factor. The example discussed here is now in SVN repository for Rcpp and will be part of the next release.

Updated 2011-07-16: Darren has just updated his comparison; fixed two typos here too.

/code/rcpp | permanent link

Wed, 06 Jul 2011

Rcpp 0.9.5
A maintenance release version 0.9.5 of Rcpp is now on CRAN and in Debian.

This release comprises a number of minor fixes, extensions as well as small additions to the documentation and examples which have accumulated since the last release in April. The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.5   2011-07-05

    o   New Rcpp-FAQ examples on using the plugin maker for inline's
        cxxfunction(), and on setting row and column names for matrices
        
    o   New sugar functions: mean, var, sd

    o   Minor correction and extension to STL documentation in Rcpp-quickref

    o   wrap() is now resilient to NULL pointers passed as in const char *
    
    o   loadRcppModules() gains a "direct" argument to expose the module instead
        of exposing what is inside it

    o   Suppress a spurious warning from R CMD check on packages created with
        Rcpp.package.skeleton(..., module=TRUE)

    o   Some fixes and improvements for Rcpp sugar function 'rlnorm()'

    o   Beginnings of new example using OpenMP and recognising user interrupts

Thanks to CRANberries, there is also a diff to the previous release 0.9.4:
 ChangeLog                                             |   74
 DESCRIPTION                                           |   10
 R/00_classes.R                                        |    3
 R/Module.R                                            |   16
 R/loadRcppModules.R                                   |   10
 R/populate.R                                          |   10
 R/tools.R                                             |   13
 R/zzz.R                                               |    3
 cleanup                                               |    2
 inst/NEWS                                             |   21
 inst/doc/Rcpp-FAQ.pdf                                 |binary
 inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw                        |   62
 inst/doc/Rcpp-extending.pdf                           |binary
 inst/doc/Rcpp-introduction.pdf                        |binary
 inst/doc/Rcpp-modules.pdf                             |binary
 inst/doc/Rcpp-modules/Rcpp-modules.Rnw                |    7
 inst/doc/Rcpp-package.pdf                             |binary
 inst/doc/Rcpp-quickref.pdf                            |binary
 inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw              |   59
 inst/doc/Rcpp-sugar.pdf                               |binary
 inst/doc/Rcpp-unitTests.pdf                           |binary
 inst/doc/Rcpp.bib                                     |    4
 inst/doc/unitTests-results/Rcpp-unitTests.html        |   18
 inst/doc/unitTests-results/Rcpp-unitTests.txt         |   49
 inst/examples/OpenMP                                  |only
 inst/include/Rcpp/Module.h                            |   33
 inst/include/Rcpp/config.h                            |    2
 inst/include/Rcpp/internal/wrap.h                     |    5
 inst/include/Rcpp/module/Module_generated_CppMethod.h | 2902  +++++++++++++++++-
 inst/include/Rcpp/stats/random/rlnorm.h               |   14
 inst/include/Rcpp/stats/random/rnorm.h                |    4
 inst/include/Rcpp/sugar/functions/functions.h         |    3
 inst/include/Rcpp/sugar/functions/mean.h              |only
 inst/include/Rcpp/sugar/functions/sd.h                |only
 inst/include/Rcpp/sugar/functions/sum.h               |    4
 inst/include/Rcpp/sugar/functions/var.h               |only
 inst/include/Rcpp/vector/Vector.h                     |    4
 inst/skeleton/zzz.R                                   |    1
 inst/unitTests/runit.wrap.R                           |   25
 man/CppClass-class.Rd                                 |    2
 man/loadRcppModules.Rd                                |    6
 src/Module.cpp                                        |    1
 42 files changed, 3252 insertions(+), 115 deletions(-)

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

/code/rcpp | permanent link

Tue, 05 Jul 2011

Even faster linear model fits with R using RcppEigen
Linear regression models are a major component of every applied researcher's toolbox. Obtaining results more quickly is therefore of central importance, particularly when many such models have to be fit. Common examples in this context are Monte Carlo simulation or bootstrapping.

My talks introducing High Performance Computing with R (see e.g. these slides from a five-hour workshop at the ISM in Tokyo) frequently feature an example of how to extend R with dedicated compiled code for linear regressions. Romain and I also frequently use this a motivating examples with our Rcpp package for seamless R and C++ integration. In fact, the examples directory for Rcpp still contains an earlier version of a benchmark for fastLm(), a faster alternative for R's lm() and lm.fit() functions. We have also extended this with the RcppArmadillo package which brings Conrad Sanderson's excellent Armadillo library with templated C++ code for linear algebra to R, as well as a simple integration to the GNU GSL via our RcppGSL package. The Rcpp section on my blog contains several posts about fastLm benchmarks.

Doug Bates has been a key Rcpp contributor, helping particularly with the initial Armadillo integration. His research, however, also requires highly performing sparse matrix operations which Armadillo does not yet offer. So Doug has started to explore the Eigen project---a free C++ template math library mainly focused on vectors, matrices, and linear algebra (note that we will refer to the Eigen, Eigen2 and Eigen3 APIs as just 'Eigen' here, focusing on the latest version, Eigen3). Better still, Doug went to work and pretty much single-handedly wrote a new package RcppEigen which integrates the templated C++ library Eigen with R using Rcpp.

RcppEigen also provides a fastLm implementation and benchmark script. In fact, it contains a full six different implementations as Doug is keenly interested in rank-revealing decompositions which can guard against ill-conditioned model matrices. Some more background information on this is also available in Doug's article on Least Squares Calculations in R in R News 4(1).

Doug's implementation also uses an elegant design. It comprises a base class with common functionality, and six subclasses which specialize accordingly for these six different decompositions approaches:

  • a column-pivoting QR,
  • a standard QR,
  • an LL,
  • an LDL,
  • an SVD, and
  • a standard symmetric one.

On my server, the result of running the included benchmark script lmBenchmark is as follows:

lm benchmark for n = 100000 and p = 40: nrep = 20
     test   relative elapsed user.self sys.self
7     LLt   1.000000   0.918      0.91     0.00
3    LDLt   1.002179   0.920      0.92     0.00
5 SymmEig   3.021786   2.774      2.19     0.57
6      QR   5.136166   4.715      4.24     0.48
2   PivQR   5.303922   4.869      4.27     0.58
8    arma   6.592593   6.052      6.03     0.02
1  lm.fit   9.386710   8.617      7.14     1.45
4     SVD  33.858388  31.082     30.19     0.84
9     GSL 114.972767 105.545    104.79     0.63
From this first set of results, the preferred method may be 'PivQR', the pivoted QR. Strictly-speaking, it is the only one we can compare to lm.fit() which also uses a pivoting scheme. In the case of a degenerated model matrix, all the other methods, including the four fastest approaches, are susceptible to producing incorrect estimates. Doug plans to make SVD and SymmEig rank-revealing too.

As for pure speed, the LL and LDL decomposition have almost identical performance, and are clearly faster than the other approaches. Compared to lm.fit(), which is the best one could do with just R, we see an improvement by a factor of eight which is quite impressive (albeit not robust to rank-deficient model matrices). Apart from the SVD, all approaches using Eigen are faster than the one using Armadillo, which itself is still faster than R's lm.fit(). Doug and I were very surprised by the poor performance of the GNU GSL (which also uses SVD) via RcppGSL.

Now, Eigen uses its own code for all linear algebra operations, bypassing BLAS and LAPACK libraries. The results above were achieved with the current Atlas package in Ubuntu. If we take advantage of the BLAS / LAPACK plug-in architecture offered on Debian / Ubuntu systems (see the vignette in my gcbd package for more) and use Goto BLAS which provide tuning as well as parallelism on multi-core machines, the results are as follow:

lm benchmark for n = 100000 and p = 40: nrep = 20
     test   relative elapsed user.self sys.self
3    LDLt   1.000000   0.907      0.90     0.00
7     LLt   1.000000   0.907      0.91     0.00
5 SymmEig   2.981257   2.704      2.14     0.56
6      QR   5.004410   4.539      4.03     0.50
8    arma   5.072767   4.601     15.30     3.05
2   PivQR   5.307607   4.814      4.27     0.55
1  lm.fit   8.302095   7.530      9.55    12.25
4     SVD  33.015436  29.945     29.06     0.85
9     GSL 195.413451 177.240    244.64   319.89
We see that the BLAS-using Armadillo approach improves a little and moves just slightly ahead of the pivoted QR. On the other hand, lm.fit(), which also uses a pivoting scheme and hence only level 1 BLAS operations, changes less. GSL performs even worse (and it is unclear why). Doug's post announcing RcppEigen on the Eigen list has a few more sets of results.

This post has illustrated some of the performance gains that can be obtained from using Eigen via RcppEigen. When not using rank-revealing methods, computing time can be reduced by up to eight times relative to lm.fit(). Rank-revealing method can still improve by almost a factor of two. The main disadvantage of Eigen may be one of the reasons behind its impressive performance: its heavily templated code does not use BLAS, and the resulting object code (as e.g. in RcppEigen) becomes enormous (when compiling with debugging symbols). As one illustration, the shared library for RcppEigen on my Ubuntu 64-bit system has a size of 24.6 mb whereas RcppArmadillo comes in at a mere 0.78 mb; without debugging symbols it is a more reasonable 0.52 mb.

The performance of Eigen is certainly intriguiging, and its API is rather complete. It seems safe to say that we may see more R projects going to make use of Eigen thanks to the RcppEigen wrapper.

Update: Clarified statement about large object size which was entirely due to building with debugging support.

/code/rcpp | permanent link

Fri, 01 Jul 2011

RcppArmadillo 0.2.25
Following a series of pre-releases, Armadillo version 2.0.0 was announced by Conrad Sanderson earlier in the week. As it happens, it contained another minor build regression so version 2.0.1 followed the next day. We created versions 0.2.24 and 0.2.25, respectively, of RcppArmadillo from this, and the latter release is now on CRAN.

The NEWS file entries for both releases follow below; they include the aggregate changes some of which were already provided by the pre-releases leading up to Armadillo 2.0.0.

0.2.25  2011-06-30

    o   Upgraded to Armadillo 2.0.1 which fixes two minor compilation issues

0.2.24  2011-06-29

    o   Upgraded to Armadillo release 2.0.0 "Carnivorous Sugar Glider"

          * faster multiplication of tiny matrices (≤ 4x4)
          * faster compound expressions containing submatrices
          * faster inverse of symmetric positive definite matrices
          * faster element access for fixed size matrices
          * added handling of arbitrarily sized empty matrices (eg. 5x0)
          * added loading & saving of matrices as CSV text files
          * added .count() member function to running_stat and
            running_stat_vec 
          * added syl(), strans(), symmatu()/symmatl()
          * added submatrices of submatrices
          * det(), inv() and solve() can be forced to use more precise
          * algorithms for tiny matrices (≤ 4x4)
          * htrans() has been deprecated; use trans() instead
          * API change: trans() now takes the complex conjugate when
            transposing a complex matrix 
          * API change: .is_vec() now outputs true for empty vectors
            (eg. 0x1) 
          * API change: forms of chol(), eig_sym(), eig_gen(), inv(), 
            lu(), pinv(), princomp(), qr(), solve(), svd(), syl() that do not
            return a bool indicating success now throw std::runtime_error
            exceptions when failures are detected 
          * API change: princomp_cov() has been removed; princomp() in 
            conjunction with cov() can be used instead
          * API change: set_log_stream() & get_log_stream() have been 
            replaced by set_stream_err1() & get_stream_err1()

Courtesy of CRANberries, here is the diff to the previous release.
 ChangeLog                                     |   12 +++++
 DESCRIPTION                                   |   10 ++--
 inst/NEWS                                     |   36 +++++++++++++++-
 inst/include/armadillo_bits/arma_version.hpp  |   10 ++--
 inst/include/armadillo_bits/auxlib_meat.hpp   |    4 -
 inst/include/armadillo_bits/diagmat_proxy.hpp |    4 -
 inst/include/armadillo_bits/fn_misc.hpp       |   58 ++++++++++++++------------
 inst/include/armadillo_bits/fn_princomp.hpp   |   31 +++++++++++++
 inst/include/armadillo_bits/subview_meat.hpp  |    2
 9 files changed, 126 insertions(+), 41 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 24 Jun 2011

RcppArmadillo 0.2.23
Conrad Sanderson released version 1.99.5 of Armadillo yesterday. This provides the fifth release candidate en route to version 2.0.0. He was even kind enough to post on rcpp-devel about it too as it entails some minor API changes. His version 1.99.5 has been integrated into RcppArmadillo version 0.2.23 which is now on CRAN. By way of background, Armadillo is a templated C++ library for linear algebra---which RcppArmadillo brings to R based on our Rcpp library.

A minor internal change was the rearrangement of arguments for the (mostly internal) function fastLmPure so that it is closer to the R function lm.fit which it mimics. The user-facing function for fastLm, using either the formula method or the default method, have not changed.

The short NEWS file extract follows below. I also include the entry for the bugfix release 0.2.22 (based on Armadillo 1.99.4) which preceded it, and which does not seem to have gotten its own blog post.

0.2.23  2011-05-23

    o   Upgraded to Armadillo release 1.99.5 "v2.0 beta 5"

          * Forms of chol(), eig_sym(), eig_gen(), inv(), lu(), pinv(),
	    princomp(), qr(), solve(), svd(), syl() that do not return a bool
	    indicating success now throw std::runtime_error exceptions when
	    failures are detected 
          * princomp_cov() has been removed; princomp() in conjunction with
	    cov() can be used instead
          * set_log_stream() & get_log_stream() have been replaced by
	    set_stream_err1() & get_stream_err1()
          * det(), inv() and solve() can be forced to use more precise
	    algorithms for tiny matrices (≤ 4x4)
          * Added loading & saving of matrices as CSV text files 

    o   fastLmPure() now uses same argument order as R's lm.fit()

    o   Export and document S3 methods in NAMESPACE and manual page as such

0.2.22  2011-06-06

    o   Upgraded to Armadillo release 1.99.4 "v2.0 beta 4" 

          * fixes for handling of tiny matrices

Courtesy of CRANberries, here is the diff to the previous release.
 RcppArmadillo-0.2.22/RcppArmadillo/inst/include/armadillo_bits/fn_princomp_cov.hpp       |only
 RcppArmadillo-0.2.22/RcppArmadillo/inst/include/armadillo_bits/op_princomp_cov_bones.hpp |only
 RcppArmadillo-0.2.22/RcppArmadillo/inst/include/armadillo_bits/op_princomp_cov_meat.hpp  |only
 RcppArmadillo-0.2.23/RcppArmadillo/ChangeLog                                             |   21
 RcppArmadillo-0.2.23/RcppArmadillo/DESCRIPTION                                           |   10
 RcppArmadillo-0.2.23/RcppArmadillo/NAMESPACE                                             |   14
 RcppArmadillo-0.2.23/RcppArmadillo/R/fastLm.R                                            |   22
 RcppArmadillo-0.2.23/RcppArmadillo/inst/NEWS                                             |   22
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo                                |    3
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp             |   12
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp             |    2
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp              |  150 +++-
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp          |    4
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/auxlib_bones.hpp          |   15
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp           |  352 +++++-----
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/config.hpp                |    8
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/debug.hpp                 |  224 ++++--
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/diskio_bones.hpp          |   12
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp           |  301 +++++++-
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp            |   18
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_chol.hpp               |   30
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_eig.hpp                |   84 +-
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_inv.hpp                |   36 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_log_det.hpp            |   10
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_lu.hpp                 |   33
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_misc.hpp               |   12
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_pinv.hpp               |   33
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_princomp.hpp           |   49 +
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_qr.hpp                 |   11
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_rank.hpp               |   13
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_solve.hpp              |   13
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_svd.hpp                |   25
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp           |   18
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/forward_bones.hpp         |    3
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/glue_join_meat.hpp        |   71 +-
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/glue_solve_meat.hpp       |   13
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/lapack_bones.hpp          |   95 ++
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_chol_meat.hpp          |    6
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_inv_bones.hpp          |    6
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_inv_meat.hpp           |   39 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_max_meat.hpp           |   50 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_median_meat.hpp        |  115 +--
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_min_meat.hpp           |   50 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_misc_bones.hpp         |   14
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_misc_meat.hpp          |   46 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_pinv_meat.hpp          |   39 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_princomp_bones.hpp     |   20
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_princomp_meat.hpp      |  248 ++-----
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_prod_meat.hpp          |   34
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_stddev_meat.hpp        |   38 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_sum_meat.hpp           |   36 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/op_var_meat.hpp           |   38 -
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/running_stat_meat.hpp     |    4
 RcppArmadillo-0.2.23/RcppArmadillo/inst/include/armadillo_bits/running_stat_vec_meat.hpp |    4
 RcppArmadillo-0.2.23/RcppArmadillo/inst/unitTests/runit.fastLm.R                         |    8
 RcppArmadillo-0.2.23/RcppArmadillo/man/fastLm.Rd                                         |   32
 RcppArmadillo-0.2.23/RcppArmadillo/src/fastLm.cpp                                        |   15
 57 files changed, 1695 insertions(+), 886 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Sat, 28 May 2011

RcppArmadillo 0.2.21
Following up Conrad's 1.99.2 release (in RcppArmadillo 0.2.20), we now have Armadillo 1.99.3 en route to the upcoming 2.0.0 release. Armadillo is a templated C++ library for linear algebra---which RcppArmadillo brings to R based on our Rcpp library.

The short NEWS file extract follows below.

0.2.21  2011-05-27

    o   Upgraded to Armadillo release 1.99.3 "v2.0 beta 3" 

          * stricter size checking for row and column vectors
          * added .count() member function to running_stat and running_stat_vec

And courtesy of CRANberries, here is the diff to the previous release.
Diff between RcppArmadillo versions 0.2.20 dated 2011-05-26 and 0.2.21 dated 2011-05-28

 ChangeLog                                              |    8 
 DESCRIPTION                                            |    8 
 inst/NEWS                                              |    7 
 inst/include/armadillo                                 |    2 
 inst/include/armadillo_bits/Col_meat.hpp               |   13 -
 inst/include/armadillo_bits/Mat_bones.hpp              |    2 
 inst/include/armadillo_bits/Mat_meat.hpp               |  147 +++++++-------
 inst/include/armadillo_bits/Row_meat.hpp               |   11 -
 inst/include/armadillo_bits/arma_version.hpp           |    4 
 inst/include/armadillo_bits/diagview_bones.hpp         |    2 
 inst/include/armadillo_bits/diagview_meat.hpp          |    4 
 inst/include/armadillo_bits/diskio_meat.hpp            |   40 ++--
 inst/include/armadillo_bits/fn_accu.hpp                |  167 ++++++++++-------
 inst/include/armadillo_bits/fn_det.hpp                 |   10 -
 inst/include/armadillo_bits/fn_prod.hpp                |   15 +
 inst/include/armadillo_bits/op_dot_bones.hpp           |    9 
 inst/include/armadillo_bits/op_dot_meat.hpp            |  119 +++++++++---
 inst/include/armadillo_bits/promote_type.hpp           |   24 +-
 inst/include/armadillo_bits/running_stat_bones.hpp     |   16 -
 inst/include/armadillo_bits/running_stat_meat.hpp      |   47 ++--
 inst/include/armadillo_bits/running_stat_vec_bones.hpp |    6 
 inst/include/armadillo_bits/running_stat_vec_meat.hpp  |   21 +-
 inst/include/armadillo_bits/subview_meat.hpp           |   23 +-
 inst/include/armadillo_bits/traits.hpp                 |   16 -
 inst/include/armadillo_bits/typedef_u64.hpp            |   21 --
 25 files changed, 446 insertions(+), 296 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Thu, 26 May 2011

RcppArmadillo 0.2.20
Conrad Sanderson is preparing version 2.0.0 of his Armadillo templated C++ library for linear algebra and has released a first public beta version 1.99.2. This has been folded into a new release of the RcppArmadillo wrapper for R based on our Rcpp library.

Also added in this version is a new example of a simulation of a vector autoregression process which I had blogged about earlier. The example had been prepared for the Rcpp workshop / class at last month's R/Finance conference, and demonstrates a rather nice speed gain from using Rcpp and RcppArmadillo.

The short NEWS file extract follows below.

0.2.20  2011-05-25

    o   Upgraded to Armadillo release 1.99.2 "v2.0 beta 2" (and 1.99.1 before)

          * faster inverse of symmetric matrices
          * faster element access for fixed size matrices
          * faster multiplication of tiny matrices (eg. 4x4)
          * faster compund expressions containing submatrices
          * added handling of arbitrarily sized empty matrices (eg. 5x0)
          * added syl()
          * added strans()
          * added symmatu()/symmatl()
          * added submatrices of submatrices
          * htrans() has been deprecated; use trans() instead
          * trans() now takes the complex conjugate when transposing a
            complex matrix
          * .is_vec() now outputs true for empty matrices
          * most functions with matrix inputs no longer throw exceptions when
            given empty matrices (eg. 5x0)

    o   Added a new subdirectory examples/ seeded with a nice Vector
        Autoregression simulation simulation example by Lance Bachmeier

    o   Rewrote armadillo_version as to no longer require an instance 
        of arma::arma_version, with tanks to Conrad for the suggestion

And courtesy of CRANberries, here is the diff to the previous release.
Diff between RcppArmadillo versions 0.2.19 dated 2011-04-24 and 0.2.20 dated 2011-05-26

 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp              |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Cube_proto.hpp             |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/GlueCube_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Glue_proto.hpp             |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp              |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/OpCube_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Op_proto.hpp               |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp              |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/arma_ostream_proto.hpp     |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/atlas_proto.hpp            |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/auxlib_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/blas_proto.hpp             |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/diagview_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/diskio_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eGlue_proto.hpp            |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eOpCube_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eOp_proto.hpp              |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eglue_core_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/eop_core_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/field_proto.hpp            |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/fn_htrans.hpp              |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/forward_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_conv_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_cor_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_cov_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_cross_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_join_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_kron_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_mixed_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_relational_proto.hpp  |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_solve_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_times_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/glue_toeplitz_proto.hpp    |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/injector_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/lapack_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/mtGlueCube_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/mtGlue_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/mtOpCube_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/mtOp_proto.hpp             |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_chol_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_cor_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_cov_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_cumsum_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_cx_scalar_proto.hpp     |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_diagmat_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_diagvec_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_dot_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_dotext_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_find_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_flip_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_htrans_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_inv_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_max_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_mean_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_median_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_min_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_misc_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_pinv_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_princomp_cov_proto.hpp  |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_princomp_proto.hpp      |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_prod_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_relational_proto.hpp    |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_repmat_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_reshape_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_shuffle_proto.hpp       |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_sort_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_stddev_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_sum_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_trans_meat.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_trans_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_trimat_proto.hpp        |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/op_var_proto.hpp           |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/podarray_proto.hpp         |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/running_stat_proto.hpp     |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/running_stat_vec_proto.hpp |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/subview_cube_proto.hpp     |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_proto.hpp    |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/subview_field_proto.hpp    |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/subview_proto.hpp          |only
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/wall_clock_proto.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/ChangeLog                                              |   20 
 RcppArmadillo-0.2.20/RcppArmadillo/DESCRIPTION                                            |   10 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/NEWS                                              |   26 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/examples                                          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/RcppArmadillo/Mat_meat.h                  |    8 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo                                 |  199 -
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Col_bones.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp               |  519 +++
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp             |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp              |   96 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/GlueCube_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Glue_bones.hpp             |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp               |  673 +++-
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/OpCube_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Op_bones.hpp               |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Proxy.hpp                  |   28 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/ProxyCube.hpp              |   20 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Row_bones.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp               |  491 +++
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arma_ostream_bones.hpp     |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arma_ostream_meat.hpp      |   87 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arma_static_assert.hpp     |   31 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp           |    6 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arrayops_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp          |  143 -
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/atlas_bones.hpp            |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/auxlib_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp            |  772 ++++-
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/blas_bones.hpp             |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp         |   17 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/debug.hpp                  |   24 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/diagmat_proxy.hpp          |   93 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/diagview_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp          |  128 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/diskio_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp            |  104 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp         |   14 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eGlue_bones.hpp            |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eGlue_meat.hpp             |   14 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eOpCube_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eOp_bones.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eglue_core_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp        |  519 ++-
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eop_core_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp          |  327 +-
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp            |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_accu.hpp                |   40 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_det.hpp                 |    7 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_diagmat.hpp             |    7 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_elem.hpp                |   62 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_eye.hpp                 |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_inv.hpp                 |   18 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_log_det.hpp             |    8 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_max.hpp                 |   38 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_mean.hpp                |   42 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_median.hpp              |   53 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_min.hpp                 |   38 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_ones.hpp                |   45 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp                |   20 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_randn.hpp               |   10 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_randu.hpp               |   12 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_stddev.hpp              |   20 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_strans.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp            |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_symmat.hpp              |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_trans.hpp               |   35 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_var.hpp                 |   20 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/fn_zeros.hpp               |   12 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/forward_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/gemm.hpp                   |  337 --
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/gemm_mixed.hpp             |   59 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/gemv.hpp                   |  208 +
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_conv_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_conv_meat.hpp         |   16 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_cor_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_cor_meat.hpp          |   12 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_cov_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_cross_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_cross_meat.hpp        |   47 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_join_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_join_meat.hpp         |   46 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_kron_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_mixed_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_relational_bones.hpp  |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_solve_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_times_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_times_meat.hpp        |  493 +--
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_toeplitz_bones.hpp    |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/glue_toeplitz_meat.hpp     |    5 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/injector_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/lapack_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/mtGlueCube_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/mtGlue_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/mtOpCube_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/mtOp_bones.hpp             |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_chol_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cor_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cor_meat.hpp            |   14 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cov_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cumsum_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cumsum_meat.hpp         |    9 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_cx_scalar_bones.hpp     |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_diagmat_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_diagmat_meat.hpp        |   10 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_diagvec_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_dot_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_dotext_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_find_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_flip_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_htrans_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_htrans_meat.hpp         |   98 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_inv_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_inv_meat.hpp            |   13 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_max_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_max_meat.hpp            |   57 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_mean_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_mean_meat.hpp           |   34 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_median_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_median_meat.hpp         |  214 -
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_min_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_min_meat.hpp            |   33 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_misc_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_pinv_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_pinv_meat.hpp           |   10 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_princomp_bones.hpp      |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_princomp_cov_bones.hpp  |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_prod_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_prod_meat.hpp           |   34 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_relational_bones.hpp    |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_repmat_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_repmat_meat.hpp         |   29 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_reshape_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_reshape_meat.hpp        |   32 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_shuffle_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_shuffle_meat.hpp        |   10 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_sort_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_stddev_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_stddev_meat.hpp         |   34 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_strans_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_strans_meat.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_sum_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_sum_meat.hpp            |   38 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_symmat_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_symmat_meat.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_trimat_bones.hpp        |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_trimat_meat.hpp         |  190 +
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_var_bones.hpp           |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/op_var_meat.hpp            |   37 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/operator_times.hpp         |   12 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/podarray_bones.hpp         |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/podarray_meat.hpp          |   57 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/promote_type.hpp           |   18 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/running_stat_bones.hpp     |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/running_stat_meat.hpp      |    2 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/running_stat_vec_bones.hpp |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_bones.hpp          |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_cube_bones.hpp     |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_cube_meat.hpp      |   50 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_bones.hpp    |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_meat.hpp     |   24 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_field_bones.hpp    |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_field_meat.hpp     |   37 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp           | 1423 +++++++++-
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/traits.hpp                 |   69 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/typedef_u64.hpp            |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/undefine_conflicts.hpp     |only
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/unwrap.hpp                 |   64 
 RcppArmadillo-0.2.20/RcppArmadillo/inst/include/armadillo_bits/wall_clock_bones.hpp       |only
 RcppArmadillo-0.2.20/RcppArmadillo/src/RcppArmadillo.cpp                                  |   27 
 253 files changed, 6400 insertions(+), 2358 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 29 Apr 2011

Slides from Rcpp workshop / master class yesterday
Romain and I just posted our slides from yesterday's Rcpp workshop and class (preceding the now-ongoing R/Finance conference). You can access the slides via my presentation page, or directly from here as Part 1 (Introduction), Part 2 (Details), Part 3 (Advanced) and Part 4 (Applications). The page also contains a link to the examples as a tar.gz and zip file.

Update: One link corrected.

/code/rcpp | permanent link

Sun, 24 Apr 2011

RcppArmadillo 0.2.19
Last Monday, Conrad Sanderson released version 1.2.10 of his most excellent Armadillo templated C++ library for linear algebra; I followed up the same day with version 0.2.19 of our RcppArmadillo wrapper for R based on our Rcpp library. However, the chief gatekeeper at CRAN took a well-deserved vacation last week, and with that it arrived only today on CRAN.

The short NEWS file extract follows below containing just Conrad's entry for 1.2.0. No further changes from our side (and the benchmark comparison between R, compiled R and Rcpp for computing a VAR(1) dataset which I blogged about yesterday is only in SVN and will be in the next release.)

0.2.19	2011-04-18

    o	Upgraded to Armadillo version 1.2.0 "Unscrupulous Carbon Emitter"

	  * Added ability to use Blas & Lapack libraries with capitalised
	    function names 
	  * Reduction of pedantic compiler warnings

And courtesy of CRANberries, here are the diffs to the previous release.
 RcppArmadillo-0.2.18/RcppArmadillo/inst/doc/RcppArmadillo-unitTests.tex                    |only
 RcppArmadillo-0.2.19/RcppArmadillo/ChangeLog                                               |   10 
 RcppArmadillo-0.2.19/RcppArmadillo/DESCRIPTION                                             |   10 
 RcppArmadillo-0.2.19/RcppArmadillo/R/fastLm.R                                              |    2 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/NEWS                                               |   22 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/doc/Makefile                                       |    5 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 RcppArmadillo-0.2.19/RcppArmadillo/inst/doc/unitTests-results/RcppArmadillo-unitTests.html |   16 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   40 -
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/arma_ostream_meat.hpp       |   14 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/arma_ostream_proto.hpp      |    4 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp            |    6 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp             |  128 +--
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/blas_proto.hpp              |   92 +-
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp          |   12 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/config.hpp                  |    3 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/constants.hpp               |   20 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp             |    2 
 RcppArmadillo-0.2.19/RcppArmadillo/inst/include/armadillo_bits/lapack_proto.hpp            |  344 ++++++----
 19 files changed, 460 insertions(+), 270 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Wed, 13 Apr 2011

Rcpp 0.9.4, and a paper in the Journal of Statistical Software
A brand new 0.9.4 release of Rcpp is now on CRAN and Debian.

This version contains an improvement to loading and initialization of Rcpp modules, a bug fix for vectors of factors, another build issue fix as well as (per common practice with JSS) citation information for the article Rcpp: Seamless R and C++ Integration which is now Volume 40, Issue 8 in the Journal of Statistical Software (or JSS for short).

The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.4   2011-04-12

    o   New R function "loadRcppModules" to load Rcpp modules automatically
        from a package. This function must be called from the .onLoad function
        and works with the "RcppModules" field of the package's DESCRIPTION file

    o   The Modules example wrapped the STL std::vector received some editing
        to disambiguate some symbols the newer compilers did not like

    o   Coercing of vectors of factors is now done with an explicit callback
        to R's "as.character()" as Rf_coerceVector no longer plays along

    o   A CITATION file for the published JSS paper has been added, and 
        references were added to Rcpp-package.Rd and the different vignettes

Thanks to CRANberries, there is also a diff to the previous release 0.9.3:
Diff between Rcpp versions 0.9.3 dated 2011-04-05 and 0.9.4 dated 2011-04-12

 Rcpp-0.9.3/Rcpp/build                                             |only
 Rcpp-0.9.3/Rcpp/inst/skeleton/yada.Rd                             |only
 Rcpp-0.9.3/Rcpp/inst/unitTests/testRcppModule/R/Modules.R         |only
 Rcpp-0.9.3/Rcpp/inst/unitTests/testRcppModule/man/yada.Rd         |only
 Rcpp-0.9.4/Rcpp/ChangeLog                                         |   55 
 Rcpp-0.9.4/Rcpp/DESCRIPTION                                       |   10 
 Rcpp-0.9.4/Rcpp/NAMESPACE                                         |   29 
 Rcpp-0.9.4/Rcpp/R/Rcpp.package.skeleton.R                         |   11 
 Rcpp-0.9.4/Rcpp/R/loadRcppModules.R                               |only
 Rcpp-0.9.4/Rcpp/inst/CITATION                                     |only
 Rcpp-0.9.4/Rcpp/inst/NEWS                                         |   17 
 Rcpp-0.9.4/Rcpp/inst/doc/Makefile                                 |    2 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-FAQ.pdf                             |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw                    |  153 +-
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-extending.pdf                       |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw        |    2 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-introduction.Rnw                    |  734 ++++------
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-introduction.pdf                    |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-modules.pdf                         |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-modules/Rcpp-modules.Rnw            |   36 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-package.pdf                         |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-package/Rcpp-package.Rnw            |    4 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-quickref.pdf                        |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-quickref/Rcpp-quickref.Rnw          |   34 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-sugar.pdf                           |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-sugar/Rcpp-sugar.Rnw                |    2 
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp-unitTests.pdf                       |binary
 Rcpp-0.9.4/Rcpp/inst/doc/Rcpp.bib                                 |   73 
 Rcpp-0.9.4/Rcpp/inst/doc/unitTests-results/Rcpp-unitTests.html    |   18 
 Rcpp-0.9.4/Rcpp/inst/doc/unitTests-results/Rcpp-unitTests.txt     |   40 
 Rcpp-0.9.4/Rcpp/inst/include/Rcpp/config.h                        |    2 
 Rcpp-0.9.4/Rcpp/inst/skeleton/zzz.R                               |   11 
 Rcpp-0.9.4/Rcpp/inst/unitTests/runit.Module.client.package.R      |   27 
 Rcpp-0.9.4/Rcpp/inst/unitTests/runit.Vector.R                     |   18 
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/DESCRIPTION         |    2 
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/NAMESPACE           |    3 
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/R/zzz.R             |only
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/src/rcpp_module.cpp |    6 
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/src/stdVector.cpp   |   18 
 Rcpp-0.9.4/Rcpp/inst/unitTests/testRcppModule/tests/modules.R     |   21 
 Rcpp-0.9.4/Rcpp/man/Rcpp-package.Rd                               |    6 
 Rcpp-0.9.4/Rcpp/man/loadRcppModules.Rd                            |only
 Rcpp-0.9.4/Rcpp/src/r_cast.cpp                                    |    9 
 43 files changed, 647 insertions(+), 696 deletions(-)

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

/code/rcpp | permanent link

Thu, 07 Apr 2011

RcppClassic 0.9.1
Another pure maintenance release, this time of RcppClassic, the package supporting the deprecated older classic Rcpp API defined in the earlier 2005 to 2006 releases, is now on CRAN

It contains no new code, but smoothes one or two edges in the build process and noticed by the newest versions of R CMD check, just like yesterday's RcppGSL release.

Courtesy of CRANberries, here are the changes to the previous release.

Diff between RcppClassic versions 0.9.0 dated 2010-12-20 and 0.9.1 dated 2011-04-07

 RcppClassic-0.9.0/RcppClassic/build                                                 |only
 RcppClassic-0.9.0/RcppClassic/inst/lib                                              |only
 RcppClassic-0.9.1/RcppClassic/ChangeLog                                             |   17 ++++++
 RcppClassic-0.9.1/RcppClassic/DESCRIPTION                                           |    8 +--
 RcppClassic-0.9.1/RcppClassic/inst/doc/Makefile                                     |   25 ++++++----
 RcppClassic-0.9.1/RcppClassic/inst/doc/RcppClassic-unitTests.pdf                    |binary
 RcppClassic-0.9.1/RcppClassic/inst/doc/RcppClassic.pdf                              |binary
 RcppClassic-0.9.1/RcppClassic/inst/doc/unitTests-results/RcppClassic-unitTests.html |only
 RcppClassic-0.9.1/RcppClassic/inst/doc/unitTests-results/RcppClassic-unitTests.txt  |only
 RcppClassic-0.9.1/RcppClassic/inst/unitTests/runit.RcppDate.R                       |   24 ++++-----
 10 files changed, 49 insertions(+), 25 deletions(-)

Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Wed, 06 Apr 2011

Rcpp workshop / master class on April 28 in Chicago

I realized I never announced this on the blog, so without further ado....

Rcpp Workshop in Chicago on April 28, 2011

This year's R/Finance conference will be preceded by a full-day masterclass on Rcpp and related topics which will be held on Thursday, April 28, 2011, on the University of Illinois at Chicago campus.

Join Dirk Eddelbuettel and Romain Francois for six hours of detailed and hands-on instructions and discussions around Rcpp, inline, RInside, RcppArmadillo and other packages---in an intimate small-group setting.

The full-day format allows to combine a morning introductory session with a more advanced afternoon session while leaving room for sufficient breaks. There will be about six hours of instructions, a one-hour lunch break and two half-hour coffee breaks.

Morning session: "A hands-on introduction to R and C++"

The morning session will provide a practical introduction to the Rcpp package (and other related packages). The focus will be on simple and straightforward applications of Rcpp in order to extend R and/or to significantly accelerate the execution of simple functions.

The tutorial will cover the inline package which permits embedding of self-contained C, C++ or Fortran code in R scripts. We will also discuss RInside to embed R code in C++ applications, as well as standard Rcpp extension packages such as RcppArmadillo for linear algebra and RcppGSL.

Afternoon session: "Advanced R and C++ topics"

This afternoon tutorial will provide a hands-on introduction to more advanced Rcpp features. It will cover topics such as writing packages that use Rcpp, how 'Rcpp modules' and the new R ReferenceClasses interact, and how 'Rcpp sugar' lets us write C++ code that is often as expressive as R code. Another possible topic, time permitting, may be writing glue code to extend Rcpp to other C++ projects.

We also hope to leave some time to discuss problems brought by the class participants.

Prerequisites

Knowledge of R as well as general programming knowledge; C or C++ knowledge is helpful but not required.

Users should bring a laptop set up so that R packages can be built. That means on Windows, Rtools needs to be present and working, and on OS X the Xcode package should be installed.

Registration

Registration is available via the R/Finance conference at

http://www.RinFinance.com/register/

or directly at RegOnline

http://www.regonline.com/930153

The cost is USD 500 for the whole day, and space will be limited.

Questions

Please contact us directly at RomainAndDirk@r-enthusiasts.com.

/code/rcpp | permanent link

RcppGSL 0.1.1
A pure maintenance release of RcppGSL---our interface package between R and the GNU GSL using our Rcpp package for seamless R and C++ integration---is now on CRAN

It contains no new code, but smoothes one or two edges in the build process and noticed by the newest versions of R CMD check. It also adds vignette from the unit tests as some of our other packages do.

The short NEWS file extract follows below.

0.1.1   2011-04-05

    o   Unit tests produce a summary vignette as for some of the other packages

    o   The documentation Makefile now uses the $R_HOME environment variable

    o   The documentation Makefile no longer calls clean in the all target

And courtesy of CRANberries, here are the changes to the previous release.
Diff between RcppGSL versions 0.1.0 dated 2010-12-01 and 0.1.1 dated 2011-04-06

 ChangeLog                      |   22 ++++++++++++++++++++
 DESCRIPTION                    |    8 +++----
 inst/NEWS                      |    8 +++++++
 inst/doc/Makefile              |   28 ++++++++++++++++++++------
 inst/doc/RcppGSL-unitTests.Rnw |only
 inst/doc/RcppGSL-unitTests.pdf |only
 inst/doc/RcppGSL-unitTests.tex |only
 inst/doc/RcppGSL.pdf           |binary
 inst/doc/RcppGSL/RcppGSL.Rnw   |   43 ++++++++++++++++++-----------------------
 inst/doc/unitTests             |only
 src/Makevars.in                |    2 -
 11 files changed, 75 insertions(+), 36 deletions(-)

More information is on the RcppGSL page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Tue, 05 Apr 2011

Rcpp 0.9.3
A brand new and shiny 0.9.3 release of Rcpp is now on CRAN and Debian.

This version contains an actual bug fix for Rcpp modules and a few build improvements, including for both clang/llvm and g++-4.6 (which, being in Debian, is already used for conformance checks on CRAN's incoming directory) and g++-4.5. We also updated the main introductory vignette Rcpp-introduction to the content of what should be a forthcoming paper in the Journal of Statistical Software. The complete NEWS entry is below; more details are in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.3   2011-04-05

    o   Fixed a bug in which modules code was not behaving when compiled 
        twice as can easily happen with inline'ed version

    o   Exceptions code includes exception_defines.h only when g++ is 4.5 or
        younger as the file no longer exists with g++-4.6
    
    o   The documentation Makefile now uses the $R_HOME environment variable

    o   The documentation Makefile no longer calls clean in the all target

    o   C++ conformance issue found by clang/llvm addressed by re-ordering
        declarations in grow.h as unqualified names must be declared before
        they are used, even when used within templates

    o   The 'long long' typedef now depends on C++0x being enabled as this
        was not a feature in C++98; this suppresses a new g++-4.5 warning

    o   The Rcpp-introduction vignette was updated to the forthcoming JSS paper

Thanks to CRANberries, there is also a diff to the previous release 0.9.2:
Diff between Rcpp versions 0.9.2 dated 2011-02-24 and 0.9.3 dated 2011-04-05

 ChangeLog                                                  |   60 
 DESCRIPTION                                                |    8 
 R/00_classes.R                                             |    5 
 R/01_show.R                                                |   44 
 R/Module.R                                                 |    1 
 cleanup                                                    |    2 
 inst/NEWS                                                  |   23 
 inst/doc/Makefile                                          |   74 
 inst/doc/Rcpp-FAQ.pdf                                      |binary
 inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw                             |    2 
 inst/doc/Rcpp-extending.pdf                                |binary
 inst/doc/Rcpp-introduction.Rnw                             | 1355 +++++++------
 inst/doc/Rcpp-introduction.pdf                             |binary
 inst/doc/Rcpp-modules.pdf                                  |binary
 inst/doc/Rcpp-package.pdf                                  |binary
 inst/doc/Rcpp-quickref.pdf                                 |binary
 inst/doc/Rcpp-sugar.pdf                                    |binary
 inst/doc/Rcpp-unitTests.pdf                                |binary
 inst/doc/Rcpp.bib                                          |   99 
 inst/doc/jss.bst                                           |only
 inst/doc/unitTests-results/Rcpp-unitTests.html             |   18 
 inst/doc/unitTests-results/Rcpp-unitTests.txt              |   46 
 inst/include/Rcpp/Module.h                                 |   40 
 inst/include/Rcpp/Vector.h                                 |    6 
 inst/include/Rcpp/config.h                                 |    2 
 inst/include/Rcpp/grow.h                                   |   91 
 inst/include/Rcpp/module/Module_generated_ctor_signature.h |   18 
 inst/include/Rcpp/vector/RangeIndexer.h                    |    5 
 inst/include/RcppCommon.h                                  |    6 
 inst/unitTests/runit.Module.R                              |   19 
 inst/unitTests/testRcppModule/src/stdVector.cpp            |    7 
 src/exceptions.cpp                                         |    2 
 32 files changed, 1167 insertions(+), 766 deletions(-)

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

/code/rcpp | permanent link

Mon, 04 Apr 2011

RcppArmadillo 0.2.18
Conrad Sanderson made a bug-fix release (1.1.92) by for his wonderful Armadillo templated C++ library for linear algebra appeared yesterday and as usual a new release 0.2.18 of RcppArmadillo, our Rcpp-based integration into R is now on CRAN mirrors.

The short NEWS file extract follows below containing just Conrad's entry for 1.1.92. No further changes from our side.

0.2.18  2011-04-03

    o   Upgraded to Armadillo Version 1.1.92  "Jurassic Barbecue"

          * Bugfix in cor()
          * Automatic installation now requires CMake >= 2.6

And courtesy of CRANberries, here are the diffs to the previous release.
 ChangeLog                                     |    8 ++
 DESCRIPTION                                   |   10 +--
 inst/NEWS                                     |    7 ++
 inst/doc/Makefile                             |    2 
 inst/doc/RcppArmadillo-unitTests.tex          |only
 inst/include/armadillo_bits/Cube_meat.hpp     |   12 ---
 inst/include/armadillo_bits/Cube_proto.hpp    |    4 -
 inst/include/armadillo_bits/Mat_meat.hpp      |    2 
 inst/include/armadillo_bits/Mat_proto.hpp     |    4 -
 inst/include/armadillo_bits/arma_version.hpp  |    4 -
 inst/include/armadillo_bits/glue_cor_meat.hpp |   83 ++++++++++++--------------
 11 files changed, 73 insertions(+), 63 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Wed, 23 Mar 2011

RcppArmadillo 0.2.17
Another release (1.1.90) by Conrad Sanderson for his wonderful Armadillo templated C++ library for linear algebra appeared yesterday. Consequently, a new release 0.2.17 of RcppArmadillo, our Rcpp-based integration into R is now on CRAN mirrors.

The short NEWS file extract follows below containing just Conrad's entry for 1.1.90. No further changes from our side.

0.2.17  2011-03-22

    o   Upgraded to Armadillo Version 1.1.90  "Inside Job"

         * Added .min() & .max(), which can provide the extremum's location
         * More robust mean(), var(), stddev()

And courtesy of CRANberries, here are the diffs to the previous release.
 ChangeLog                                               |    6 
 DESCRIPTION                                             |    8 
 inst/NEWS                                               |    7 
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |    6 
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   36 +-
 inst/include/armadillo_bits/Cube_meat.hpp               |  112 ++++++++-
 inst/include/armadillo_bits/Cube_proto.hpp              |   14 -
 inst/include/armadillo_bits/Mat_meat.hpp                |   98 +++++++
 inst/include/armadillo_bits/Mat_proto.hpp               |   10 
 inst/include/armadillo_bits/arma_version.hpp            |    4 
 inst/include/armadillo_bits/fn_prod.hpp                 |   12 
 inst/include/armadillo_bits/fn_stddev.hpp               |   18 -
 inst/include/armadillo_bits/fn_var.hpp                  |   18 -
 inst/include/armadillo_bits/glue_mixed_meat.hpp         |   22 -
 inst/include/armadillo_bits/op_max_meat.hpp             |  199 ++++++++++------
 inst/include/armadillo_bits/op_max_proto.hpp            |   21 +
 inst/include/armadillo_bits/op_mean_meat.hpp            |  154 +++++++++++-
 inst/include/armadillo_bits/op_mean_proto.hpp           |   22 +
 inst/include/armadillo_bits/op_min_meat.hpp             |  199 ++++++++++------
 inst/include/armadillo_bits/op_min_proto.hpp            |   19 +
 inst/include/armadillo_bits/op_stddev_meat.hpp          |   44 ++-
 inst/include/armadillo_bits/op_stddev_proto.hpp         |    9 
 inst/include/armadillo_bits/op_var_meat.hpp             |  198 +++++++++++----
 inst/include/armadillo_bits/op_var_proto.hpp            |   14 -
 25 files changed, 925 insertions(+), 325 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 11 Mar 2011

RcppArmadillo 0.2.16
Conrad Sanderson continues an active release schedule for his wonderful Armadillo templated C++ library for linear algebra; release 1.1.8 just came out yesterday. So I made a new release 0.2.16 of RcppArmadillo, our Rcpp-based integration into R. No changes on our side. This new version should now be on most CRAN mirrors.

The short NEWS file extract follows below containing just Conrad's entry for 1.1.8.

0.2.16  2011-03-10

    o   Upgraded to Armadillo Version 1.1.8   "Kangaroo Steak"

         * Added floor() and ceil()
         * Added "not a number": math::nan()
         * Added infinity: math::inf()
         * Added standalone is_finite()
         * Faster min(), max(), mean()
         * Bugfix for a corner case with NaNs in min() and max()

And courtesy of CRANberries, here are the diffs to.2.15.
 ChangeLog                                               |    6 
 DESCRIPTION                                             |   10 
 inst/NEWS                                               |   11 
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |    6 
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   38 -
 inst/include/armadillo                                  |    2 
 inst/include/armadillo_bits/Cube_meat.hpp               |   10 
 inst/include/armadillo_bits/Mat_meat.hpp                |   30 -
 inst/include/armadillo_bits/arma_ostream_meat.hpp       |  119 ++---
 inst/include/armadillo_bits/arma_ostream_proto.hpp      |    8 
 inst/include/armadillo_bits/arma_version.hpp            |    6 
 inst/include/armadillo_bits/arrayops_meat.hpp           |   39 +
 inst/include/armadillo_bits/arrayops_proto.hpp          |    5 
 inst/include/armadillo_bits/auxlib_meat.hpp             |   10 
 inst/include/armadillo_bits/constants.hpp               |  322 +++++++++++---
 inst/include/armadillo_bits/diskio_meat.hpp             |   46 +-
 inst/include/armadillo_bits/eglue_core_meat.hpp         |  345 +++-------------
 inst/include/armadillo_bits/eop_aux.hpp                 |   16 
 inst/include/armadillo_bits/eop_core_meat.hpp           |  105 +---
 inst/include/armadillo_bits/eop_core_proto.hpp          |    6 
 inst/include/armadillo_bits/fn_elem.hpp                 |   58 ++
 inst/include/armadillo_bits/fn_misc.hpp                 |   53 ++
 inst/include/armadillo_bits/fn_norm.hpp                 |   14 
 inst/include/armadillo_bits/format_wrap.hpp             |   12 
 inst/include/armadillo_bits/op_max_meat.hpp             |   43 -
 inst/include/armadillo_bits/op_mean_meat.hpp            |   38 -
 inst/include/armadillo_bits/op_min_meat.hpp             |   46 +-
 inst/include/armadillo_bits/op_var_meat.hpp             |   27 -
 inst/include/armadillo_bits/restrictors.hpp             |    9 
 inst/include/armadillo_bits/traits.hpp                  |   20 
 31 files changed, 782 insertions(+), 678 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 04 Mar 2011

RcppArmadillo 0.2.14 and 0.2.15
A few days ago Conrad Sanderson released version 1.1.6 of his Armadillo templated C++ library for linear algebra. Accordingly, I made a new release 0.2.14 of RcppArmadillo, our Rcpp-based integration into R which included a few local fixes. However, while I updated SVN at the R-Forge project I didn't update the final tarball so Armadillo 1.1.6 wasn't in it. That is corrected in the 0.2.15 upload which is now on CRAN and its mirrors.

The short NEWS file extract for both releases follows, also containing Conrad's entry for 1.1.6. A few minor tweaks were added but no user-visible changes:

0.2.15  2011-03-04

    o   Upgraded to Armadillo Version 1.1.6   “Baby Carpet Shark”

         * fixed size matrices and vectors can use auxiliary (external) memory
         * .in_range() can use span() arguments
         * subfields can use span() arguments

0.2.14  2011-03-02

    o   Support Run-Time Type Information (RTTI) on matrices by setting the
        state variable vec_state in Row and Col instantiation, with thanks to
        Conrad Sanderson for the hint

    o   fastLm code simplified further by instantiating the Armadillo matrix
        and vector directly from the SEXP coming from R

    o   inst/doc/Makefile now respects $R_HOME environment variable

And courtesy of CRANberries, here are the diffs to.2.14
 ChangeLog                                               |   14 -
 DESCRIPTION                                             |    8 
 inst/NEWS                                               |   10 
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |   10 
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   39 +-
 inst/include/armadillo_bits/Col_meat.hpp                |   51 +++
 inst/include/armadillo_bits/Col_proto.hpp               |    3 
 inst/include/armadillo_bits/Cube_meat.hpp               |   52 +++
 inst/include/armadillo_bits/Cube_proto.hpp              |    7 
 inst/include/armadillo_bits/Mat_meat.hpp                |   51 +++
 inst/include/armadillo_bits/Mat_proto.hpp               |   12 
 inst/include/armadillo_bits/Row_meat.hpp                |   51 +++
 inst/include/armadillo_bits/Row_proto.hpp               |    3 
 inst/include/armadillo_bits/arma_version.hpp            |    6 
 inst/include/armadillo_bits/config.hpp                  |    9 
 inst/include/armadillo_bits/field_meat.hpp              |  220 ++++++++++++++--
 inst/include/armadillo_bits/field_proto.hpp             |   20 +
 inst/unitTests/runit.RcppArmadillo.R                    |   16 +
 19 files changed, 521 insertions(+), 61 deletions(-)
and to the previous release 0.2.13, respectivel
 ChangeLog                                               |   14 ++++++
 DESCRIPTION                                             |    6 +-
 inst/NEWS                                               |   11 +++++
 inst/doc/Makefile                                       |   15 +++++--
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |   18 ++++----
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   34 ++++++++--------
 inst/include/RcppArmadillo/Col_meat.h                   |   24 ++++++-----
 inst/include/RcppArmadillo/Row_meat.h                   |   19 ++++----
 src/fastLm.cpp                                          |   15 ++-----
 10 files changed, 94 insertions(+), 62 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Thu, 24 Feb 2011

Rcpp 0.9.2
The 0.9.2 release of Rcpp is now on CRAN and Debian.

This version contains a build fix for the older 10.5.* version of OS X and its g++ 4.2.1 compiler; we now skip one test that upset it. CRAN builds for OS X should resume. We also added simple configuration support for the Intel Compiler; feedback would be welcome on the list. Lastly, documentation in the vignettes was expanded a little. The NEWS entry is below; more detail is in the ChangeLog file in the package and on the Rcpp Changelog page.

0.9.2   2011-02-23

    o   The unitTest runit.Module.client.package.R is now skipped on older OS
        X releases as it triggers a bug with g++ 4.2.1 or older; OS X 10.6 is
        fine but as it no longer support ppc we try to accomodate 10.5 too
        Thanks to Simon Urbanek for pinning this down and Baptiste Auguie
        and Ken Williams for additonal testing 

    o   RcppCommon.h now recognises the Intel Compiler thanks to a short
        patch by Alexey Stukalov; this turns off Cxx0x and TR1 features too

    o   Three more setup questions were added to the Rcpp-FAQ vignette

    o   One question about RcppArmadillo was added to the Rcpp-FAQ vignette

Thanks to CRANberries, there is also a diff to the previous release 0.9.1.

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

/code/rcpp | permanent link

Sat, 19 Feb 2011

RcppArmadillo 0.2.13
Yesterday Conrad Sanderson released version 1.1.4 of his Armadillo templated C++ library for linear algebra, so hot on the heels our 0.2.12 release from a few days ago comes version 0.2.13 of RcppArmadillo, our Rcpp-based integration into R. This new version 0.2.13 is now on CRAN and its mirrors.

The short NEWS file extract follows, also containing Conrad's entry for 1.1.4:

0.2.13  2011-02-18

    o   Upgraded to Armadillo Version 1.1.4   "Manta Lodge"

         * Faster sort()
         * Updated installation to detect recent versions of Intel's MKL
         * Added interpretation of arbitrary "flat" subcubes as matrices

And courtesy of CRANberries, here is the diff to the previous release 0.2.12:
Diff between RcppArmadillo versions 0.2.12 dated 2011-02-16 and 0.2.13 dated 2011-02-19

 ChangeLog                                               |    6 
 DESCRIPTION                                             |   14 
 inst/NEWS                                               |    8 
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |    6 
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   36 
 inst/include/armadillo_bits/Col_meat.hpp                |   64 +
 inst/include/armadillo_bits/Col_proto.hpp               |    3 
 inst/include/armadillo_bits/Cube_meat.hpp               |  124 ++
 inst/include/armadillo_bits/Cube_proto.hpp              |    7 
 inst/include/armadillo_bits/Mat_meat.hpp                |  696 +++++++++++---
 inst/include/armadillo_bits/Mat_proto.hpp               |   36 
 inst/include/armadillo_bits/Row_meat.hpp                |   62 +
 inst/include/armadillo_bits/Row_proto.hpp               |    3 
 inst/include/armadillo_bits/arma_version.hpp            |    4 
 inst/include/armadillo_bits/arrayops_meat.hpp           |   76 -
 inst/include/armadillo_bits/debug.hpp                   |  254 ++++-
 inst/include/armadillo_bits/field_meat.hpp              |   44 
 inst/include/armadillo_bits/field_proto.hpp             |    2 
 inst/include/armadillo_bits/fn_accu.hpp                 |   15 
 inst/include/armadillo_bits/fn_prod.hpp                 |   10 
 inst/include/armadillo_bits/forward_proto.hpp           |    8 
 inst/include/armadillo_bits/injector_meat.hpp           |   70 +
 inst/include/armadillo_bits/injector_proto.hpp          |    4 
 inst/include/armadillo_bits/op_sort_meat.hpp            |  242 ++---
 inst/include/armadillo_bits/op_sort_proto.hpp           |   15 
 inst/include/armadillo_bits/span.hpp                    |   72 +
 inst/include/armadillo_bits/subview_cube_meat.hpp       |  759 +++++++++++++---
 inst/include/armadillo_bits/subview_cube_proto.hpp      |   19 
 inst/include/armadillo_bits/subview_field_meat.hpp      |   83 +
 inst/include/armadillo_bits/subview_field_proto.hpp     |   11 
 inst/include/armadillo_bits/subview_meat.hpp            |  118 +-
 inst/include/armadillo_bits/subview_proto.hpp           |   21 
 33 files changed, 2113 insertions(+), 779 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Wed, 16 Feb 2011

RcppArmadillo 0.2.12
A new version 1.1.2 of Conrad Sanderson's Armadillo templated C++ library for linear algebra came out a couple of days ago. This has now been wrapped into a new version 0.2.12 of RcppArmadillo, our Rcpp-based integration into R.

The short NEWS file extract follows, also containing Conrad's entry for 1.1.2:

0.2.12  2011-02-15

    o   Upgraded to Armadillo Version 1.1.2   “Flood Kayak”

         * Faster prod()
         * Faster solve() for compound expressions
         * Fix for compilation using GCC's C++0x mode
         * Fix for matrix handling by subcubes

And courtesy of CRANberries, here is the diff to the previous release 0.2.11:
Diff between RcppArmadillo versions 0.2.11 dated 2011-01-08 and 0.2.12 dated 2011-02-16

 RcppArmadillo-0.2.11/RcppArmadillo/inst/include/armadillo_bits/syslib_proto.hpp            |only
 RcppArmadillo-0.2.12/RcppArmadillo/ChangeLog                                               |    6 
 RcppArmadillo-0.2.12/RcppArmadillo/DESCRIPTION                                             |   17 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/NEWS                                               |   12 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 RcppArmadillo-0.2.12/RcppArmadillo/inst/doc/unitTests-results/RcppArmadillo-unitTests.html |    6 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   30 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/README                                     |    1 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo                                  |   13 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Base.hpp                    |   15 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp                |   14 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp               |    8 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp               |    6 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp                |   20 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp               |   15 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp                |   14 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp               |    8 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/arma_config.hpp             |   10 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp            |    8 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp           |only
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp          |  448 +---------
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp             |   63 -
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/auxlib_proto.hpp            |   10 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp          |    8 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/config.hpp                  |   20 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/debug.hpp                   |   27 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp              |   60 -
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp                 |   40 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/glue_solve_meat.hpp         |   10 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/glue_solve_proto.hpp        |    4 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/injector_meat.hpp           |    6 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/op_dot_meat.hpp             |    2 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/op_prod_meat.hpp            |   29 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/op_reshape_meat.hpp         |    8 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/op_trans_meat.hpp           |    2 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/op_trimat_meat.hpp          |    4 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/podarray_meat.hpp           |    4 
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/subview_cube_meat.hpp       |   50 -
 RcppArmadillo-0.2.12/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp            |    8 
 39 files changed, 339 insertions(+), 667 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Tue, 15 Feb 2011

Rcpp 0.9.1
A new release 0.9.1 of Rcpp went to CRAN and Debian yesterday.

This version contains mostly bug-fixes and rather few enhancements. The changes are mostly 'internal fixes' and not user-facing; they mostly address some issues in memory management which, while not tripping up the unit tests or common usage, caused trouble for advanced Rcpp modules use and repeated memory allocation / deallocation. This bit Doug Bates repeatedly, and he put his head down and debugged the issue. A number of changes fairly deep-down in Rcpp (as well as in R-devel) later, this looks much better and we owe him a hearfelt Thank You!

A big Thanks! also goes to Luke Tierney who out some new memory debugging code into R-devel which the --enable-strict-barrier in R 2.13.0 (due in April) will enable. A related fix is also in R 2.12.2 due on the 25th. The NEWS entry is below; more detail is in the ChangeLog file in the package.

0.9.1   2011-02-14

    o   A number of internal changes to the memory allocation / protection of
        temporary objects were made---with a heartfelt "Thank You!" to both
        Doug Bates for very persistent debugging of Rcpp modules code, and to
        Luke Tierney who added additional memory allocation debugging tools
        to R-devel (which will be in R 2.13.0 and may also be in R 2.12.2)
        
    o   Removed another GNU Make-specific variable from src/Makevars in order
        to make the build more portable; this was noticed on FreeBSD

    o   On *BSD, do not try to compute a stack trace but provide file and
        line number (which is the same behaviour as implemented in Windows)

    o   Fixed an int conversion bug reported by Daniel Sabanes Bove on r-devel,
        added unit test as well
    
    o   Added unit tests for complex-typed vectors (thanks to Christian Gunning)
    
    o   Expanded the Rcpp-quickref vignette (with thanks to Christian Gunning)

    o   Additional examples were added to the Rcpp-FAQ vignette
Thanks to CRANberries, there is also a diff to the previous release 0.9.0.

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

/code/rcpp | permanent link

Tue, 18 Jan 2011

RcppBDT 0.1.0
The family of Rcpp packages just grew by one: the first 0.1.0 release of RcppBDT is now on CRAN.

RcppBDT stands for Rcpp Boost Date_Time. It employs what we call Rcpp modules: a mechanism which provides easier ways to expose C++ functions and classes to R (and which bears some resemblance to Boost.Python---see this vignette about Rcpp modules for more details). And thus RcppBDT provides R users with access to (some) Boost Date.Time functionality.

I used Boost Date.Time because it is widely known, useful and well tested. It can also be used in pure template mode not requiring linking (if one foregoes string parsing and formatting which is fine here as we get this from R already; it can be added via a #define in the header file). With that, the package is rather portable as it only needs to find the Boost headers. (And no, I have not yet added a configure option for that.)

Basic usage follows Rcpp modules and provides the C++ class via a Reference Class in R. That means using a new constructor and assessing functions via the $ operator. Here is an example:

R> library(RcppBDT)
Creating a new generic function for "print" in "RcppBDT"
Creating a new generic function for "format" in "RcppBDT"
R> d <- new(bdtMod$date, 2011, 1, 18)
R> format(d)
[1] "2011-01-18"
R>
Not very exiting yet: we create a date, using explicit year, months and date arguments and then format it. Something more useful follows:
R> d$getDayOfWeek()
[1] 2
R> d$getModJulian()
[1] 55579
R> d$getFirstOfNextMonth()
[1] "2011-02-01"
R>
We can use accessors to extracts parts of the date, or use functions to convert the date to different representations such as a modified Julian date. Moreover, given a date, we can apply helper functions such as get me the date of the beginning of the next month.

More interesting still are helper functions such as the ones below. Note that this also shows the alternate access method using wrapper functions I added for the package, this may be more familiar to most R users:

R> getNthDayOfWeek(third, Wed, Dec, 2010)
[1] "2010-12-15"
R> getLastDayOfWeekInMonth(Sat, Dec, 2010)
[1] "2010-12-25"
R> getFirstDayOfWeekInMonth(Sat, Dec, 2010)
[1] "2010-12-04"
R> getFirstDayOfWeekAfter(Wed, as.Date("2010-12-31"))
[1] "2011-01-05"
R>
This uses some of the constants Jan, Feb, ... , Dec; Sun, Mon, ..., Sat and first ... fifth defined in the package; normal integers can also be used. The third Wednesday in a month is also known as the IMM Date to Finance-heads; the example was borrowed from Whit's earlier rboostdatetime code on github. More examples are in the demo available with the package and accessible via demo(RcppBDT) once you install the package.

As always, feedback would be welcome, both on the usefulness (or lack thereof) of the Boost Date.Time functionality as well as on the Rcpp modules wrapping. Additional Boost Date.Time functionality (durations, times, ...) may be added; contributions would be welcome. The rcpp-devel mailing list off the R-Forge page for Rcpp is the best place to start a discussion.

/code/rcpp | permanent link

Sat, 08 Jan 2011

RcppArmadillo 0.2.11
Just before Xmas, Conrad Sanderson released version 1.1.0 of Armadillo, his templated C++ library for linear algebra. Which I only noticed this week, so here comes version 0.2.11 of RcppArmadillo, our Rcpp-based integration into R.

The only other change is the addition of an unexported function SHLIB which can be used to compiled a single source file into a loadable shared library file for R, while automagically find Rcpp and RcppArmadillo headers and the Rcpp library.

The short NEWS file extract follows, also containing Conrad's entry for 1.1.0:

0.2.11  2011-01-06

    o   Upgraded to Armadillo Version 1.1.0   “Climate Vandal”

         * Extended submatrix views, including access to elements whose
           indices are specified in a separate vector
         * Added handling of raw binary files by save/load functions
         * Added cumsum()
         * Added interpretation of matrices as triangular via
           trimatu()/trimatl() 
         * Faster solve(), inv() via explicit handling of triangular matrices 
         * The stream for logging of errors and warnings can now be changed 

    o   New unexported R function SHLIB, a small wrapper around R CMD SHLIB,
        which can be used as   Rscript -e "RcppArmadillo:::SHLIB('foo.cpp')"

And courtesy of CRANberries, here is the diff to the previous release 0.2.10:
 ChangeLog                                               |   17 
 DESCRIPTION                                             |   12 
 R/SHLIB.R                                               |only
 inst/NEWS                                               |   13 
 inst/doc/Makefile                                       |    5 
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |   16 
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   34 
 inst/include/armadillo                                  |    9 
 inst/include/armadillo_bits/Col_meat.hpp                |   25 
 inst/include/armadillo_bits/Col_proto.hpp               |    5 
 inst/include/armadillo_bits/Cube_meat.hpp               |   54 +
 inst/include/armadillo_bits/Cube_proto.hpp              |    7 
 inst/include/armadillo_bits/Mat_meat.hpp                |  469 ++++++++++++
 inst/include/armadillo_bits/Mat_proto.hpp               |   54 +
 inst/include/armadillo_bits/Proxy.hpp                   |   63 +
 inst/include/armadillo_bits/Row_meat.hpp                |   25 
 inst/include/armadillo_bits/Row_proto.hpp               |    3 
 inst/include/armadillo_bits/arma_version.hpp            |   11 
 inst/include/armadillo_bits/auxlib_meat.hpp             |  102 ++
 inst/include/armadillo_bits/auxlib_proto.hpp            |   13 
 inst/include/armadillo_bits/debug.hpp                   |  101 +-
 inst/include/armadillo_bits/diskio_meat.hpp             |  280 +++++++
 inst/include/armadillo_bits/diskio_proto.hpp            |    9 
 inst/include/armadillo_bits/field_meat.hpp              |   23 
 inst/include/armadillo_bits/field_proto.hpp             |    3 
 inst/include/armadillo_bits/fn_cumsum.hpp               |only
 inst/include/armadillo_bits/fn_dot.hpp                  |   66 +
 inst/include/armadillo_bits/fn_elem.hpp                 |only
 inst/include/armadillo_bits/fn_inv.hpp                  |   27 
 inst/include/armadillo_bits/fn_max.hpp                  |   17 
 inst/include/armadillo_bits/fn_mean.hpp                 |   17 
 inst/include/armadillo_bits/fn_median.hpp               |   15 
 inst/include/armadillo_bits/fn_min.hpp                  |   21 
 inst/include/armadillo_bits/fn_misc.hpp                 |  604 ----------------
 inst/include/armadillo_bits/fn_prod.hpp                 |   15 
 inst/include/armadillo_bits/fn_solve.hpp                |   22 
 inst/include/armadillo_bits/fn_stddev.hpp               |   15 
 inst/include/armadillo_bits/fn_sum.hpp                  |   25 
 inst/include/armadillo_bits/fn_trimat.hpp               |only
 inst/include/armadillo_bits/fn_var.hpp                  |   15 
 inst/include/armadillo_bits/forward_proto.hpp           |    7 
 inst/include/armadillo_bits/glue_solve_meat.hpp         |   32 
 inst/include/armadillo_bits/glue_solve_proto.hpp        |   12 
 inst/include/armadillo_bits/lapack_proto.hpp            |  103 ++
 inst/include/armadillo_bits/op_cumsum_meat.hpp          |only
 inst/include/armadillo_bits/op_cumsum_proto.hpp         |only
 inst/include/armadillo_bits/op_dot_meat.hpp             |   46 +
 inst/include/armadillo_bits/op_dot_proto.hpp            |    9 
 inst/include/armadillo_bits/op_find_meat.hpp            |   59 -
 inst/include/armadillo_bits/op_inv_meat.hpp             |   13 
 inst/include/armadillo_bits/op_inv_proto.hpp            |   14 
 inst/include/armadillo_bits/op_trimat_meat.hpp          |only
 inst/include/armadillo_bits/op_trimat_proto.hpp         |only
 inst/include/armadillo_bits/podarray_meat.hpp           |    7 
 inst/include/armadillo_bits/span.hpp                    |    9 
 inst/include/armadillo_bits/subview_elem1_meat.hpp      |only
 inst/include/armadillo_bits/subview_elem1_proto.hpp     |only
 inst/include/armadillo_bits/subview_meat.hpp            |  321 ++++++--
 inst/include/armadillo_bits/subview_proto.hpp           |    1 
 inst/include/armadillo_bits/typedef.hpp                 |    4 
 inst/include/armadillo_bits/unwrap.hpp                  |  135 +++
 62 files changed, 2155 insertions(+), 829 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Sat, 25 Dec 2010

Rcpp 0.9.0 announcement

The text below went out as a post to the r-packages list a few days ago, but I thought it would make sense to post it on the blog too. So with a little html markup...

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, and a few key points are highlighted below. More details are in the NEWS and ChangeLog files included in the package.

Overview

Rcpp is an R package and associated C++ library that facilitates integration of C++ code in R packages. 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 underlying SEXP so that the garbage collector does not attempt to reclaim the 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. A few key points about Rcpp:
  • a rich API covering all core R data types including vectors, matrices, functions, environments, ... (with the exeception of factors which are less useful in C++)
  • seamless (bi-directional) data interchange between R and C++
  • possibility of inline use permitting definition, compilation, linking and loading of C++ functions directly from R
  • extensive documentation now covering eight vignettes
  • exception handling and error propagation back to R
  • extensive test suite using RUnit covering over 700 tests
  • 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
  • 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 which are motivated by the corresponding R expressions. This covers operators (binary arithmetic, binary logical, unary), functions (producing 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 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.

Extension packackages

The RcppArmadillo package permits use of the advanced C++ library 'Armadillo, a C++ linear algebra library aiming towards a good balance between speed and ease of use, providing integer, floating point and complex matrices and vectors with lapack / blas support via R. Armadillo uses templates for a delayed evaluation approach is employed (during compile time) to combine several operations into one and reduce (or eliminate) the need for temporaries. Armadillo is useful if C++ has been decided as the language of choice, rather than another language like Matlab ® or Octave, and aims to be as expressive as the former. Via Rcpp and RcppArmadillo, R users now have easy access to this functionality. Examples are provided in the RcppArmadillo package.

The RcppGSL package permits easy use of the GNU Scientific Library (GSL), a collection of numerical routines for scientifc computing. It is particularly useful for C and C++ programs as it provides a standard C interface to a wide range of mathematical routines such as special functions, permutations, combinations, fast fourier transforms, eigensystems, random numbers, quadrature, random distributions, quasi-random sequences, Monte Carlo integration, N-tuples, differential equations, simulated annealing, numerical differentiation, interpolation, series acceleration, Chebyshev approximations, root-finding, discrete Hankel transforms physical constants, basis splines and wavelets. There are over 1000 functions in total with an extensive test suite. The RcppGSL package provides an easy-to-use interface between GSL data structures and R using concepts from Rcpp. The RcppGSL package also contains a vignette with more documentation.

Legacy 'classic' API

Packages still using code interfacing the initial 'classic' Rcpp API are encouraged to migrate to the new API. Should a code transition not be possible, backwards compatibility is provided by the RcppClassic package released alongside Rcpp 0.9.0. By including RcppClassic.h and building against the RcppClassic package and library, vintage code can remain operational using the classic API. The short vignette in the RcppClassic package has more details.

Documentation

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.

Links

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

Dirk Eddelbuettel, Romain Francois, Doug Bates and John Chambers
December 2010

/code/rcpp | permanent link

Wed, 22 Dec 2010

RcppExamples 0.1.2
A new version of our RcppExamples, package is now on CRAN.

RcppExamples contains a few illustrations of how to use Rcpp. It grew out of documentation for the classic API (now in its own package RcppClassic) and we added more functions documenting how to do the same with the new API we have been focusing on for the last year or so. One of the things I added in the last few days was the example below showing how to use Rcpp::List with lookups to replace use of the old and deprecated RcppParams. It also show how to return values to R rather easily

#include <Rcpp.h>

RcppExport SEXP newRcppParamsExample(SEXP params) {

    try {                                       // or use BEGIN_RCPP macro

        Rcpp::List rparam(params);              // Get parameters in params.
        std::string method   = Rcpp::as<std::string>(rparam["method"]);
        double tolerance     = Rcpp::as<double>(rparam["tolerance"]);
        int    maxIter       = Rcpp::as<int>(rparam["maxIter"]);
        Rcpp::Date startDate = Rcpp::Date(Rcpp::as<int>(rparam["startDate"])); // ctor from int
        
        Rprintf("\nIn C++, seeing the following value\n");
        Rprintf("Method argument    : %s\n", method.c_str());
        Rprintf("Tolerance argument : %f\n", tolerance);
        Rprintf("MaxIter argument   : %d\n", maxIter);
        Rprintf("Start date argument: %04d-%02d-%02d\n", 
                startDate.getYear(), startDate.getMonth(), startDate.getDay());

        return Rcpp::List::create(Rcpp::Named("method", method),
                                  Rcpp::Named("tolerance", tolerance),
                                  Rcpp::Named("maxIter", maxIter),
                                  Rcpp::Named("startDate", startDate),
                                  Rcpp::Named("params", params));  // or use rparam

    } catch( std::exception &ex ) {             // or use END_RCPP macro
        forward_exception_to_r( ex );
    } catch(...) { 
        ::Rf_error( "c++ exception (unknown reason)" ); 
    }
    return R_NilValue; // -Wall
}

The package is work-in-progress and needs way more general usage examples for Rcpp and particularly the new API. But it's a start.

A few more details on the page are on the RcppExamples page.

/code/rcpp | permanent link

Mon, 20 Dec 2010

Rcpp 0.9.0 and RcppClassic 0.9.0
A new release 0.9.0 of Rcpp is now available at CRAN and has just been uploaded to Debian. As always, sources are also available from my local directory here.

With this release, the older API which we have been referring to as the classic Rcpp API has been split off into its own new package RcppClassic to ensure backwards compatibility. Rcpp will now contain only the new API.

We also fixes a number a minor bugs and applied a few contributed patches which extended functionality or documentation as detailed below in the NEWS entry:

0.9.0   2010-12-19

    o   The classic API was factored out into its own package RcppClassic which
        is released concurrently with this version.

    o   If an object is created but not initialized, attempting to use
        it now gives a more sensible error message (by forwarding an
        Rcpp::not_initialized exception to R).

    o   SubMatrix fixed, and Matrix types now have a nested ::Sub typedef.
  
    o   New unexported function SHLIB() to aid in creating a shared library on
        the command-line or in Makefile (similar to CxxFlags() / LdFlags()).

    o   Module gets a seven-argument ctor thanks to a patch from Tama Ma.

    o   The (still incomplete) QuickRef vignette has grown thanks to a patch
        by Christian Gunning.

    o   Added a sprintf template intended for logging and error messages.

    o   Date::getYear() corrected (where addition of 1900 was not called for); 
        corresponding change in constructor from three ints made as well.

    o   Date() and Datetime() constructors from string received a missing
        conversion to int and double following strptime. The default format
        string for the Datetime() strptime call was also corrected.

    o   A few minor fixes throughout, see ChangeLog.

Thanks to CRANberries, there is also a diff to the previous release 0.8.9.

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

/code/rcpp | permanent link

Mon, 13 Dec 2010

RcppDE 0.1.0
A new package RcppDE has been uploaded in a first version 0.1.0 to CRAN. It provides differential evolution optimisation---a variant of stochastic optimisation that is similar to genetic algorithms but particularly suitable for the floating-point representations common in numerical optimisation. It builds of on the nice DEoptim package by Ardia et al, but reimplements the algorithm in C++ (rather than C) using a large serving of Rcpp and RcppArmadillo.

I worked on this on for a few evenings and weekends in October and November and then spent a few more evenings writing a paper / vignette (which is finished as a very first draft now) about it. This was an interesting and captivating problem as I had worked on genetic algorithms going back quite some time to the beginning and then again the end of graduate school (and traces of that early work are near the bottom of my presentations page). So what got me started? DEoptim is a really nice package, but it is implemented in old-school C. There is nothing wrong with that per se, but at the same time that I was wrestling with GAs, I also taught myself C++ which, to put it simply, offers a few more choices to the programmer. I like having those choices.

And with all the work that Romain and I have put into Rcpp, I was curious how far I could push this cart if I were to move it along. I made a bet with myself starting from the old saw shorter, easier, faster: pick any two. Would it be possible to achieve all three of these goals?

DEoptim, and I take version 2.0-7 as my reference point here, is pretty efficiently yet verbosely coded. Copying a vector takes a loop with an assignment for each element, copying a matrix does the same using two loops. Replacing that with a single statement in C++ is pretty easy. We also have a few little optimisations behind the scenes here and there in Rcpp: would all that be enough to move the needle in terms of performance? And the same time, DEoptim is also full of the uses of the old R API which we often point to in the Rcpp documentation so fixing readibility should be a relatively low-hanging fruit.

To cut a long story short, I was able to reduce code size quite easily by using a combination of C++ and Rcpp idioms. I was also able to get to faster: the paper / vignette demostrates consistent speed improvements on all setups that I tested (three standard functions on three small and three larger parameter vectors). More important speed gains were achieved by allowing use of objective functions that are written in C++ which again is both possible and easy thanks to Rcpp.

That leaves easier to prove: adding compiled objective functions is one indication; further proof could be provided by, say, moving the inner loop to parallel execution thanks to Open MP which I may attempt over the next few months. So far I'd like to give myself about half a point here. So not quite yet shorter, easier, faster: pick any three, but working on it.

Over the next few days I may try to follow up with a blog post or two contrasting some code examples and maybe showing a chart from the vignette.

/code/rcpp | permanent link

Wed, 01 Dec 2010

RcppGSL 0.1.0
Earlier in the year, Romain and I did a bunch of initial work on a wrapper from R to the GNU GSL by way of our Rcpp package for seamless R and C++ integration. But other work kept us busy and this fell a little to the side.

We have now found some time to finish this work for a first release, together with a nicely detailed eleven page package vignette. As of today, the package is now a CRAN package, and Romain already posted a nice announcement on his blog and on the rcpp-devel list.

So what does RcppGSL do? I gave the package its own webpage here as well and listed these points as key features of RcppGSL:

  • templated vector and matrix classes: these are similar to Rcpp's own vector and matrix classes, but really are just smart pointers around the C structure expected by the library
  • this means you can transfer data from R to your GSL-using programs in pretty much the same way you would in other C++ programs using Rcpp---by relying on the Rcpp::as() and Rcpp::wrap() converterrs
  • at the C++ level you can use these GSL vectors in a more C++-alike way (using eg foo[i] to access an element at index i)
  • yet at the same time you can just pass these vector and matrix objects to the GSL functions expecting its C objects: thanks to some cleverness in these classes they pass the right object on (see the example below)
  • we also provide the lightweight views for vectors and matrices as the GSL API uses these in many places.

Also provided is a simple example which is a simple implementation of a column norm (which we could easily compute directly in R, but we are simply re-using an example from Section 8.4.14 of the GSL manual):

#include <RcppGSL.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>

extern "C" SEXP colNorm(SEXP sM) {

  try {

        RcppGSL::matrix<double> M = sM;     // create gsl data structures from SEXP
        int k = M.ncol();
        Rcpp::NumericVector n(k);           // to store results

        for (int j = 0; j < k; j++) {
            RcppGSL::vector_view<double> colview = gsl_matrix_column (M, j);
            n[j] = gsl_blas_dnrm2(colview);
        }
        M.free() ;
        return n;                           // return vector

  } catch( std::exception &ex ) {
        forward_exception_to_r( ex );

  } catch(...) {
        ::Rf_error( "c++ exception (unknown reason)" );
  }
  return R_NilValue; // -Wall
}

This example function is implemented in an example package contained in the RcppGSL package itself -- so that users have a complete stanza to use in their packages. This will then build a user package on Linux, OS X and Windows provided the GSL is installed (and on Windows you have to do all the extra steps of defining an environment variable pointing to and of course install Rtools to build in the first place---Linux and OS X are so much easier for development).

Another complete example is in the package itself and provides a faster (compiled) alternative to the standard lm() function in R; this example is the continuation of the same example I had in several versions of my Intro to HPC with R tutorials and in the Rcpp package itself as an early example.

We will try to touch base with CRAN package authors using both GSL and Rcpp to see how this can help them. The API in our package may well be incomplete, but we are always happy to try to respond to requests for additional features brought to our attention, preferably via the rcpp-devel list.

More information is on the RcppGSL page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Sun, 28 Nov 2010

Rcpp 0.8.9
A new release 0.8.9 of Rcpp is now available at CRAN and has just been uploaded to Debian. As always, sources are also available from my local directory here.

This release comes a few weeks after the preceding 0.8.8 release and continues with a number of enhancements mostly to what we call Rcpp modules, our even-easier C++/R integration which follow some ideas from Boost.Python. Our corresponding Rcpp-modules vignette has been updated too.

The NEWS entry follows below:

0.8.9   2010-11-27

    o   Many improvements were made to in 'Rcpp modules':

        - exposing multiple constructors

        - overloaded methods

        - self-documentation of classes, methods, constructors, fields and 
          functions.

        - new R function "populate" to facilitate working with modules in 
          packages. 

        - formal argument specification of functions.

        - updated support for Rcpp.package.skeleton.

        - constructors can now take many more arguments.
        
    o   The 'Rcpp-modules' vignette was updated as well and describe many
        of the new features

    o   New template class Rcpp::SubMatrix and support syntax in Matrix
        to extract a submatrix: 
        
           NumericMatrix x = ... ;
        
           // extract the first three columns
           SubMatrix y = x( _ , Range(0,2) ) ; 
        
           // extract the first three rows
           SubMatrix y = x( Range(0,2), _ ) ; 
        
           // extract the top 3x3 sub matrix
           SubMatrix y = x( Range(0,2), Range(0,2) ) ; 

    o   Reference Classes no longer require a default constructor for
        subclasses of C++ classes    

    o   Consistently revert to using backticks rather than shell expansion
        to compute library file location when building packages against Rcpp
        on the default platforms; this has been applied to internal test
        packages as well as CRAN/BioC packages using Rcpp

Thanks to CRANberries, there is also a diff to the previous release 0.8.8:

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

/code/rcpp | permanent link

Fri, 26 Nov 2010

RcppArmadillo 0.2.10
Conrad Sanderson released version 1.0.0 of Armadillo, his templated C++ library for linear algebra, earlier this week. So congratulations to Conrad on reaching 1.0.0! I folded his version 1.0.0 into a new release 0.2.10 of RcppArmadillo, our Rcpp-based integration into R. Other small changes comprises a small fix to the build process, and additional output in the summary() function for the fastLm function.

The short NEWS file extract follows, also containing Conrad's entry for 1.0.0:

0.2.10  2010-11-25

    o   Upgraded to Armadillo 1.0.0 "Antipodean Antileech"

         * After 2 1/2 years of collaborative development, we are proud to
           release the 1.0 milestone version. 
         * Many thanks are extended to all contributors and bug reporters.

    o   R/RcppArmadillo.package.skeleton.R: Updated to no longer rely on GNU
        make for builds of packages using RcppArmadillo
 
    o   summary() for fastLm() objects now returns r.squared and adj.r.squared

And courtesy of CRANberries, here is the diff to the previous release 0.2.9:
 ChangeLog                                               |   17 ++++++++
 DESCRIPTION                                             |   25 +++++------
 R/RcppArmadillo.package.skeleton.R                      |    4 -
 R/fastLm.R                                              |   21 +++++++++
 inst/NEWS                                               |   13 ++++++
 inst/doc/RcppArmadillo-unitTests.pdf                    |binary
 inst/doc/unitTests-results/RcppArmadillo-unitTests.html |    6 +-
 inst/doc/unitTests-results/RcppArmadillo-unitTests.txt  |   34 ++++++++--------
 inst/include/armadillo_bits/arma_version.hpp            |   15 +++++--
 inst/skeleton/Makevars                                  |    2 
 src/Makevars                                            |    2 
 src/Makevars.win                                        |    2 
 12 files changed, 97 insertions(+), 44 deletions(-)

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Thu, 11 Nov 2010

RcppArmadillo 0.2.9
The new version 0.2.9 of RcppArmadillo has been uploaded to CRAN. The only change is an update of the included Armadillo template library to version 0.9.92 which Conrad released this week. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

The short NEWS file extract follows, also containing Conrad's entry for 0.9.92::

0.2.9   2010-11-11

    o   Upgraded to Armadillo 0.9.92 "Wall Street Gangster":

         * Fixes for compilation issues under the Intel C++ compiler
         * Added matrix norms

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Tue, 02 Nov 2010

Rcpp 0.8.8
A bug-fix release 0.8.8 of Rcpp is now available. It is awaiting processing at CRAN, and will be uploaded to Debian once processed at CRAN. In the meantime, sources are available from my local directory here.

This release follows on the heels of 0.8.7, but contains fixes for a few small things Romain and I had noticed over the last two weeks since releasing 0.8.7 and contains only a small number of new tweaks. The NEWS entry follows below:

0.8.8   2010-11-01

    o   New syntactic shortcut to extract rows and columns of a Matrix. 
        x(i,_) extracts the i-th row and x(_,i) extracts the i-th column. 
    
    o   Matrix indexing is more efficient. However, faster indexing is
        disabled if g++ 4.5.0 or later is used.

    o   A few new Rcpp operators such as cumsum, operator=(sugar)

    o   Variety of bug fixes:

        - column indexing was incorrect in some cases

        - compilation using clang/llvm (thanks to Karl Millar for the patch)

        - instantation order of Module corrected

        - POSIXct, POSIXt now correctly ordered for R 2.12.0 

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

/code/rcpp | permanent link

Sat, 16 Oct 2010

RcppArmadillo 0.2.8
Version 0.2.8 of RcppArmadillo is now on CRAN. This updates the included Armadillo template library to version 0.9.90 which Conrad released two few days ago. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

The short NEWS file extract follows, also containing Conrad's entry for 0.9.90::


    o   Upgraded to Armadillo 0.9.90 "Water Dragon":

         * Added unsafe_col()
         * Speedups and bugfixes in lu()
         * Minimisation of pedantic compiler warnings

    o   Switched NEWS and ChangeLog between inst/ and the top-level directory
        so that NEWS (this file) gets installed with the package

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 15 Oct 2010

Rcpp 0.8.7
With the scheduled R release of version 2.12.0 this morning, we have just uploaded version 0.8.7 of Rcpp to CRAN; Debian will follow shortly once the autobuilders have processed R 2.12.0

This Rcpp release depends on R 2.12.0 as two things have changed. First, we play along with change in R concerning the ordering of inheritance for time classes. But secondly, and more importantly, we support in Rcpp the corresponding change R itself which brings the new ReferenceClasses. Here is corresponding bit from R's NEWS file for R 2.12.0:

    o A facility for defining reference-based S4 classes (in the OOP
      style of Java, C++, etc.) has been added experimentally to
      package methods; see ?ReferenceClasses.

[...]

    o An experimental new programming model has been added to package
      methods for reference (OOP-style) classes and methods.  See
      ?ReferenceClasses.
This was made possible in large part by code committed by John Chambers (whom we had welcomed recently as a co-author to Rcpp) building on the changes he made to R 2.12.0 itself, as well on the work Romain had done with 'Rcpp Modules'. The R help page for ReferenceClasses carries a reference (bad pun) to Rcpp 0.8.7 so these two releases do go together. This should be a lot of fun over the next little while: S3, S4, and now ReferenceClasses.

We also made a number of internal changes some of which leads to speed-ups and internal improvement. The NEWS entry follows below:

0.8.7   2010-10-15

    o   As of this version, Rcpp depends on R 2.12 or greater as it interfaces 
        the new reference classes (see below) and also reflects the POSIXt class
        reordering both of which appeared with R version 2.12.0

    o   new Rcpp::Reference class, that allows internal manipulation of R 2.12.0
        reference classes. The class exposes a constructor that takes the name
        of the target reference class and a field(string) method that implements
        the proxy pattern to get/set reference fields using callbacks to the 
        R operators "$" and "$<-" in order to preserve the R-level encapsulation

    o   the R side of the preceding item allows methods to be written
        in R as per ?ReferenceClasses, accessing fields by name and
        assigning them using "<<-".  Classes extracted from modules
        are R reference classes.  They can be subclassed in R, and/or R methods
        can be defined using the $methods(...) mechanism.

    o   internal performance improvements for Rcpp sugar as well as an added
        'noNA()' wrapper to omit tests for NA values -- see the included
        examples in inst/examples/convolveBenchmarks for the speedups

    o   more internal performance gains with Functions and Environments

As always, even fuller details are in 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

/code/rcpp | permanent link

Sun, 26 Sep 2010

RcppArmadillo 0.2.7
Version 0.2.7 of RcppArmadillo is now on CRAN. This updates the included Armadillo template library to version 0.9.80 which Conrad released a few days ago. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

The short NEWS file extract follows, also containing Conrad's entry for 0.9.80::

0.2.7   2010-09-25

    o   Upgraded to Armadillo 0.9.80 "Chihuahua Muncher":

         * Added join_slices(), insert_slices(), shed_slices()
         * Added in-place operations on diagonals
         * Various speedups due to internal architecture improvements

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Mon, 13 Sep 2010

RcppArmadillo 0.2.6
Now that Rcpp got updated to 0.8.6, we have an updated RcppArmadillo release containing mostly updates to Conrad's Armadillo version 0.9.70 as well as some more templated sugar magic. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

The short NEWS file extract follows:

0.2.6   2010-09-12

    o   Upgraded to Armadillo 0.9.70 "Subtropical Winter Safari"
    
    o   arma::Mat, arma::Row and arma::Col get constructor that take vector
        or matrix sugar expressions. See the unit test "test.armadillo.sugar.ctor" 
        and "test.armadillo.sugar.matrix.ctor" for examples.

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Fri, 10 Sep 2010

Rcpp 0.8.6
After a somewhat longer than usual break, we now have a new release of Rcpp on CRAN and in Debian.

This release adds quite few things. The main one may be the addition of density, distribution, quantile and random number functions for a rather large number of statistical distribution. Usage is pretty much as it would be in R, yet it is vectorised at the C++ level. A fair number of unit tests were added too, but some work is left to do there too.
Support for complex number was enhanced both in the expressive 'sugar' context and via a few binary operators that had been missing. We also started a new vignette to provide a 'quick reference'; unfortunately this is not quite complete yet.

The NEWS entry follows below:

0.8.6   2010-09-09

    o	new macro RCPP_VERSION and Rcpp_Version to allow conditional compiling
        based on the version of Rcpp
    
           #if defined(RCPP_VERSION) && RCPP_VERSION >= Rcpp_Version(0,8,6)
           ...
           #endif

    o   new sugar functions for statistical distributions (d-p-q-r functions)
	with distributions : unif, norm, gamma, chisq, lnorm, weibull, logis,
	f, pois, binom, t, beta.

    o   new ctor for Vector taking size and function pointer so that for example

    	   NumericVector( 10, norm_rand )

	generates a N(0,1) vector of size 10

    o   added binary operators for complex numbers, as well as sugar support 

    o   more sugar math functions: sqrt, log, log10, exp, sin, cos, ...

    o	started new vignette Rcpp-quickref : quick reference guide of Rcpp API
        (still work in progress)

    o	various patches to comply with solaris/suncc stricter standards

    o	minor enhancements to ConvolutionBenchmark example

    o	simplified src/Makefile to no longer require GNU make; packages using
        Rcpp still do for the compile-time test of library locations
    

As always, even fuller details are in 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

/code/rcpp | permanent link

Thu, 05 Aug 2010

RcppArmadillo 0.2.5
Hot on the heels of RcppArmadillo release 0.2.4 a few days ago comes a new release 0.2.5 which is now on CRAN. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

This release upgrades the included Armadillo version to Conrad's just-released version 0.9.60. This overcomes some of minor issues we had with 'older' compilers such as g++ 4.2.x with x being 1 or 2. No other changes were made from our end.

The short NEWS file extract follows:

0.2.5   2010-08-05

    o   Upgraded to Armadillo 0.9.60 "Killer Bush Turkey"

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Mon, 02 Aug 2010

RcppExamples 0.1.1
On Friday, I quickly provided a new release of RcppExamples, our example package for using Rcpp, to CRAN. Very little content has been updated --- and a new TODO file even notes that we need to add more documentation for the new Rcpp API. And update existing documentation as lots has changed since the initial release in March.

But at least this package now joins RcppArmadillo is using the highly-recommened LinkingTo: Rcpp directive in the DESCRIPTION file to let R find the Rcpp headers, making the build process a little more robust.

A few more details on the page are on the RcppExamples page.

/code/rcpp | permanent link

Thu, 29 Jul 2010

RcppArmadillo 0.2.4
A new release of RcppArmadillo is now on CRAN. RcppArmadillo makes it easy to write highly efficient and highly readable C++ code for linear algebra (based on Armadillo) in R extensions (using Rcpp for the interface).

This release upgrades the included Armadillo version to 0.9.52 (see here for Conrad's high-level changes). We had to make two minor tweaks. In the fastLm() help page example we switched from inv() to pinv() The short NEWS file extract follows:

0.2.4   2010-07-27

    o   Upgraded to Armadillo 0.9.52 'Monkey Wrench'

    o   src/fastLm.cpp: Switch from inv() to pinv() as inv() now tests for
        singular matrices and warns and returns an empty matrix which stops
        the example fastLm() implementation on the manual page -- and while
        this is generally reasonably it makes sense here to continue which
        the Moore-Penrose pseudo-inverse allows us to do this

More information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

/code/rcpp | permanent link

Mon, 26 Jul 2010

Rcpp 0.8.5
A new release (now at version 0.8.5) of Rcpp is now on CRAN and in Debian.

This release constitutes a quick follow-up to the last release 0.8.4 which we got out just before CRAN closed for summer vacations. Some fixes were made right after last release: two harmless warnings from the help file parser of the development version of R are now addressed, and we stopped using shell expansions in the Makefile snippets. We also added to some internal speedups we discovered while prepapring the talk about RProtoBuf for last week's useR! meeting.

The NEWS entry follows below:

0.8.5   2010-07-25

    o   speed improvements. Vector::names, RObject::slot have been improved
        to take advantage of R API functions instead of callbacks to R

    o   Some small updates to the Rd-based documentation which now points to 
        content in the vignettes.  Also a small formatting change to suppress
        a warning from the development version of R.

    o   Minor changes to Date() code which may reenable SunStudio builds

As always, even fuller details are in 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

/code/rcpp | permanent link