ParityBitEntries

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

class ParityBitEntries

the entries of a pattern table, the second bit of the distance, eight in a byte

With the blank ignored, every move of the abstraction costs 1 and changes the Manhattan distance m of the pattern by one unit, so that the distance h has the parity of m and two neighbours differ by exactly one; hence the bit \( \lfloor h / 2 \rfloor \bmod 2 \) and the parity of m give h modulo 4, which tells \( +1 \) from \( -1 \). This is the 1-bit encoding of Clausecker and Reinefeld (SoCS 2019); like Mod3Entries, its values are relative [see Mod3Entries].

Public Functions

inline int residue(std::uint64_t r, int m) const noexcept

the residue modulo 4 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 ParityBitEntries encode(
const std::vector<std::uint8_t> &h,
M &&m,
unsigned = 1
)

the encoding of the distances h

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

the encoding of n entries read from a file

Public Static Attributes

static constexpr std::uint32_t code = 6

the code in a file

static constexpr const char *name = "bit"

the name

static constexpr bool relative = true

relative values

static constexpr int modulus = 4

values modulo 4