2 Glaurung, a UCI chess playing engine.
3 Copyright (C) 2004-2008 Tord Romstad
5 Glaurung is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 Glaurung is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #if !defined(TT_H_INCLUDED)
36 /// The TTEntry class is the class of transposition table entries.
42 TTEntry(Key k, Value v, ValueType t, Depth d, Move m, int generation);
47 ValueType type() const;
48 int generation() const;
58 /// The transposition table class. This is basically just a huge array
59 /// containing TTEntry objects, and a few methods for writing new entries
60 /// and reading new ones.
62 class TranspositionTable {
65 TranspositionTable(unsigned mbSize);
66 ~TranspositionTable();
67 void set_size(unsigned mbSize);
69 void store(const Position &pos, Value v, Depth d, Move m, ValueType type);
70 bool retrieve(const Position &pos, Value *value, Depth *d, Move *move,
71 ValueType *type) const;
73 void insert_pv(const Position &pos, Move pv[]);
85 //// Constants and variables
88 // Default transposition table size, in megabytes:
89 const int TTDefaultSize = 32;
92 #endif // !defined(TT_H_INCLUDED)