-}
-
-
-/// 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() {
-
- double N = double(size) * 4.0;
- return int(1000 * (1 - exp(writes * log(1.0 - 1.0/N))));
-}
-
-
-/// Constructors
-
-TTEntry::TTEntry() {
-}
-
-TTEntry::TTEntry(Key k, Value v, ValueType t, Depth d, Move m,
- int generation) {
- key_ = k;
- data = (m & 0x7FFFF) | (t << 20) | (generation << 23);
- value_ = v;
- depth_ = int16_t(d);
-}
-
-
-/// Functions for extracting data from TTEntry objects.
-
-inline Key TTEntry::key() const {
- return key_;
-}
-
-inline Depth TTEntry::depth() const {
- return Depth(depth_);
-}
-
-inline Move TTEntry::move() const {
- return Move(data & 0x7FFFF);
-}
-
-inline Value TTEntry::value() const {
- return Value(value_);
-}
-
-inline ValueType TTEntry::type() const {
- return ValueType((data >> 20) & 3);
-}
-
-inline int TTEntry::generation() const {
- return (data >> 23);