Mod3Entries
Declared in astar/PatternDatabase.h; the same class on the site of Doxygen.
-
class Mod3Entries
the entries of a pattern table, the distance modulo 3, five in a byte
The byte holds \( \sum_{j < 5} x_j 3^j \) for the residues \( x_j \) of five consecutive ranks, i.e., \( 8 / 5 = 1.6 \) bits per entry (Breyer and Korf, AAAI 2010). The value of a placement is not stored: it is that of a neighbour plus the difference of the residues [see AdditivePDB::delta()], or it is found from the residues alone by a descent to the goal [see PatternTable::exact()]; both need a table whose neighbours differ by at most one, i.e., with the blank ignored.
Public Functions
-
inline int residue(std::uint64_t r, int) const noexcept
the residue modulo 3 of the distance of the rank r, whose placement has Manhattan distance m
-
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 Mod3Entries encode(const std::vector<std::uint8_t> &h, M&&, unsigned = 1) the encoding of the distances h
-
static inline Mod3Entries decode(std::vector<std::uint8_t> data, std::uint64_t n, unsigned = 1)
the encoding of n entries read from a file
-
inline int residue(std::uint64_t r, int) const noexcept