Sobol-Burley

Latest Release Documentation

A seedable Owen-scrambled Sobol sequence based on the paper Practical Hash-based Owen Scrambling by Brent Burley, with an improved hash from Building a Better LK Hash, and a larger set of direction vectors due to Kuo et al.

This crate is geared towards use in practical graphics applications, and as such has some limitations:

These are all trade-offs made for better performance and smaller code size.

This crate also currently targets SIMD execution on the x86-64 architecture, which is why it always calculates 4 dimensions at a time. It will still compile and run just fine on any architecture, but will be notably slower due to not utilizing SIMD.

Expanding this crate to be more general, both in application and target architectures, is a goal for the future. However, efficient execution for graphics applications will always be the top priority.

Basic usage

Basic usage is pretty straightforward. The first parameter of sample_4d() is the index of the sample you want, and the second parameter is the index of the set (of four) dimensions you want. Everything is zero-indexed.

```rust // The first eight dimensions of sample 1, as two 4-element arrays. let sample1set1 = sample4d(0, 0, 0); // Dimensions 1-4. let sample1set2 = sample4d(0, 1, 0); // Dimensions 5-8.

// Print the first two dimension. println!("Sample-1 dimension-1: {}", sample1set1[0]); println!("Sample-1 dimension-2: {}", sample1set1[1]);

// The first eight dimensions of sample 2. let sample2set1 = sample4d(1, 0, 0); // Dimensions 1-4. let sample2set2 = sample4d(1, 1, 0); // Dimensions 5-8. ```

If all you want is a standard Owen-scrambled Sobol sequence, then that's all you need.

For more advanced usage, including how to use the third parameter and how to get around the 256-dimension limit, see the crate documentation.

License

Main code:

Copyright (c) 2021 Nathan Vegdahl

This project is licensed under either of

at your option.

Direction numbers and build.rs code:

The Sobol direction numbers under direction_numbers/ and some of the code in build.rs (demarcated by comments) is adapted from work by Stephen Joe and Frances Y. Kuo, and is under the 3-clause BSD license.

See licenses/JOE_KUO.txt for details.

Contributing

Contributions are absolutely welcome! Please keep in mind that this crate aims to be:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you will be licensed as above (MIT/Apache dual-license), without any additional terms or conditions.