21 enum {
DIM = 32 + 32 + 288 + 288 };
63 template <
class MakeEffectState>
65 template <
class MakeEffectState>
69 template <
class MakeEffectState>
80 return dir * 4 + state;
83 class King8EffectEmptySquareBoth;
84 template <
bool Opening>
114 template <
bool Opening>
186 template <osl::Player P>
188 template <osl::Player P>
225 template <osl::Player P>
265 const int x = king.
x();
266 return (x > 5 ? 9 - x : x - 1);;
271 const int x = king.
x();
272 const int y = (P ==
BLACK ? king.
y() : 10 - king.
y());
273 return (y - 1) * 5 + (x > 5 ? 9 - x : x - 1);
308 bool u_blocked,
bool opp_u_blocked,
bool opp_blocked)
319 else if (P ==
WHITE && x <= 4)
323 return x - 1 + 5 * ((is_l ? 1 : 0) + 2 * ((u_blocked ? 1 : 0) + 2 * ((opp_u_blocked ? 1 : 0) +2 * (opp_blocked ? 1 : 0))));
327 bool u_blocked,
bool opp_u_blocked,
331 const int y = (P ==
BLACK ? king.
y() : 10 - king.
y());
340 else if (P ==
WHITE && x <= 4)
344 return x - 1 + 5 * (y - 1 + 9 * ((is_l ? 1 : 0) + 2 * ((u_blocked ? 1 : 0) + 2 * ((opp_u_blocked ? 1 : 0) + 2 * (opp_blocked ? 1 : 0)))));
364 template <osl::Player Defense>
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
static MultiInt evalOne(const NumEffectState &state)
static void setUp(const Weights &weights, int stage)
static CArray< MultiInt, 4 > table
static int index(Square king, Square target)
static CArray< int, ONE_DIM > l_defense_piece_table
static CArray< int, ONE_DIM > d_defense_piece_table
static CArray< int, ONE_DIM > d_table
static CArray< int, ONE_DIM > u_table
static CArray< int, ONE_DIM > r_table
static CArray< int, ONE_DIM > u_defense_piece_table
static CArray< int, ONE_DIM > base_defense_piece_table
static CArray< int, ONE_DIM > r_defense_piece_table
static void setUp(const Weights &weights)
static int index(const Direction dir, EffectState state)
static CArray< int, ONE_DIM > l_table
static CArray< int, ONE_DIM > base_table
static void effectState(const NumEffectState &state, const Player defense, const Direction dir, EffectState &empty, EffectState &)
static const CArray< int, 2 > evalCommon(const NumEffectState &state, const table_t &)
static std::pair< CArray< int, 2 >, CArray< int, 2 > > evalWithUpdateCommon(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value_opening, const CArray< int, 2 > &last_value_ending, const table_t &, const table_t &)
CArray< int, 32 > table_t
static int index(const Direction dir, EffectState state)
static const CArray< int, 2 > evalWithUpdateCommon(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value, const table_t &)
static std::pair< CArray< int, 2 >, CArray< int, 2 > > evalWithUpdate(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value_opening, const CArray< int, 2 > &last_value_ending)
static const CArray< int, 2 > evalWithUpdate(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value)
static void setUp(const Weights &weights)
static CArray< int, 32 > table
static const CArray< int, 2 > eval(const NumEffectState &state)
static std::pair< CArray< int, 2 >, CArray< int, 2 > > evalWithUpdate(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value_opening, const CArray< int, 2 > &last_value_ending)
static const CArray< int, 2 > eval(const NumEffectState &state)
static const CArray< int, 2 > evalWithUpdate(const NumEffectState &new_state, Move last_move, const CArray< int, 2 > &last_value)
static void setUp(const Weights &weights)
static CArray< int, 32 > defense_table
static int indexY(Piece king, const Direction dir, EffectState state)
static CArray< int, 288 > empty_y_table
static CArray< int, 32 > empty_table
static void setUp(const Weights &weights)
static int index(const Direction dir, EffectState state)
static void effectState(const NumEffectState &state, const Player defense, const Direction dir, EffectState &empty, EffectState &)
static CArray< int, 288 > defense_y_table
static void setUp(const Weights &weights)
static CArray< MultiInt, 80 > table
static CArray< MultiInt, 720 > y_table
static void setUp(const Weights &weights)
static void adjust(int index_y, MultiInt &result)
static int indexY(const Square king, bool is_l, bool u_blocked, bool opp_u_blocked, bool opp_blocked)
static int index(const Square king, bool is_l, bool u_blocked, bool opp_u_blocked, bool opp_blocked)
static void evalWithUpdateBang(const NumEffectState &new_state, Move last_move, MultiIntPair &last_values_and_out)
CArray< MultiInt, 90 > table_t
static void evalWithUpdateBang(const NumEffectState &state, Move laste_move, MultiIntPair &last_values_and_out)
static int index(Square king, int diff)
static const MultiIntPair eval(const NumEffectState &state, const table_t &table)
static void adjust(int index, int index_y, MultiInt &out)
static const MultiIntPair eval(const NumEffectState &state)
static void setUp(const Weights &weights, int stage)
static MultiIntPair eval(const NumEffectState &state)
static void setUp(const Weights &weights, int stage)
static CArray< MultiInt, ONE_DIM > table
static void setUp(const Weights &weights)
static void adjust(int index, int index_y, MultiInt &out)
static int indexY(const Square king)
static CArray< MultiInt, ONE_DIM > table
static void setUp(const Weights &weights)
static int index(const Square king)
CArray< MultiInt, 10 > table_t
static bool isBlocked(const NumEffectState &state, int diff)
static int index(Square king, int diff)
static const MultiIntPair eval(const NumEffectState &state, const table_t &table)