1 #ifndef _OPENING_BOOK_H 2 #define _OPENING_BOOK_H 21 (from.
x() << 4 | from.
y()));
23 (to.
x() << 12 | to.
y() << 8));
24 value = (bitFrom | bitTo |
27 static_cast<unsigned int>(m.
ptype()) << 24 |
28 static_cast<int>(m.
player()) << 28);
31 if ((
value & 0xff) == 0)
37 if (((
value >> 8) & 0xff) == 0)
44 return static_cast<Ptype>((
value >> 20) & 0xf);
47 return static_cast<Ptype>((
value >> 24) & 0xf);
55 operator int() {
return value; }
89 int winCount(
int stateIndex);
90 int loseCount(
int stateIndex);
91 std::vector<OBMove> moves(
int stateIndex);
94 void seek(
int offset);
118 struct WMoveSort :
public std::binary_function<WMove, WMove, bool>
184 WMoveContainer moves(
int stateIndex,
const bool zero_include =
true);
185 int whiteWinCount(
int stateIndex);
186 int blackWinCount(
int stateIndex);
197 std::vector<int> parents(
const int stateIndex);
210 const bool visit_zero =
true,
220 int stateIndex(
const std::vector<Move>& moves);
222 void seek(
int offset);
223 static const int HEADER_SIZE = 16;
224 static const int STATE_SIZE = 16;
225 static const int MOVE_SIZE = 12;
226 static const int BOARD_SIZE = 41 * 4;
232 #endif // _OPENING_BOOK_H
std::ostream & operator<<(std::ostream &os, const CompactBoard &c)
bool operator()(const WMove &l, const WMove &r) const
void setWeight(const int w)
WMoveのWeightとMoveによるsort.
int y() const
将棋としてのY座標を返す.
bool operator==(const CompactBoard &, const CompactBoard &)
局面を比較する.
int x() const
将棋としてのX座標を返す.
std::istream & operator>>(std::istream &os, CompactBoard &c)
const Square from() const
bool operator()(const WMove &l, const WMove &r) const
std::vector< WMove > WMoveContainer
int readInt(std::istream &is)
Ptype capturePtype() const
SimpleStateよりcompactな局面の表現
bool isPieceStand() const
bool operator()(const WMove &l, const WMove &r) const
static const Square STAND()