bigramKillerMove.h
Go to the documentation of this file.
00001 /* bigramKillerMove.h
00002  */
00003 #ifndef _BIGRAMKILLERMOVETABLE_H
00004 #define _BIGRAMKILLERMOVETABLE_H
00005 
00006 #include "osl/search/lRUMoves.h"
00007 #include "osl/state/numEffectState.h"
00008 #include "osl/misc/carray2d.h"
00009 #include "osl/container/moveVector.h"
00010 #include <cstddef>
00011 #include <cassert>
00012 namespace osl
00013 {
00014   namespace search
00015   {
00019     class BigramKillerMove
00020     {
00021     private:
00022       CArray2d<LRUMoves,Square::SIZE,PTYPEO_SIZE> killer_moves;
00023     public:
00024       BigramKillerMove();
00025       ~BigramKillerMove();
00026       void clear();
00027       void setMove(Move key, Move value)
00028       {
00029         if (value.isPass())
00030           return;
00031         if (key.to() == value.to())
00032           return;               // takeback は読みそう
00033         assert(value.isValid());
00034         assert(key.player() != value.player());
00035         killer_moves[key.to().index()][ptypeOIndex(key.ptypeO())].setMove(value);
00036       }
00037       const LRUMoves& operator[](Move key) const
00038       {
00039         return killer_moves[key.to().index()][ptypeOIndex(key.ptypeO())];
00040       }
00041       void getMove(const NumEffectState& state, Move last_move,
00042                    MoveVector& moves) const;
00043       void dump() const;
00044     };
00045   } // namespace search
00046 } // namespace osl
00047 
00048 #endif /* _BIGRAMKILLERMOVETABLE_H */
00049 // ;;; Local Variables:
00050 // ;;; mode:c++
00051 // ;;; c-basic-offset:2
00052 // ;;; coding:utf-8
00053 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines