All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
bigramKillerMove.h
Go to the documentation of this file.
1 /* bigramKillerMove.h
2  */
3 #ifndef _BIGRAMKILLERMOVETABLE_H
4 #define _BIGRAMKILLERMOVETABLE_H
5 
6 #include "osl/search/lRUMoves.h"
8 #include "osl/misc/carray2d.h"
10 #include <cstddef>
11 #include <cassert>
12 namespace osl
13 {
14  namespace search
15  {
20  {
21  private:
22  CArray2d<LRUMoves,Square::SIZE,PTYPEO_SIZE> killer_moves;
23  public:
26  void clear();
27  void setMove(Move key, Move value)
28  {
29  if (value.isPass())
30  return;
31  if (key.to() == value.to())
32  return; // takeback は読みそう
33  assert(value.isValid());
34  assert(key.player() != value.player());
35  killer_moves[key.to().index()][ptypeOIndex(key.ptypeO())].setMove(value);
36  }
37  const LRUMoves& operator[](Move key) const
38  {
39  return killer_moves[key.to().index()][ptypeOIndex(key.ptypeO())];
40  }
41  void getMove(const NumEffectState& state, Move last_move,
42  MoveVector& moves) const;
43  void dump() const;
44  };
45  } // namespace search
46 } // namespace osl
47 
48 #endif /* _BIGRAMKILLERMOVETABLE_H */
49 // ;;; Local Variables:
50 // ;;; mode:c++
51 // ;;; c-basic-offset:2
52 // ;;; coding:utf-8
53 // ;;; End: