Blog Archives

sugar in parallel

June 18, 2014
By
sugar in parallel

I've been playing with parallelising Rcpp11 implementation of sugar. For example, we have a NumericVector variable x and we want to compute e.g. sqrt(exp(x)) + 2.0. With sugar, we can do: NumericVector y = sqrt(exp(x)) + 2.0 ; and this does not...

Read more »

useR!2014 Rcpp11 tutorial

June 17, 2014
By

We are getting close to useR!2014. I hope I'll see some of you at my tutorial about Rcpp11 in the morning. There are some other pretty useful tutorials as well, so no hard feeling if you don't come, but if you do want to know about modern R and C++, pl...

Read more »

subset vectors in Rcpp11

June 7, 2014
By

Under the impulsion of @kevin_ushey who already did something similar for Rcpp, we've been adding subsetting behavior into Rcpp11. The idea is given a vector y and a vector x we want to give meaning to y. The first legitimate question is what kind of x do we want to allow. This has been discussed since...

Read more »

sapply with variadic trailing arguments (…)

May 28, 2014
By

Motivation In R, we can pass further arguments to sapply. The arguments are then passed the function to be applied over. x <- seq(-3, 3, by=.2 ) sapply( x, dnorm, 0, 4, FALSE ) Conceptually this does something like: sapply( x, function(.){ ...

Read more »

sapply with variadic trailing arguments (…)

May 27, 2014
By
sapply with variadic trailing arguments (…)

Motivation In R, we can pass further arguments to sapply. The arguments are then passed the function to be applied over. x <- seq(-3, 3, by=.2 ) sapply( x, dnorm, 0, 4, FALSE ) Conceptually this does something like: sapply( x, function(...

Read more »

Modernizing sugar in Rcpp11

May 27, 2014
By
Modernizing sugar in Rcpp11

I'm in the process of modernizing the implementation of sugar in Rcpp11. Previous work already improved performance of sugar by allowing sugar classes themselves to implement how to apply themselves into their target vector. For example the sugar cla...

Read more »

Disambiguating Rcpp11 and Rcpp

May 27, 2014
By

I pushed some code this morning to allow us to use this alternative syntax to use Rcpp11. #include <Rcpp11> using namespace Rcpp11 ; Of course the usual code will continue to work, and might even be preferable if you write code that needs to...

Read more »

Disambiguating Rcpp11 and Rcpp

May 27, 2014
By
Disambiguating Rcpp11 and Rcpp

I pushed some code this morning to allow us to use this alternative syntax to use Rcpp11. #include <Rcpp11> using namespace Rcpp11 ; Of course the usual code will continue to work, and might even be preferable if you write code that needs...

Read more »

Modernizing sugar in Rcpp11

May 26, 2014
By
Modernizing sugar in Rcpp11

I'm in the process of modernizing the implementation of sugar in Rcpp11. Previous work already improved performance of sugar by allowing sugar classes themselves to implement how to apply themselves into their target vector. For example the sugar class SeqLen leverages std::iota instead of a manual for loop. template <typename Target> inline...

Read more »

Vectorized vs Devectorized

May 24, 2014
By

This gist from @hadley has been on my mind for some time. This was already a follow up of this post from @johnmyleswhite. The problem was that sugar vectorised code suffered a performance penalty compared to devectorised code. This is particularly troubling me because the whole point of sugar is to have nice syntax without...

Read more »