NibbleEntries
Declared in astar/PatternDatabase.h; the same class on the site of Doxygen.
-
class NibbleEntries
the entries of a pattern table, 4 bits each: the excess over Manhattan
The excess e = ( h - m ) / 2 is stored, saturated at 15; a saturated entry gives a smaller value, still admissible, and clamped() counts them at the encoding.
Public Functions
-
inline int value(std::uint64_t r, int m) const noexcept
the value of the rank r, whose placement has Manhattan distance m
-
inline std::uint64_t clamped(void) const noexcept
the entries saturated at the encoding
-
inline std::uint64_t entries(void) const noexcept
the number of the entries
-
inline std::size_t bytes(void) const noexcept
the bytes of the entries
-
inline std::vector<std::uint8_t> payload(void) const
the bytes written in a file
Public Static Functions
-
template<class M>
static inline NibbleEntries encode(const std::vector<std::uint8_t> &h, M &&m, unsigned = 1) the encoding of the distances h
-
static inline NibbleEntries decode(std::vector<std::uint8_t> data, std::uint64_t n, unsigned = 1)
the encoding of n entries read from a file
-
static inline int excess(int h, int m)
the excess ( h - m ) / 2, checked to be a nonnegative integer
-
inline int value(std::uint64_t r, int m) const noexcept