11#ifndef EBGEOMETRY_SFC_HPP
12#define EBGEOMETRY_SFC_HPP
55using Index = std::array<unsigned int, 3>;
61static constexpr unsigned int ValidBits = 21;
66static constexpr Code ValidSpan = (
static_cast<uint64_t>(1) << ValidBits) - 1;
95 0x1fffff, 0x1f00000000ffff, 0x1f0000ff0000ff, 0x100f00f00f00f00f, 0x10c30c30c30c30c3, 0x1249249249249249};
184template <
class Curve = Morton,
class T>
185[[
nodiscard]]
inline std::vector<uint32_t>
192#include "EBGeometry_SFCImplem.hpp"
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
std::vector< uint32_t > order(const std::vector< Vec3T< T > > &a_points) noexcept
Return the index permutation that orders a_points along a space-filling curve.
std::array< unsigned int, 3 > Index
Alias for 3D cell index.
Definition EBGeometry_SFC.hpp:55
std::vector< Index > computeBins(const std::vector< Vec3T< T > > &a_points) noexcept
Bin a set of points into the space-filling curve's integer grid, normalizing by their own bounding ra...
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31
Implementation of the 3D Hilbert space-filling curve.
Definition EBGeometry_SFC.hpp:134
static Index decode(const uint64_t &a_code) noexcept
Decode the linear Hilbert distance back into an Index.
static uint64_t encode(const Index &a_point) noexcept
Encode the input point into the linear Hilbert distance.
Implementation of the Morton SFC.
Definition EBGeometry_SFC.hpp:72
static Index decode(const uint64_t &a_code) noexcept
Decode the 64-bit Morton code into an Index.
static constexpr uint_fast64_t Mask_64[6]
Mask for magic-bits encoding of 3D Morton code.
Definition EBGeometry_SFC.hpp:94
static uint64_t encode(const Index &a_point) noexcept
Encode an input point into a Morton index with a 64-bit representation.
Implementation of a nested index SFC.
Definition EBGeometry_SFC.hpp:103
static Index decode(const uint64_t &a_code) noexcept
Decode the 64-bit SFC code into an Index.
static uint64_t encode(const Index &a_point) noexcept
Encode the input point into the SFC code.