Parallel Pseudo Random Number Generator (PPRNG) 'sitmo' Header Files

Provided within is a high quality and fast PPRNG that is able to be used in an 'OpenMP' parallel environment compiled under either C++98 or C++11. The objective of this package release is to consolidate the distribution of the 'sitmo' library on CRAN by enabling others to link to the 'sitmo' header file instead of including a copy of 'sitmo' within their individual package. Lastly, the package contains example implementations using 'sitmo' and three accompanying vignette that provide additional information.

The repository houses the sitmo R package for Parallel Psuedo Random Number Generation (PPRNG). The package provides a way to obtain the sitmo header files via LinkTo.

Installing & Using sitmo

sitmo is currently only available on GitHub, but should also be available on CRAN shortly. To install the package, you must first have a compiler on your system that is compatible with R.

For help on obtaining a compiler consult:

With a compiler in hand, one can then install the package from GitHub by:


To use sitmo in your R package, modify the DESCRIPTION file by adding:

LinkingTo: Rcpp, sitmo
    Rcpp (>= 0.12.3)

To use C++11's statistical distributions, you may want to add the following to your src/Makevars and src/ file:


Within the C++ file, then add:

Example use

Below is a hello world example meant to show a basic implementation of sitmo.

#include <Rcpp.h>
#include <random>  // C++11 RNG library 
#include <sitmo.h> // SITMO PPRNG 
// [[Rcpp::export]] 
Rcpp::NumericVector sitmo_draws(unsigned int n) {
  Rcpp::NumericVector o(n);
  // Create a prng engine 
  sitmo::prng_engine eng;
  // Draw from base engine 
  for (unsigned int i=0; i< n ; ++i){
    o(i) = eng();  
  return o;


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.2.2 by James Balamuta, 2 months ago,,

Report a bug at

Browse source code at

Authors: James Balamuta [aut, cre, cph], Thijs van den Berg [aut, cph]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports Rcpp

Suggests knitr, rmarkdown, ggplot2

Linking to Rcpp

Linked to by bssm.

See at CRAN