-}
-
-
-/// TranspositionTable::extract_pv() extends a PV by adding moves from the
-/// transposition table at the end. This should ensure that the PV is almost
-/// always at least two plies long, which is important, because otherwise we
-/// will often get single-move PVs when the search stops while failing high,
-/// and a single-move PV means that we don't have a ponder move.
-
-void TranspositionTable::extract_pv(const Position& pos, Move pv[]) {
-
- int ply;
- Position p(pos);
- StateInfo st[100];
-
- for (ply = 0; pv[ply] != MOVE_NONE; ply++)
- p.do_move(pv[ply], st[ply]);
-
- bool stop;
- const TTEntry* tte;
- for (stop = false, tte = retrieve(p.get_key());
- tte && tte->move() != MOVE_NONE && !stop;
- tte = retrieve(p.get_key()), ply++)
- {
- if (!move_is_legal(p, tte->move()))
- break;
- pv[ply] = tte->move();
- p.do_move(pv[ply], st[ply]);
- for (int j = 0; j < ply; j++)
- if (st[j].key == p.get_key()) stop = true;
- }
- pv[ply] = MOVE_NONE;
-}
-
-
-/// TranspositionTable::full() returns the permill of all transposition table
-/// entries which have received at least one write during the current search.
-/// It is used to display the "info hashfull ..." information in UCI.
-
-int TranspositionTable::full() const {
-
- double N = double(size) * ClusterSize;
- return int(1000 * (1 - exp(writes * log(1.0 - 1.0/N))));