hashed-permutation

Crates.iohashed-permutation
lib.rshashed-permutation
version3.0.2
sourcesrc
created_at2019-09-09 04:11:48.84763
updated_at2020-12-26 22:41:34.314271
descriptionA fast, instant-access way to permute a range of numbers
homepage
repositoryhttps://github.com/afnanenayet/hashed-permutation.git
max_upload_size
id163430
size19,713
Afnan Enayet (afnanenayet)

documentation

README

hashed-permutation

Build Status crates badge Documentation License

Synopsis

This is an implementation of Andrew Kensler's hashed permutation, which allows you to take an array of the elements [0 ... n) and shuffle it with no memory overhead and very little computational overhead. This works by using a clever hash function to effectively permute all of the elements in the array.

Basically, you get a nearly free method to shuffle a bunch of numbers that doesn't require you to allocate a vector of size n, letting you sample the set without replacement.

You can find the paper here: https://graphics.pixar.com/library/MultiJitteredSampling/paper.pdf. I have a little writeup of how the algorithm works here, and Timothy Hobbs made a nice writeup explaining how to use the library itself here.

Commit count: 56

cargo fmt