![]() |
BitBully 0.0.39
|
#include <TranspositionTable.hpp>
Public Member Functions | |
void | reset () |
void | put (key_t key, value_t value) |
value_t | get (key_t key) const override |
Transposition Table is a simple hash map with fixed storage size. In case of collision we keep the last entry and overide the previous one. We keep only part of the key to reduce storage, but no error is possible thanks to Chinese theorem.
The number of stored entries is a power of two that is defined at compile time. We also define size of the entries and keys to allow optimization at compile time.
key_size: number of bits of the key value_size: number of bits of the value log_size: base 2 log of the size of the Transposition Table. The table will contain 2^log_size elements
Definition at line 94 of file TranspositionTable.hpp.
|
inline |
Definition at line 111 of file TranspositionTable.hpp.
|
inline |
Definition at line 117 of file TranspositionTable.hpp.
|
inlineoverridevirtual |
Get the value of a key
key | must be less than key_size bits. |
Implements GameSolver::Connect4::TableGetter< key_t, value_t >.
Definition at line 146 of file TranspositionTable.hpp.
|
inline |
Store a value for a given key
key | must be less than key_size bits. |
value | must be less than value_size bits. null (0) value is used to encode missing data |
Definition at line 135 of file TranspositionTable.hpp.
|
inline |
Empty the Transition Table.
Definition at line 125 of file TranspositionTable.hpp.