Blog Archives

RcppMLPACK2 and the MLPACK Machine Learning Library

February 19, 2017
By
RcppMLPACK2 and the MLPACK Machine Learning Library

mlpack mlpack is, to quote, a scalable machine learning library, written in C++, that aims to provide fast, extensible implementations of cutting-edge machine learning algorithms. It has been written by Ryan Curtin and others, and is described in two ...

Read more »

Using Rcpp with C++11, C++14 and C++17

February 18, 2017
By
Using Rcpp with C++11, C++14 and C++17

Background When we started the Rcpp Gallery in late 2012, a few of us spent the next four weeks diligently writing articles ensuring that at least one new article would be posted per day. Two early articles covered the then-budding support for C++11. ...

Read more »

Using Armadillo with SuperLU

February 17, 2017
By
Using Armadillo with SuperLU

Armadillo is very versatile C++ library for linear algebra, brough to R via the RcppArmadillo package. It has proven to be very useful and popular, and is (as of February 2017) used by well over 300 CRAN packages as indicated by the reverse depends / ...

Read more »

RcppHoney Introduction

July 25, 2016
By
RcppHoney Introduction

Rationale In C++ we often have containers that are not compatible with R or Rcpp with data already in them (std::vector, std::set, etc.). One would like to be able to operate on these containers without having to copy them into Rcpp structures like I...

Read more »

Rcpp::algorithm

June 24, 2016
By
Rcpp::algorithm

Introduction A while back I saw a post on StackOverflow where the user was trying to use Rcpp::sugar::sum() on an RcppParallel::RVector. Obviously this doesn’t work and it raised the question “Why doesn’t something more generic exist to provide functions with R semantics that can be used on arbitrary data structures?” As a result, I set out to create a set of...

Read more »

Custom Templated as and wrap Functions within Rcpp.

June 24, 2016
By
Custom Templated as and wrap Functions within Rcpp.

Introduction Consider a need to be able to interface with a data type that is not presently supported by Rcpp. The data type might come from a new library or from within ones own program. In such cases, Rcpp is faced with an issue of consciousness as the new data type is not similar to known types so the autocoversion...

Read more »

Working with Rcpp::StringVector

June 22, 2016
By
Working with Rcpp::StringVector

Vectors are fundamental containers in R. This makes them equally important in Rcpp. Vectors can be useful for storing multiple elements of a common class (e.g., integer, numeric, character). In Rcpp, vectors come in the form of NumericVector, CharacterVector, LogicalVector, StringVector and more. Look in the header file Rcpp/include/Rcpp/vector/instantiation.h for more types. Here we explore how to work with Rcpp::StringVector as a way to...

Read more »

Optimizing Code vs Recognizing Patterns with 3D Arrays

June 7, 2016
By
Optimizing Code vs Recognizing Patterns with 3D Arrays

Intro As is the case with the majority of posts normally born into existence, there was an interesting problem that arose on recently on StackOverflow. Steffen, a scientist at an unnamed weather service, faced an issue with the amount of computational time required by his triple loop in R. Specifically, Steffen needed to be able to sum over...

Read more »

Hierarchical Risk Parity Implementation in Rcpp and OpenMP

May 26, 2016
By
Hierarchical Risk Parity Implementation in Rcpp and OpenMP

Summary Recently, there has been a new research paper coming out with the goal of improving Markowitz’s Critical Line Algorithm (CLA) published by Marcos Lopez de Prado. The methodology is also currently patent pending and the paper can be downloaded here. The methodology suggested by the paper proposes the Hierarchical Risk Parity (HRP) approach. The HRP approach aims at...

Read more »

SIMD Map-Reduction with RcppNT2

February 1, 2016
By
SIMD Map-Reduction with RcppNT2

Introduction The Numerical Template Toolbox (NT2) collection of header-only C++ libraries that make it possible to explicitly request the use of SIMD instructions when possible, while falling back to regular scalar operations when not. NT2 itself is powered by Boost, alongside two proposed Boost libraries – Boost.Dispatch, which provides a mechanism for efficient tag-based dispatch for functions, and Boost.SIMD, which provides a framework for the implementation of...

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)