peclet-morton 1.0.2
Fast Morton (Z-order) codes with O(1) arithmetic
Loading...
Searching...
No Matches
morton::detail Namespace Reference

Classes

struct  uint_for
 
struct  wide_uint
 Fixed-width unsigned integer of. More...
 

Typedefs

template<unsigned NBits>
using uint_for_t = typename uint_for< NBits >::type
 
using uint128_t = unsigned __int128
 The built-in 128-bit unsigned, used for 65..128-bit codes.
 

Functions

template<unsigned Dim, unsigned Bits>
MORTON_HD Morton< Dim, Bits >::code_type bigmin (typename Morton< Dim, Bits >::code_type zmin, typename Morton< Dim, Bits >::code_type zmax, typename Morton< Dim, Bits >::code_type z)
 
template<unsigned Dim, unsigned Bits>
MORTON_HD void litmax_bigmin (typename Morton< Dim, Bits >::code_type zmin, typename Morton< Dim, Bits >::code_type zmax, typename Morton< Dim, Bits >::code_type z, typename Morton< Dim, Bits >::code_type &litmax, typename Morton< Dim, Bits >::code_type &bigmin)
 
MORTON_HD constexpr bool is_consteval () noexcept
 
MORTON_HD constexpr unsigned pow3 (unsigned n)
 
template<unsigned Dim, unsigned Bits, typename Code >
MORTON_HD constexpr Code axis_mask (unsigned d)
 
template<unsigned Dim, unsigned Bits, typename Code , typename Coord >
MORTON_HD constexpr Code spread_sw (Coord x, unsigned d)
 
template<unsigned Dim, unsigned Bits, typename Code , typename Coord >
MORTON_HD constexpr Coord compact_sw (Code c, unsigned d)
 

Typedef Documentation

◆ uint_for_t

template<unsigned NBits>
using morton::detail::uint_for_t = typedef typename uint_for<NBits>::type

◆ uint128_t

using morton::detail::uint128_t = typedef unsigned __int128

The built-in 128-bit unsigned, used for 65..128-bit codes.

__extension__ suppresses the "ISO C++ does not support '__int128'" diagnostic that GCC and Clang emit under -Wpedantic: __int128 is a compiler extension, and this is the standard portable way to say "yes, deliberately" so that consumers compiling with -Wpedantic get a clean build. It changes nothing about the type or the generated code — spelling every other use of the built-in through this alias keeps the whole library quiet.

Function Documentation

◆ bigmin()

template<unsigned Dim, unsigned Bits>
MORTON_HD Morton< Dim, Bits >::code_type morton::detail::bigmin ( typename Morton< Dim, Bits >::code_type  zmin,
typename Morton< Dim, Bits >::code_type  zmax,
typename Morton< Dim, Bits >::code_type  z 
)

◆ litmax_bigmin()

template<unsigned Dim, unsigned Bits>
MORTON_HD void morton::detail::litmax_bigmin ( typename Morton< Dim, Bits >::code_type  zmin,
typename Morton< Dim, Bits >::code_type  zmax,
typename Morton< Dim, Bits >::code_type  z,
typename Morton< Dim, Bits >::code_type &  litmax,
typename Morton< Dim, Bits >::code_type &  bigmin 
)

◆ is_consteval()

MORTON_HD constexpr bool morton::detail::is_consteval ( )
constexprnoexcept

◆ pow3()

MORTON_HD constexpr unsigned morton::detail::pow3 ( unsigned  n)
constexpr

◆ axis_mask()

template<unsigned Dim, unsigned Bits, typename Code >
MORTON_HD constexpr Code morton::detail::axis_mask ( unsigned  d)
constexpr

◆ spread_sw()

template<unsigned Dim, unsigned Bits, typename Code , typename Coord >
MORTON_HD constexpr Code morton::detail::spread_sw ( Coord  x,
unsigned  d 
)
constexpr

◆ compact_sw()

template<unsigned Dim, unsigned Bits, typename Code , typename Coord >
MORTON_HD constexpr Coord morton::detail::compact_sw ( Code  c,
unsigned  d 
)
constexpr