PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
NibbleEntries Class Reference

the entries of a pattern table, 4 bits each: the excess over Manhattan More...

#include <PBeFS/astar/PatternDatabase.h>

Public Member Functions

int value (std::uint64_t r, int m) const noexcept
 the value of the rank r, whose placement has Manhattan distance m
std::uint64_t clamped (void) const noexcept
 the entries saturated at the encoding
std::uint64_t entries (void) const noexcept
 the number of the entries
std::size_t bytes (void) const noexcept
 the bytes of the entries
std::vector< std::uint8_t > payload (void) const
 the bytes written in a file

Static Public Member Functions

template<class M>
static NibbleEntries encode (const std::vector< std::uint8_t > &h, M &&m, unsigned=1)
 the encoding of the distances h
static NibbleEntries decode (std::vector< std::uint8_t > data, std::uint64_t n, unsigned=1)
 the encoding of n entries read from a file
static int excess (int h, int m)
 the excess ( h - m ) / 2, checked to be a nonnegative integer

Static Public Attributes

static constexpr std::uint32_t code = 2
 the code in a file
static constexpr const char * name = "nibble"
 the name
static constexpr bool relative = false
 absolute values

Detailed Description

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.

Member Function Documentation

◆ bytes()

std::size_t bytes ( void ) const
inlinenodiscardnoexcept

the bytes of the entries

◆ clamped()

std::uint64_t clamped ( void ) const
inlinenodiscardnoexcept

the entries saturated at the encoding

◆ decode()

NibbleEntries decode ( std::vector< std::uint8_t > data,
std::uint64_t n,
unsigned = 1 )
inlinestaticnodiscard

the encoding of n entries read from a file

◆ encode()

template<class M>
NibbleEntries encode ( const std::vector< std::uint8_t > & h,
M && m,
unsigned = 1 )
inlinestaticnodiscard

the encoding of the distances h

◆ entries()

std::uint64_t entries ( void ) const
inlinenodiscardnoexcept

the number of the entries

◆ excess()

int excess ( int h,
int m )
inlinestaticnodiscard

the excess ( h - m ) / 2, checked to be a nonnegative integer

◆ payload()

std::vector< std::uint8_t > payload ( void ) const
inlinenodiscard

the bytes written in a file

◆ value()

int value ( std::uint64_t r,
int m ) const
inlinenodiscardnoexcept

the value of the rank r, whose placement has Manhattan distance m

Member Data Documentation

◆ code

std::uint32_t code = 2
staticconstexpr

the code in a file

◆ name

const char* name = "nibble"
staticconstexpr

the name

◆ relative

bool relative = false
staticconstexpr

absolute values


The documentation for this class was generated from the following file: