MinNibbleEntries

Declared in astar/PatternDatabase.h; the same class on the site of Doxygen.

class MinNibbleEntries

the entries of a pattern table, the least excess of each group of ranks

The ranks are grouped by c consecutive ones, c a power of 2, and the group stores the least excess over Manhattan of its placements in 4 bits, saturated at 15, i.e., \( 4 / c \) bits per entry: the lossy compression of Felner, Korf, Meshulam and Holte (JAIR 2007), which here keeps the Manhattan distance of each placement. The value is at most the exact one, hence admissible, but a table so compressed is not consistent in general. Consecutive ranks differ in the cell of the last tile of the pattern only, so that a group holds placements that are close.

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 entries(void) const noexcept

the number of the entries

inline unsigned group(void) const noexcept

the ranks per group

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 MinNibbleEntries encode(
const std::vector<std::uint8_t> &h,
M &&m,
unsigned c = 1
)

the encoding of the distances h, by groups of c ranks

static inline MinNibbleEntries decode(std::vector<std::uint8_t> data, std::uint64_t n, unsigned c = 1)

the encoding of n entries read from a file

Public Static Attributes

static constexpr std::uint32_t code = 4

the code in a file

static constexpr const char *name = "min"

the name

static constexpr bool relative = false

absolute values