hp
hashed-permutation
cargo install hashed-permutation
hp

hashed-permutation

An implementation of Kensler's hashed permutation algorithm

by Afnan Enayet

3.0.1 (see all)License:MIT
cargo install hashed-permutation
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.

GitHub Stars

16

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
3.0.1
2yrs ago
3.0.0
2yrs ago
2.2.0
2yrs ago
2.1.1
3yrs ago
No alternatives found
No tutorials found
Add a tutorial