killerMoveTable.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
killerMoveTable.h
Go to the documentation of this file.
1 /* killerMoveTable.h
2 */
3 #ifndef OSL_KILLERMOVETABLE_H
4 #define OSL_KILLERMOVETABLE_H
5
6 #include "osl/search/lRUMoves.h"
7 #include "osl/container/moveVector.h"
8 #include "osl/state/numEffectState.h"
9 #include <cstddef>
10 #include <cassert>
11 namespace osl
12 {
13 namespace search
14 {
22 class KillerMoveTable
23 {
24 public:
25 static const int KillerMoveMax = 64;
26 private:
27 CArray<LRUMoves,KillerMoveMax> killer_moves;
28 public:
29 KillerMoveTable();
30 ~KillerMoveTable();
31 void clear();
32 void setMove(size_t depth, const Move& move)
33 {
34 assert(move.isValid());
35 killer_moves[depth].setMove(move);
36 }
37 void getMove(const NumEffectState& state, size_t depth,
38 MoveVector& out) const
39 {
40 const LRUMoves& moves = killer_moves[depth];
41 for (size_t i=0; i<moves.size(); ++i)
42 {
43 Move m;
44 {
45 m = moves[i];
46 }
47 if (! m.isNormal())
48 return;
49 if (state.isAlmostValidMove<false>(m))
50 out.push_back(m);
51 }
52 }
53 };
54 } // namespace search
55 } // namespace osl
56
57 #endif /* OSL_KILLERMOVETABLE_H */
58 // ;;; Local Variables:
59 // ;;; mode:c++
60 // ;;; c-basic-offset:2
61 // ;;; End: