MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/CompactNSearch / z_value

Function z_value

src/CompactNSearch.cpp:18–29  ·  view source on GitHub ↗

Determines Morten value according to z-curve.

Source from the content-addressed store, hash-verified

16{
17// Determines Morten value according to z-curve.
18inline uint_fast64_t
19z_value(HashKey const& key)
20{
21 return morton3D_64_encode(
22 static_cast<uint_fast32_t>(static_cast<int64_t>(key.k[0]) -
23 (std::numeric_limits<int>::lowest() + 1)),
24 static_cast<uint_fast32_t>(static_cast<int64_t>(key.k[1]) -
25 (std::numeric_limits<int>::lowest() + 1)),
26 static_cast<uint_fast32_t>(static_cast<int64_t>(key.k[2]) -
27 (std::numeric_limits<int>::lowest() + 1))
28 );
29}
30}
31
32

Callers 1

z_sortMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected