Skip to content

lemire/cpp_batched_random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Batched Random

VS17-CI Ubuntu CI

Fast shuffling functions using batched random index generation.

This project contains a single header batched_random.h. It defines a single template function batched_random::shuffle which can serve as a drop-in replacement for std::shuffle when the random number generator produces 64-bit integers (e.g., std::mt19937_64). It can be significantly faster than the standard std::shuffle in many cases. We include tests and benchmarks.

Reference

Usage

For Linux and macOS:

cmake -B build
cmake --build build
ctest --test-dir build
./build/benchmark

For Windows:

cmake -B build
cmake --build build --config Release
ctest --test-dir build -C Release
./build/Release/benchmark

About

Fast shuffling functions using batched random index generation in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published