Antkeeper  0.0.1
Classes | Typedefs
math::hash Namespace Reference

Hash functions. More...

Classes

struct  make_uint
 Provides an unsigned integer type of equivalent size to type T. More...
 
struct  make_uint< float >
 Provides an unsigned integer type of equivalent size to float. More...
 
struct  make_uint< double >
 Provides an unsigned integer type of equivalent size to double. More...
 

Typedefs

template<class T >
using make_uint_t = typename make_uint< T >::type
 Helper type for make_uint. More...
 

Functions

constexpr std::uint8_t pcg (std::uint8_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint16_t pcg (std::uint16_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint32_t pcg (std::uint32_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint64_t pcg (std::uint64_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint8_t pcg (std::int8_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint16_t pcg (std::int16_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint32_t pcg (std::int32_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint64_t pcg (std::int64_t x) noexcept
 PCG hash function. More...
 
constexpr std::uint32_t pcg (float x) noexcept
 PCG hash function. More...
 
constexpr std::uint64_t pcg (double x) noexcept
 PCG hash function. More...
 
template<class T , std::size_t N>
constexpr vector< make_uint_t< T >, N > pcg (const vector< T, N > &x) noexcept
 PCG hash function. More...
 

Detailed Description

Hash functions.

Typedef Documentation

◆ make_uint_t

template<class T >
using math::hash::make_uint_t = typedef typename make_uint<T>::type

Helper type for make_uint.

Definition at line 63 of file make-uint.hpp.

Function Documentation

◆ pcg() [1/11]

template<class T , std::size_t N>
constexpr vector<make_uint_t<T>, N> math::hash::pcg ( const vector< T, N > &  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 232 of file pcg.hpp.

◆ pcg() [2/11]

constexpr std::uint64_t math::hash::pcg ( double  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 226 of file pcg.hpp.

◆ pcg() [3/11]

constexpr std::uint32_t math::hash::pcg ( float  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 221 of file pcg.hpp.

◆ pcg() [4/11]

constexpr std::uint16_t math::hash::pcg ( std::int16_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 206 of file pcg.hpp.

◆ pcg() [5/11]

constexpr std::uint32_t math::hash::pcg ( std::int32_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 211 of file pcg.hpp.

◆ pcg() [6/11]

constexpr std::uint64_t math::hash::pcg ( std::int64_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 216 of file pcg.hpp.

◆ pcg() [7/11]

constexpr std::uint8_t math::hash::pcg ( std::int8_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 201 of file pcg.hpp.

◆ pcg() [8/11]

constexpr std::uint16_t math::hash::pcg ( std::uint16_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 186 of file pcg.hpp.

◆ pcg() [9/11]

constexpr std::uint32_t math::hash::pcg ( std::uint32_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 191 of file pcg.hpp.

◆ pcg() [10/11]

constexpr std::uint64_t math::hash::pcg ( std::uint64_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 196 of file pcg.hpp.

◆ pcg() [11/11]

constexpr std::uint8_t math::hash::pcg ( std::uint8_t  x)
inlineconstexprnoexcept

PCG hash function.

Parameters
xInput value.
Returns
Unsigned pseudorandom output value.
Warning
Floating point and signed input values will be converted to unsigned integers via static_cast.
Vectors with more than 4 elements are not supported.
See also
https://en.wikipedia.org/wiki/Permuted_congruential_generator
O'Neill, M.E. (2014). PCG : A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering, Journal of Computer Graphics Techniques (JCGT), vol. 9, no. 3, 21-38, 2020.

Definition at line 181 of file pcg.hpp.