3 #ifndef OSL_PATH_ENCODING_H 4 #define OSL_PATH_ENCODING_H 21 unsigned long long get(
size_t depth,
Square pos,
Ptype ptype)
const 23 return values[depth][pos.index()][ptype-
PTYPE_MIN];
28 unsigned long long get(
size_t depth,
Move m)
const 30 const Square from = m.from();
32 const Ptype fromPtype = m.oldPtype();
33 const Ptype toPtype = m.ptype();
35 return get(depth, from, fromPtype) +
get(depth, to, toPtype) + 1;
48 : path((turn ==
BLACK) ? 0 : 1), depth(d)
52 : path(org.path), depth(org.depth)
59 assert(m.
player() == turn());
60 path += Path_Encoding_Table.
get(depth, m);
66 path -= Path_Encoding_Table.
get(depth, m);
67 assert(m.
player() == turn());
69 unsigned long long getPath()
const {
return path; }
std::ostream & operator<<(std::ostream &os, Player player)
CArray< CArray2d< unsigned long long, Square::SIZE, PTYPE_SIZE >, MaxEncodingLength > array_t
unsigned long long getPath() const
PathEncodingTable Path_Encoding_Table
PathEncoding(Player turn, int d=0)
static const size_t MaxEncodingLength
PathEncoding(const PathEncoding &org, Move m)
bool operator==(Square l, Square r)
bool operator!=(Offset l, Offset r)
unsigned long long get(size_t depth, Square pos, Ptype ptype) const