Skip to content

snsinfu/cxx-ziggurat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ziggurat normal random number generator

C++11 Build Status Boost License

Header-only C++ library of a fast normal random number generator implementing the ziggurat algorithm.

Usage

Download and include ziggurat.hpp. The header defines cxx::ziggurat_normal_distribution<T> class template. It can be used as a replacement for std::normal_distribution.

#include <iostream>
#include <random>
#include <ziggurat.hpp>

int main()
{
    std::mt19937_64 random;
    cxx::ziggurat_normal_distribution<double> normal{1.2, 0.8};
    std::cout << normal(random) << '\n';
}

Testing

git clone https://github.com/snsinfu/cxx-ziggurat
cd cxx-ziggurat/tests
make

License

Boost Software License, Version 1.0.

Releases

No releases published

Packages

No packages published