Template Class spatial_hash< std::array< T, N >, std::enable_if_t< std::is_arithmetic_v< T >, void > >

Class Documentation

template<class T, std::size_t N>
class spatial_hash<std::array<T, N>, std::enable_if_t<std::is_arithmetic_v<T>, void>>

Specialization for arrays.

Public Types

using resolution_in_each_axis_t = std::array<double, N>

Type that represents the resolution in each axis.

Public Functions

inline explicit spatial_hash(const resolution_in_each_axis_t &resolution)

Constructs a spatial hasher from an std::array of doubles.

Parameters:

resolution – std::array of doubles containing resolution for each index of the array to be hashed, with matching indices. I.e: array[0] will be hashed with resolution[0].

inline constexpr std::size_t operator()(const std::array<T, N> &array) const

Calculates the array hash, with the resolutions in each axis, given at construction time.

Parameters:

array – Array to be hashed.

Returns:

The calculated hash.