kingTable.h
Go to the documentation of this file.
/* kingTable.h
*/
#ifndef EVAL_ML_KINGTABLE_H
#define EVAL_ML_KINGTABLE_H
#include "osl/eval/weights.h"
#include "osl/eval/midgame.h"
#include "osl/numEffectState.h"
#include <cstdlib>
namespace osl
{
namespace eval
{
namespace ml
{
struct KingPieceRelative
{
typedef CArray2d<MultiInt, PTYPE_SIZE, 17 * 9> table_t;
static table_t attack_table, defense_table;
static int index(const NumEffectState &,
Player owner,
const Square position,
Square king)
{
return std::abs(position.x() - king.x()) * 17 +
(owner == BLACK ? (king.y() - position.y()) :
(position.y() - king.y())) + 8;
}
static int index(const NumEffectState &state,
Player owner,
const Square position,
bool same_king)
{
const Square king = state.kingSquare(
same_king ? owner : alt(owner));
return index(state, owner, position, king);
}
static int index(const NumEffectState &state,
PtypeO ptypeo,
const Square position,
bool same_king)
{
return index(state, getOwner(ptypeo), position, same_king);
}
static int index(const NumEffectState &state,
const Piece piece,
bool same_king)
{
return index(state, piece.owner(), piece.square(), same_king);
}
enum { DIM = ((osl::PTYPE_MAX - osl::PTYPE_PIECE_MIN + 1) *
(17 * 9)) * 2};
enum { TABLE_DIM = DIM / 2};
static void setUp(const Weights &weights, int stage);
static MultiInt eval(const NumEffectState &state);
template<Player P>
static MultiInt evalWithUpdate(const NumEffectState &state, Move moved,
const MultiInt& last_values);
};
class KingPieceRelativeNoSupport
{
public:
enum { ONE_DIM = 4284, DIM = ONE_DIM * EvalStages };
static MultiInt eval(const NumEffectState &state);
static MultiInt evalWithUpdate(
const NumEffectState &state,
Move moved,
const CArray<PieceMask, 2> &effected_mask,
const MultiInt &last_values);
static void setUp(const Weights &weights);
template <int Sign>
static void adjust(int attack, int defense, MultiInt& out);
private:
static int index(const Player player, const Square king,
const Ptype ptype, const Square pos)
{
const int x = std::abs(pos.x() - king.x());
const int y = (king.y() - pos.y()) *
(player == osl::BLACK ? 1 : -1) + 8;
return (ptype - osl::PTYPE_PIECE_MIN) * 17 * 9 + (x * 17 + y);
}
static int index(const Player player, const Square king,
const Piece piece)
{
return index(player, king, piece.ptype(), piece.square());
}
static CArray<MultiInt, ONE_DIM> table;
};
struct PtypeYY
{
enum { ONE_DIM = 2592, DIM = ONE_DIM * EvalStages};
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state);
static MultiInt evalWithUpdate(
const NumEffectState& state,
Move moved,
const MultiInt &last_values);
static CArray<MultiInt, 2592> table;
template <int Sign>
static void adjust(int black, int white, MultiInt &out);
private:
template <Player KingPlayer>
static int index(const Piece p, const Square king)
{
return index<KingPlayer>(p.ptypeO(), p.square(), king);
}
template <Player KingPlayer>
static int index(const PtypeO ptypeO, const Square position,
const Square king)
{
const int king_y = (KingPlayer == BLACK ? king.y() : 10 - king.y());
const int piece_y = (KingPlayer == BLACK ? position.y() :
10 - position.y());
return (king_y - 1) * 9 * 32 + (piece_y - 1) * 32 +
(KingPlayer == BLACK ? ptypeO : alt(ptypeO)) - PTYPEO_MIN;
}
};
class King25Effect
{
private:
static void countEffectAndPieces(const NumEffectState &state,
const Player attack,
int &effect,
int &piece);
static int index(int effect, int piece_count);
public:
enum { DIM = 17 * 128 };
static CArray<int, DIM> table;
static void setUp(const Weights &weights);
static int eval(const NumEffectState &state);
};
class King25EffectBoth
{
private:
static int index(int effect, int piece_count)
{
return effect + 128 * piece_count;
}
public:
template <Player Attack>
static void countEffectAndPiecesBoth(
const NumEffectState &state,
PieceMask& effect25,
PieceMask& effect_supported,
int &attack_effect,
int &attack_piece,
int &defense_effect,
int &defence_piece,
int &attack_piece_supported,
CArray<int, 5> &effect_vertical,
CArray<int, 5> &king_vertical);
enum { DIM = 17 * 128 * 2};
static CArray<int, DIM/2> attack_table;
static CArray<int, DIM/2> defense_table;
static void setUp(const Weights &weights);
static int eval(const NumEffectState &,
int black_attack_effect, int black_attack_piece,
int white_attack_effect, int white_attack_piece,
int black_defense_effect, int black_defense_piece,
int white_defense_effect, int white_defense_piece)
{
return attack_table[index(black_attack_effect, black_attack_piece)] -
attack_table[index(white_attack_effect, white_attack_piece)] +
defense_table[index(black_defense_effect, black_defense_piece)] -
defense_table[index(white_defense_effect, white_defense_piece)];
}
};
class King25EffectAttack
{
private:
static int index(int effect, int piece_count)
{
return effect + 128 * piece_count;
}
public:
enum { DIM = 17 * 128};
static CArray<int, 17 * 128> table;
static void setUp(const Weights &weights)
{
for (size_t i = 0; i < weights.dimension(); ++i)
{
table[i] = weights.value(i);
}
}
static int eval(const NumEffectState &,
int black_effect, int black_piece,
int white_effect, int white_piece)
{
return table[index(black_effect, black_piece)] -
table[index(white_effect, white_piece)];
}
};
class King25EffectDefense
{
private:
static int index(int effect, int piece_count)
{
return effect + 128 * piece_count;
}
public:
enum { DIM = 17 * 128};
static CArray<MultiInt, 17 * 128> table;
static void setUp(const Weights &weights,int stage)
{
for (size_t i = 0; i < weights.dimension(); ++i)
{
table[i][stage] = weights.value(i);
}
}
static MultiInt eval(const NumEffectState &,
int black_effect, int black_piece,
int white_effect, int white_piece)
{
return table[index(black_effect, black_piece)] -
table[index(white_effect, white_piece)];
}
};
class King25EffectYAttack
{
private:
static int index(int king_y, int effect, int piece_count)
{
return effect + 128 * piece_count + (king_y - 1) * 128 * 17;
}
public:
enum { DIM = 17 * 128 * 9};
static CArray<int, 17 * 128 * 9> table;
static void setUp(const Weights &weights)
{
for (size_t i = 0; i < weights.dimension(); ++i)
{
table[i] = weights.value(i);
}
}
static int eval(const NumEffectState &state,
int black_effect, int black_piece,
int white_effect, int white_piece)
{
// ugly hack. -1 is attack. 0 >= is defense
return table[index(10 - state.kingSquare<WHITE>().y(),
black_effect, black_piece)] -
table[index(state.kingSquare<BLACK>().y(),
white_effect, white_piece)];
}
};
class King25EffectYDefense
{
private:
static int index(int king_y, int effect, int piece_count)
{
return effect + 128 * piece_count + (king_y - 1) * 128 * 17;
}
public:
enum { DIM = 17 * 128 * 9};
static CArray<MultiInt, 17 * 128 * 9> table;
static void setUp(const Weights &weights,int stage)
{
for (size_t i = 0; i < weights.dimension(); ++i)
{
table[i][stage] = weights.value(i);
}
}
static MultiInt eval(const NumEffectState &state,
int black_effect, int black_piece,
int white_effect, int white_piece)
{
return table[index(state.kingSquare<BLACK>().y(),
black_effect, black_piece)] -
table[index(10 - state.kingSquare<WHITE>().y(),
white_effect, white_piece)];
}
};
class King25EffectY
{
public:
enum { DIM = 17 * 128 * 2 * 9};
private:
static int index(int king_y, int effect, int piece_count)
{
return effect + 128 * piece_count + (king_y - 1) * 128 * 17;
}
static CArray<int, DIM/2> attack_table;
static CArray<int, DIM/2> defense_table;
public:
static void setUp(const Weights &weights);
static int eval(const NumEffectState &state,
int black_attack_effect, int black_attack_piece,
int white_attack_effect, int white_attack_piece,
int black_defense_effect, int black_defense_piece,
int white_defense_effect, int white_defense_piece)
{
return attack_table[index(10 - state.kingSquare<WHITE>().y(),
black_attack_effect, black_attack_piece)] -
attack_table[index(state.kingSquare<BLACK>().y(),
white_attack_effect, white_attack_piece)] +
defense_table[index(state.kingSquare<BLACK>().y(),
black_defense_effect, black_defense_piece)] -
defense_table[index(10 - state.kingSquare<WHITE>().y(),
white_defense_effect, white_defense_piece)];
}
};
class King25Effect2
{
public:
enum { ONE_DIM = 17 * 13 * 64, DIM = ONE_DIM * EvalStages };
private:
static int index(int effect, int piece_count,
int stand_count)
{
return (effect + 64 * piece_count) * 13 + stand_count;
}
static CArray<MultiInt, ONE_DIM> table;
public:
static void setUp(const Weights &weights);
static MultiInt eval(
const NumEffectState &,
int black_attack_effect, int black_attack_piece,
int white_attack_effect, int white_attack_piece,
int black_stand_count, int white_stand_count)
{
const int black_index = index(black_attack_effect,
black_attack_piece,
black_stand_count);
const int white_index = index(white_attack_effect,
white_attack_piece,
white_stand_count);
return table[black_index] - table[white_index];
}
};
class King25EffectY2
{
public:
enum { ONE_DIM = 17 * 13 * 64 * 9, DIM = ONE_DIM * EvalStages };
private:
static int index(int king_y, int effect, int piece_count,
int stand_count)
{
return ((effect + 64 * piece_count) * 13 + stand_count) * 9 +
(king_y - 1);
}
static CArray<MultiInt, ONE_DIM> table;
public:
static void setUp(const Weights &weights);
static MultiInt eval(
const NumEffectState &state,
int black_attack_effect, int black_attack_piece,
int white_attack_effect, int white_attack_piece,
int black_stand_count, int white_stand_count)
{
const int black_index = index(10 - state.kingSquare<WHITE>().y(),
black_attack_effect, black_attack_piece,
black_stand_count);
const int white_index = index(state.kingSquare<BLACK>().y(),
white_attack_effect, white_attack_piece,
white_stand_count);
return table[black_index] - table[white_index];
}
};
class King25EffectSupported
{
public:
enum { ONE_DIM = 17 * 17, DIM = ONE_DIM * EvalStages };
private:
static int index(int piece_count, int supported)
{
return supported * 17 + piece_count;
}
static CArray<MultiInt, ONE_DIM> table;
public:
static void setUp(const Weights &weights);
static MultiInt eval(
int black_attack_piece,
int white_attack_piece,
int black_attack_supported_piece, int white_attack_supported_piece)
{
const int black_index = index(black_attack_piece,
black_attack_supported_piece);
const int white_index = index(white_attack_piece,
white_attack_supported_piece);
return table[black_index] - table[white_index];
}
};
class King25EffectSupportedY
{
public:
enum { ONE_DIM = 17 * 17 * 9, DIM = ONE_DIM * EvalStages };
private:
static int index(int piece_count, int supported, int y)
{
return (supported * 17 + piece_count) * 9 + y - 1;
}
static CArray<MultiInt, ONE_DIM> table;
public:
static void setUp(const Weights &weights);
static MultiInt eval(
int black_attack_piece,
int white_attack_piece,
int black_attack_supported_piece, int white_attack_supported_piece,
int black_king_y, int white_king_y)
{
const int black_index = index(black_attack_piece,
black_attack_supported_piece,
10 - white_king_y);
const int white_index = index(white_attack_piece,
white_attack_supported_piece,
black_king_y);
return table[black_index] - table[white_index];
}
};
struct King25EmptySquareNoEffect
{
enum { DIM = 3 * 5 };
template <Player defense>
static int evalOne(const NumEffectState &state, const CArray<int, 15>& table);
template <Player defense>
static std::pair<int,int> evalOne(const NumEffectState &state, const CArray<int, 15>& opening, const CArray<int, 15>& ending);
static std::pair<CArray<int,2>, CArray<int,2> >
eval(const NumEffectState &state, const CArray<int, 15>& opening, const CArray<int, 15>& ending);
static std::pair<CArray<int,2>, CArray<int,2> >
evalWithUpdate(const NumEffectState &state, Move last_move,
const CArray<int, 15>& opening, const CArray<int, 15>& ending,
const CArray<int,2>& last_opening_value, const CArray<int,2>& last_ending_value);
static int index(int rel_x, int rel_y)
{
return (rel_y + 2) * 3 + std::abs(rel_x);
}
static void setUpBase(const Weights &weigths, CArray<int, 15>& table);
};
class King25EmptySquareNoEffectOpening
: public King25EmptySquareNoEffect
{
static CArray<int, 15> table;
public:
static void setUp(const Weights &weigths) { setUpBase(weigths, table); }
static const CArray<int,2> eval(const NumEffectState &state);
static const CArray<int, 15>& weights() { return table; }
};
class King25EmptySquareNoEffectEnding
: public King25EmptySquareNoEffect
{
static CArray<int, 15> table;
public:
static void setUp(const Weights &weigths) { setUpBase(weigths, table); }
static const CArray<int,2> eval(const NumEffectState &state);
static const CArray<int, 15>& weights() { return table; }
};
template <bool Opening>
class King25EmptyAbs
{
public:
enum { DIM = 5 * 5 * 5 * 9 };
private:
static CArray<int, 1125> table;
template <Player player>
static int index(Square king,
Square target);
static int index(Square king,
Square target, Player player) {
if (player == BLACK)
return index<BLACK>(king, target);
else
return index<WHITE>(king, target);
}
template <Player Defense>
static int evalOne(const NumEffectState &state);
public:
static int evalWithUpdate(
const NumEffectState &state, osl::Move moved,
int last_value);
static void setUp(const Weights &weigths);
static int eval(const NumEffectState &state);
};
class King25EmptyAbsOpening : public King25EmptyAbs<true>
{
};
class King25EmptyAbsEnding : public King25EmptyAbs<false>
{
};
enum EffectState
{
NO_ATTACK_DEFENSE_0,
NO_ATTACK_DEFENSE_1,
NO_ATTACK_DEFENSE_2,
ATTACK_DIFF_N2,
ATTACK_DIFF_N1,
ATTACK_DIFF_0,
ATTACK_DIFF_1,
ATTACK_DIFF_2,
STATE_MAX, // 8
};
template <int Stage>
class King25EffectEach
{
public:
enum { DIM = 5 * 3 * STATE_MAX * 3 };
private:
static CArray<int, 5 * 3 * 8 * 3> table;
template <Player Defense>
static EffectState effectState(const NumEffectState &state,
Square target);
template <Player Defense>
static int index(const NumEffectState &state, Square king,
Square target);
template <osl::Player Defense>
static int evalOne(const NumEffectState &state);
public:
static void setUp(const Weights &weigths);
static int eval(const NumEffectState &state);
};
class King25EffectEachOpening : public King25EffectEach<0>
{
};
class King25EffectEachMidgame : public King25EffectEach<1>
{
};
class King25EffectEachEnding : public King25EffectEach<2>
{
};
class King25EffectEachBothOpening
{
public:
enum { DIM = 5 * 3 * STATE_MAX * 3 };
static void setUp(const Weights &weigths);
};
class King25EffectEachBothMidgame
{
public:
enum { DIM = 5 * 3 * STATE_MAX * 3 };
static void setUp(const Weights &weigths);
};
class King25EffectEachBothMidgame2
{
public:
enum { DIM = 5 * 3 * STATE_MAX * 3 };
static void setUp(const Weights &weigths);
};
class King25EffectEachBothEnding
{
public:
enum { DIM = 5 * 3 * STATE_MAX * 3 };
static void setUp(const Weights &weigths);
};
class King25EffectEachBoth
{
enum EffectState
{
NO_ATTACK_DEFENSE_0,
NO_ATTACK_DEFENSE_1,
NO_ATTACK_DEFENSE_2,
ATTACK_DIFF_N2,
ATTACK_DIFF_N1,
ATTACK_DIFF_0,
ATTACK_DIFF_1,
ATTACK_DIFF_2,
STATE_MAX, // 8
};
friend class King25EffectEachBothOpening;
friend class King25EffectEachBothMidgame;
friend class King25EffectEachBothMidgame2;
friend class King25EffectEachBothEnding;
friend class King25EffectEachXY;
friend class King25EffectEachKXY;
private:
static CArray<MultiInt, 5 * 3 * 8 * 3> table;
static CArray<MultiInt, 3000> x_table;
static CArray<MultiInt, 3240> y_table;
static CArray<MultiInt, 27000> xy_table;
static CArray<int, 256> effect_state_table;
template <Player Defense>
static int effectStateIndex3(const NumEffectState &state,
Square target);
template <Player Defense>
static void index(const NumEffectState &state,
Square target,
int &index_xy,
int rel_y, int king_x, int king_y, int x_diff
);
template <osl::Player Defense>
static void evalOne(const NumEffectState &state,
MultiInt& out);
public:
static void eval(const NumEffectState &state,
MultiIntPair &out);
static void
evalWithUpdate(const NumEffectState &state, Move last_move,
MultiIntPair & values);
};
class King25EffectEachXY
{
public:
enum { X_DIM = 3000, Y_DIM = 3240, DIM = (X_DIM + Y_DIM) * EvalStages};
static void setUp(const Weights &weigths);
};
class King25EffectEachKXY
{
public:
enum { ONE_DIM = 27000, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weigths);
};
class King3Pieces
{
friend class King3PiecesXY;
public:
enum { ONE_DIM = 3072, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state);
static MultiInt evalWithUpdate(const NumEffectState &state,
Move last_move,
MultiInt &last_value);
private:
enum Direction
{
HORIZONTAL = 0,
VERTICAL,
DIAGONAL,
};
template <Player King, Direction Dir>
static int index(PtypeO p1, PtypeO p2)
{
if (King == WHITE)
{
p1 = altIfPiece(p1);
p2 = altIfPiece(p2);
}
return ptypeOIndex(p1) * 32 + ptypeOIndex(p2) + 1024 * Dir;
}
template <Player King, Direction Dir>
static int indexY(const Square king_position,
PtypeO p1, PtypeO p2)
{
if (King == WHITE)
{
p1 = altIfPiece(p1);
p2 = altIfPiece(p2);
}
const int king_y = (King == BLACK ? king_position.y() :
10 - king_position.y());
return ptypeOIndex(p1) * 32 + ptypeOIndex(p2) + 1024 * Dir
+ (king_y - 1) * 32 * 32 * 3;
}
template <Player King, Direction Dir>
static int indexX(const Square king_position,
PtypeO p1, PtypeO p2)
{
if (King == WHITE)
{
p1 = altIfPiece(p1);
p2 = altIfPiece(p2);
}
const int king_x = (king_position.x() > 5 ? 10 - king_position.x() :
king_position.x());
if (Dir == HORIZONTAL &&
((King == BLACK && king_position.x() >= 6) ||
(King == WHITE && king_position.x() <= 4)))
{
PtypeO tmp = p1;
p1 = p2; p2 = tmp;
}
return ptypeOIndex(p1) * 32 + ptypeOIndex(p2) + 1024 * Dir
+ (king_x - 1) * 32 * 32 * 3;
}
static MultiInt value(int vertical_index, int horizontal_index,
int diagonal_index1, int diagonal_index2,
int vertical_index_x, int horizontal_index_x,
int diagonal_index1_x, int diagonal_index2_x,
int vertical_index_y , int horizontal_index_y,
int diagonal_index1_y, int diagonal_index2_y)
{
return table[vertical_index] + table[horizontal_index] +
table[diagonal_index1] + table[diagonal_index2] +
x_table[vertical_index_x] + x_table[horizontal_index_x] +
x_table[diagonal_index1_x] + x_table[diagonal_index2_x] +
y_table[vertical_index_y] + y_table[horizontal_index_y] +
y_table[diagonal_index1_y] + y_table[diagonal_index2_y];
}
template <Player King>
static void evalOne(const NumEffectState &state,
MultiInt &result);
static CArray<MultiInt, 3072> table;
static CArray<MultiInt, 15360> x_table;
static CArray<MultiInt, 27648> y_table;
};
class King3PiecesXY
{
public:
enum
{
X_DIM = 32 * 32 * 3 * 5,
Y_DIM = 32 * 32 * 3 * 9,
ONE_DIM = X_DIM + Y_DIM,
DIM = ONE_DIM * EvalStages,
};
static void setUp(const Weights &weights);
};
class KingMobility
{
friend class KingMobilityWithRook;
friend class KingMobilityWithBishop;
public:
enum { ONE_DIM = 3240, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state);
private:
template <Player P>
static MultiInt evalOne(const NumEffectState &state);
template<Direction Dir>
static int mobilityDir(Square king,Square target)
{
if(Dir==L) return king.x()-target.x()-1;
else if(Dir==R) return target.x()-king.x()-1;
else if(Dir==UL || Dir==U || Dir==UR) return target.y()-king.y()-1;
else return king.y()-target.y()-1;
}
static CArray<MultiInt, 3240> table;
static CArray<MultiInt, 3240> rook_table;
static CArray<MultiInt, 3240> bishop_table;
static CArray<MultiInt, 3240> rook_bishop_table;
};
class KingMobilityWithRook
{
public:
enum { ONE_DIM = 3240, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class KingMobilityWithBishop
{
public:
enum { ONE_DIM = 3240, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class KingMobilitySum
{
public:
enum { ONE_DIM = 2925, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state);
private:
template <Player P>
static MultiInt evalOne(const NumEffectState &state);
static CArray<MultiInt, 45*33> table;
};
class King25BothSide
{
friend class King25BothSideX;
friend class King25BothSideY;
public:
enum { ONE_DIM = 8192, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
template<Player P>
static MultiInt evalOne(const NumEffectState &state,
const CArray<int, 5> &effects);
static MultiInt eval(const NumEffectState &state,
const CArray<int, 5> &black,
const CArray<int, 5> &white);
private:
static int index(int effect1, int effect2, int i)
{
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return effect1 + 32 * (effect2 + 32 * i);
}
template <Player P>
static int indexX(Square king, int effect1, int effect2,
int i, int j)
{
const int king_x = (king.x() >= 6 ? 10 - king.x() : king.x());
if ((P == BLACK && king.x() > 5) ||
(P == WHITE && king.x() < 5))
{
const int tmp = effect1;
effect1 = effect2;
effect2 = tmp;
const int tmp2 = i;
i = 4 - j;
j = 4 - tmp2;
}
if (i == 2)
--j;
const int combination = (i * 3 + j - 2);
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return king_x - 1 + 5 * (effect1 + 32 *
(effect2 + 32 * combination));
}
static int indexX(int king_x,int effect1,int effect2, int i){
return king_x - 1 + 5 * (effect1 + 32 *
(effect2 + 32 * i));
}
template <Player P>
static int indexY(Square king, int effect1, int effect2, int i)
{
const int king_y = (P == BLACK ? king.y() : 10 - king.y());
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return king_y - 1 + 9 *(effect1 + 32 * (effect2 + 32 * i));
}
static int indexY(int king_y,int effect1,int effect2, int i){
return king_y - 1 + 9 *(effect1 + 32 * (effect2 + 32 * i));
}
static CArray<MultiInt, 8192> table;
static CArray<MultiInt, 40960> x_table;
static CArray<MultiInt, 73728> y_table;
};
class King25BothSideX
{
public:
enum { ONE_DIM = 40960, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class King25BothSideY
{
public:
enum { ONE_DIM = 73728, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class King25Mobility
{
friend class King25MobilityX;
friend class King25MobilityY;
public:
enum { ONE_DIM = 4096, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state,
const CArray<int, 5> &black,
const CArray<int, 5> &white);
private:
static int index(int effect1, int effect2, int i)
{
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return effect1 + 32 * (effect2 + 32 * i);
}
template <Player Defense>
static int indexX(Square king, int effect1, int effect2, int i)
{
const int king_x = (king.x() > 5 ? 10 - king.x() : king.x());
if ((Defense == BLACK && king.x() > 5) ||
(Defense == WHITE && king.x() < 5))
{
const int tmp = effect1;
effect1 = effect2;
effect2 = tmp;
i = 3 - i;
}
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return king_x - 1 + 5 * (effect1 + 32 * (effect2 + 32 * i));
}
template <Player Defense>
static int indexY(Square king, int effect1, int effect2, int i)
{
const int king_y = (Defense == BLACK ? king.y() : 10 - king.y());
assert(0 <= effect1 && effect1 < 32);
assert(0 <= effect2 && effect2 < 32);
return king_y - 1 + 9 * (effect1 + 32 * (effect2 + 32 * i));
}
static CArray<MultiInt, 4096> table;
static CArray<MultiInt, 20480> x_table;
static CArray<MultiInt, 36864> y_table;
};
class King25MobilityX
{
public:
enum { ONE_DIM = 20480, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class King25MobilityY
{
public:
enum { ONE_DIM = 36864, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class King25Effect3
{
friend class King25Effect3Y;
public:
enum { ONE_DIM = 2400, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state,
const CArray<PieceMask, 2> &king25_mask);
private:
static int index(int piece_count, bool with_knight,
int stand_count, bool with_knight_on_stand,
int attacked_count)
{
assert(piece_count >= 0 && piece_count <= 9);
assert(stand_count >= 0 && stand_count <= 9);
assert(attacked_count >= 0 && attacked_count <= 5);
return (piece_count + 10 *
((with_knight ? 1 : 0) + 2 *
(stand_count + 10 * ((with_knight_on_stand ? 1 : 0) +
2 * attacked_count))));
}
static int indexY(int piece_count, bool with_knight,
int stand_count, bool with_knight_on_stand,
int attacked_count, int king_y)
{
assert(piece_count >= 0 && piece_count <= 9);
assert(stand_count >= 0 && stand_count <= 9);
assert(attacked_count >= 0 && attacked_count <= 5);
return ((piece_count + 10 *
((with_knight ? 1 : 0) + 2 *
(stand_count + 10 * ((with_knight_on_stand ? 1 : 0) +
2 * attacked_count))))) * 9 +
king_y - 1;
}
template <osl::Player Attack>
static MultiInt evalOne(const NumEffectState &state,
PieceMask king25);
static CArray<MultiInt, 2400> table;
static CArray<MultiInt, 21600> y_table;
};
class King25Effect3Y
{
public:
enum { ONE_DIM = 21600, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class King25EffectCountCombination
{
friend class King25EffectCountCombinationY;
public:
enum { ONE_DIM = 100, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
static MultiInt eval(const NumEffectState &state,
const CArray<PieceMask, 2> &king25);
private:
template <osl::Player Attack>
static MultiInt evalOne(const NumEffectState &state,
PieceMask king25);
static CArray<MultiInt, 100> table;
static CArray<MultiInt, 900> y_table;
};
class King25EffectCountCombinationY
{
public:
enum { ONE_DIM = 900, DIM = ONE_DIM * EvalStages };
static void setUp(const Weights &weights);
};
class BishopExchangeSilverKing
{
static int indexKing(Square king)
{
const int y = king.y();
if (y >= 3)
return -1;
return (y-1)*9 + king.x()-1;
}
static int indexRook(Square rook)
{
assert(rook.isOnBoard());
const int y = rook.y();
if (y >= 6)
return -1;
return (y-1)*9 + rook.x()-1;
}
static int indexSilver(Square silver)
{
return (silver.y()-1)*9 + silver.x()-1;
}
public:
enum { BISHOP_ONE_DIM = 18 * 81 * (45*2), DIM = BISHOP_ONE_DIM*3 };
static void setUp(const Weights &weights);
static int eval(const NumEffectState& state);
private:
template <Player KingOwner>
static int evalOne(const NumEffectState &state, int offset);
static CArray<int, DIM> table;
};
class EnterKingDefense
{
public:
enum { DIM = (8+8+8+8)*3 };
static void setUp(const Weights &weights);
static int eval(const NumEffectState &state);
private:
template <Player KingOwner>
static int evalOne(const NumEffectState &state);
static CArray<int, DIM> table;
};
}
}
}
#endif // EVAL_ML_KINGTABLE_H
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::CArray
Definition container.h:20
osl::Move
圧縮していない moveの表現 .
Definition basic_type.h:1052
osl::NumEffectState
利きを持つ局面
Definition numEffectState.h:34
osl::PieceMask
駒番号のビットセット.
Definition pieceMask.h:21
osl::Piece
駒.
Definition basic_type.h:788
osl::Piece::ptypeO
PtypeO ptypeO() const
Definition basic_type.h:824
osl::Piece::ptype
Ptype ptype() const
Definition basic_type.h:821
osl::Piece::square
const Square square() const
Definition basic_type.h:832
osl::Piece::owner
Player owner() const
Definition basic_type.h:963
osl::SimpleState::kingSquare
Square kingSquare() const
Definition simpleState.h:94
osl::Square
Definition basic_type.h:532
osl::Square::y
int y() const
将棋としてのY座標を返す.
Definition basic_type.h:567
osl::Square::isOnBoard
bool isOnBoard() const
盤面上を表すかどうかの判定． 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する．
Definition basic_type.h:583
osl::Square::x
int x() const
将棋としてのX座標を返す.
Definition basic_type.h:563
osl::eval::ml::BishopExchangeSilverKing
Definition kingTable.h:976
osl::eval::ml::BishopExchangeSilverKing::indexSilver
static int indexSilver(Square silver)
Definition kingTable.h:992
osl::eval::ml::BishopExchangeSilverKing::BISHOP_ONE_DIM
@ BISHOP_ONE_DIM
Definition kingTable.h:997
osl::eval::ml::BishopExchangeSilverKing::DIM
@ DIM
Definition kingTable.h:997
osl::eval::ml::BishopExchangeSilverKing::evalOne
static int evalOne(const NumEffectState &state, int offset)
Definition kingTable.cc:1943
osl::eval::ml::BishopExchangeSilverKing::indexRook
static int indexRook(Square rook)
Definition kingTable.h:984
osl::eval::ml::BishopExchangeSilverKing::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1911
osl::eval::ml::BishopExchangeSilverKing::indexKing
static int indexKing(Square king)
Definition kingTable.h:977
osl::eval::ml::BishopExchangeSilverKing::table
static CArray< int, DIM > table
Definition kingTable.h:1003
osl::eval::ml::EnterKingDefense
Definition kingTable.h:1007
osl::eval::ml::EnterKingDefense::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:2015
osl::eval::ml::EnterKingDefense::evalOne
static int evalOne(const NumEffectState &state)
Definition kingTable.cc:1984
osl::eval::ml::EnterKingDefense::DIM
@ DIM
Definition kingTable.h:1009
osl::eval::ml::EnterKingDefense::table
static CArray< int, DIM > table
Definition kingTable.h:1015
osl::eval::ml::King25BothSideX
Definition kingTable.h:836
osl::eval::ml::King25BothSideX::DIM
@ DIM
Definition kingTable.h:838
osl::eval::ml::King25BothSideX::ONE_DIM
@ ONE_DIM
Definition kingTable.h:838
osl::eval::ml::King25BothSideX::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1609
osl::eval::ml::King25BothSideY
Definition kingTable.h:842
osl::eval::ml::King25BothSideY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1618
osl::eval::ml::King25BothSideY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:844
osl::eval::ml::King25BothSideY::DIM
@ DIM
Definition kingTable.h:844
osl::eval::ml::King25BothSide
Definition kingTable.h:774
osl::eval::ml::King25BothSide::indexX
static int indexX(Square king, int effect1, int effect2, int i, int j)
Definition kingTable.h:794
osl::eval::ml::King25BothSide::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1600
osl::eval::ml::King25BothSide::ONE_DIM
@ ONE_DIM
Definition kingTable.h:778
osl::eval::ml::King25BothSide::DIM
@ DIM
Definition kingTable.h:778
osl::eval::ml::King25BothSide::King25BothSideY
friend class King25BothSideY
Definition kingTable.h:776
osl::eval::ml::King25BothSide::indexY
static int indexY(Square king, int effect1, int effect2, int i)
Definition kingTable.h:821
osl::eval::ml::King25BothSide::indexX
static int indexX(int king_x, int effect1, int effect2, int i)
Definition kingTable.h:816
osl::eval::ml::King25BothSide::indexY
static int indexY(int king_y, int effect1, int effect2, int i)
Definition kingTable.h:828
osl::eval::ml::King25BothSide::eval
static MultiInt eval(const NumEffectState &state, const CArray< int, 5 > &black, const CArray< int, 5 > &white)
Definition kingTable.cc:1684
osl::eval::ml::King25BothSide::King25BothSideX
friend class King25BothSideX
Definition kingTable.h:775
osl::eval::ml::King25BothSide::x_table
static CArray< MultiInt, 40960 > x_table
Definition kingTable.h:832
osl::eval::ml::King25BothSide::y_table
static CArray< MultiInt, 73728 > y_table
Definition kingTable.h:833
osl::eval::ml::King25BothSide::table
static CArray< MultiInt, 8192 > table
Definition kingTable.h:831
osl::eval::ml::King25BothSide::evalOne
static MultiInt evalOne(const NumEffectState &state, const CArray< int, 5 > &effects)
osl::eval::ml::King25BothSide::index
static int index(int effect1, int effect2, int i)
Definition kingTable.h:787
osl::eval::ml::King25Effect2
Definition kingTable.h:317
osl::eval::ml::King25Effect2::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:452
osl::eval::ml::King25Effect2::ONE_DIM
@ ONE_DIM
Definition kingTable.h:319
osl::eval::ml::King25Effect2::DIM
@ DIM
Definition kingTable.h:319
osl::eval::ml::King25Effect2::eval
static MultiInt eval(const NumEffectState &, int black_attack_effect, int black_attack_piece, int white_attack_effect, int white_attack_piece, int black_stand_count, int white_stand_count)
Definition kingTable.h:329
osl::eval::ml::King25Effect2::table
static CArray< MultiInt, ONE_DIM > table
Definition kingTable.h:326
osl::eval::ml::King25Effect2::index
static int index(int effect, int piece_count, int stand_count)
Definition kingTable.h:321
osl::eval::ml::King25Effect3Y
Definition kingTable.h:947
osl::eval::ml::King25Effect3Y::ONE_DIM
@ ONE_DIM
Definition kingTable.h:949
osl::eval::ml::King25Effect3Y::DIM
@ DIM
Definition kingTable.h:949
osl::eval::ml::King25Effect3Y::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1705
osl::eval::ml::King25Effect3
Definition kingTable.h:907
osl::eval::ml::King25Effect3::y_table
static CArray< MultiInt, 21600 > y_table
Definition kingTable.h:944
osl::eval::ml::King25Effect3::evalOne
static MultiInt evalOne(const NumEffectState &state, PieceMask king25)
osl::eval::ml::King25Effect3::index
static int index(int piece_count, bool with_knight, int stand_count, bool with_knight_on_stand, int attacked_count)
Definition kingTable.h:915
osl::eval::ml::King25Effect3::King25Effect3Y
friend class King25Effect3Y
Definition kingTable.h:908
osl::eval::ml::King25Effect3::ONE_DIM
@ ONE_DIM
Definition kingTable.h:910
osl::eval::ml::King25Effect3::DIM
@ DIM
Definition kingTable.h:910
osl::eval::ml::King25Effect3::indexY
static int indexY(int piece_count, bool with_knight, int stand_count, bool with_knight_on_stand, int attacked_count, int king_y)
Definition kingTable.h:927
osl::eval::ml::King25Effect3::table
static CArray< MultiInt, 2400 > table
Definition kingTable.h:943
osl::eval::ml::King25Effect3::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1696
osl::eval::ml::King25EffectAttack
Definition kingTable.h:177
osl::eval::ml::King25EffectAttack::DIM
@ DIM
Definition kingTable.h:184
osl::eval::ml::King25EffectAttack::eval
static int eval(const NumEffectState &, int black_effect, int black_piece, int white_effect, int white_piece)
Definition kingTable.h:193
osl::eval::ml::King25EffectAttack::setUp
static void setUp(const Weights &weights)
Definition kingTable.h:186
osl::eval::ml::King25EffectAttack::index
static int index(int effect, int piece_count)
Definition kingTable.h:179
osl::eval::ml::King25EffectAttack::table
static CArray< int, 17 *128 > table
Definition kingTable.h:185
osl::eval::ml::King25EffectBoth
Definition kingTable.h:140
osl::eval::ml::King25EffectBoth::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:501
osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth
static void countEffectAndPiecesBoth(const NumEffectState &state, PieceMask &effect25, PieceMask &effect_supported, int &attack_effect, int &attack_piece, int &defense_effect, int &defence_piece, int &attack_piece_supported, CArray< int, 5 > &effect_vertical, CArray< int, 5 > &king_vertical)
Definition kingTable.cc:514
osl::eval::ml::King25EffectBoth::index
static int index(int effect, int piece_count)
Definition kingTable.h:142
osl::eval::ml::King25EffectBoth::DIM
@ DIM
Definition kingTable.h:159
osl::eval::ml::King25EffectBoth::attack_table
static CArray< int, DIM/2 > attack_table
Definition kingTable.h:160
osl::eval::ml::King25EffectBoth::defense_table
static CArray< int, DIM/2 > defense_table
Definition kingTable.h:161
osl::eval::ml::King25EffectBoth::eval
static int eval(const NumEffectState &, int black_attack_effect, int black_attack_piece, int white_attack_effect, int white_attack_piece, int black_defense_effect, int black_defense_piece, int white_defense_effect, int white_defense_piece)
Definition kingTable.h:163
osl::eval::ml::King25EffectCountCombinationY
Definition kingTable.h:969
osl::eval::ml::King25EffectCountCombinationY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:971
osl::eval::ml::King25EffectCountCombinationY::DIM
@ DIM
Definition kingTable.h:971
osl::eval::ml::King25EffectCountCombinationY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1850
osl::eval::ml::King25EffectCountCombination
Definition kingTable.h:954
osl::eval::ml::King25EffectCountCombination::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1841
osl::eval::ml::King25EffectCountCombination::y_table
static CArray< MultiInt, 900 > y_table
Definition kingTable.h:966
osl::eval::ml::King25EffectCountCombination::DIM
@ DIM
Definition kingTable.h:957
osl::eval::ml::King25EffectCountCombination::ONE_DIM
@ ONE_DIM
Definition kingTable.h:957
osl::eval::ml::King25EffectCountCombination::table
static CArray< MultiInt, 100 > table
Definition kingTable.h:965
osl::eval::ml::King25EffectCountCombination::evalOne
static MultiInt evalOne(const NumEffectState &state, PieceMask king25)
osl::eval::ml::King25EffectCountCombination::King25EffectCountCombinationY
friend class King25EffectCountCombinationY
Definition kingTable.h:955
osl::eval::ml::King25EffectDefense
Definition kingTable.h:203
osl::eval::ml::King25EffectDefense::DIM
@ DIM
Definition kingTable.h:210
osl::eval::ml::King25EffectDefense::setUp
static void setUp(const Weights &weights, int stage)
Definition kingTable.h:212
osl::eval::ml::King25EffectDefense::table
static CArray< MultiInt, 17 *128 > table
Definition kingTable.h:211
osl::eval::ml::King25EffectDefense::eval
static MultiInt eval(const NumEffectState &, int black_effect, int black_piece, int white_effect, int white_piece)
Definition kingTable.h:219
osl::eval::ml::King25EffectDefense::index
static int index(int effect, int piece_count)
Definition kingTable.h:205
osl::eval::ml::King25EffectEachBothEnding
Definition kingTable.h:559
osl::eval::ml::King25EffectEachBothEnding::DIM
@ DIM
Definition kingTable.h:561
osl::eval::ml::King25EffectEachBothEnding::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:889
osl::eval::ml::King25EffectEachBothMidgame2
Definition kingTable.h:553
osl::eval::ml::King25EffectEachBothMidgame2::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:880
osl::eval::ml::King25EffectEachBothMidgame2::DIM
@ DIM
Definition kingTable.h:555
osl::eval::ml::King25EffectEachBothMidgame
Definition kingTable.h:547
osl::eval::ml::King25EffectEachBothMidgame::DIM
@ DIM
Definition kingTable.h:549
osl::eval::ml::King25EffectEachBothMidgame::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:871
osl::eval::ml::King25EffectEachBothOpening
Definition kingTable.h:541
osl::eval::ml::King25EffectEachBothOpening::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:862
osl::eval::ml::King25EffectEachBothOpening::DIM
@ DIM
Definition kingTable.h:543
osl::eval::ml::King25EffectEachBoth
Definition kingTable.h:566
osl::eval::ml::King25EffectEachBoth::y_table
static CArray< MultiInt, 3240 > y_table
Definition kingTable.h:588
osl::eval::ml::King25EffectEachBoth::effect_state_table
static CArray< int, 256 > effect_state_table
Definition kingTable.h:590
osl::eval::ml::King25EffectEachBoth::x_table
static CArray< MultiInt, 3000 > x_table
Definition kingTable.h:587
osl::eval::ml::King25EffectEachBoth::King25EffectEachBothMidgame
friend class King25EffectEachBothMidgame
Definition kingTable.h:580
osl::eval::ml::King25EffectEachBoth::King25EffectEachBothEnding
friend class King25EffectEachBothEnding
Definition kingTable.h:582
osl::eval::ml::King25EffectEachBoth::table
static CArray< MultiInt, 5 *3 *8 *3 > table
Definition kingTable.h:586
osl::eval::ml::King25EffectEachBoth::effectStateIndex3
static int effectStateIndex3(const NumEffectState &state, Square target)
Definition kingTable.cc:955
osl::eval::ml::King25EffectEachBoth::King25EffectEachXY
friend class King25EffectEachXY
Definition kingTable.h:583
osl::eval::ml::King25EffectEachBoth::evalWithUpdate
static void evalWithUpdate(const NumEffectState &state, Move last_move, MultiIntPair &values)
Definition kingTable.cc:1058
osl::eval::ml::King25EffectEachBoth::eval
static void eval(const NumEffectState &state, MultiIntPair &out)
Definition kingTable.cc:1050
osl::eval::ml::King25EffectEachBoth::xy_table
static CArray< MultiInt, 27000 > xy_table
Definition kingTable.h:589
osl::eval::ml::King25EffectEachBoth::King25EffectEachKXY
friend class King25EffectEachKXY
Definition kingTable.h:584
osl::eval::ml::King25EffectEachBoth::EffectState
EffectState
Definition kingTable.h:568
osl::eval::ml::King25EffectEachBoth::ATTACK_DIFF_2
@ ATTACK_DIFF_2
Definition kingTable.h:576
osl::eval::ml::King25EffectEachBoth::NO_ATTACK_DEFENSE_2
@ NO_ATTACK_DEFENSE_2
Definition kingTable.h:571
osl::eval::ml::King25EffectEachBoth::ATTACK_DIFF_0
@ ATTACK_DIFF_0
Definition kingTable.h:574
osl::eval::ml::King25EffectEachBoth::STATE_MAX
@ STATE_MAX
Definition kingTable.h:577
osl::eval::ml::King25EffectEachBoth::ATTACK_DIFF_N2
@ ATTACK_DIFF_N2
Definition kingTable.h:572
osl::eval::ml::King25EffectEachBoth::ATTACK_DIFF_N1
@ ATTACK_DIFF_N1
Definition kingTable.h:573
osl::eval::ml::King25EffectEachBoth::NO_ATTACK_DEFENSE_1
@ NO_ATTACK_DEFENSE_1
Definition kingTable.h:570
osl::eval::ml::King25EffectEachBoth::ATTACK_DIFF_1
@ ATTACK_DIFF_1
Definition kingTable.h:575
osl::eval::ml::King25EffectEachBoth::NO_ATTACK_DEFENSE_0
@ NO_ATTACK_DEFENSE_0
Definition kingTable.h:569
osl::eval::ml::King25EffectEachBoth::King25EffectEachBothMidgame2
friend class King25EffectEachBothMidgame2
Definition kingTable.h:581
osl::eval::ml::King25EffectEachBoth::evalOne
static void evalOne(const NumEffectState &state, MultiInt &out)
Definition kingTable.cc:993
osl::eval::ml::King25EffectEachBoth::King25EffectEachBothOpening
friend class King25EffectEachBothOpening
Definition kingTable.h:579
osl::eval::ml::King25EffectEachBoth::index
static void index(const NumEffectState &state, Square target, int &index_xy, int rel_y, int king_x, int king_y, int x_diff)
Definition kingTable.cc:965
osl::eval::ml::King25EffectEachEnding
Definition kingTable.h:537
osl::eval::ml::King25EffectEachKXY
Definition kingTable.h:619
osl::eval::ml::King25EffectEachKXY::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:934
osl::eval::ml::King25EffectEachKXY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:621
osl::eval::ml::King25EffectEachKXY::DIM
@ DIM
Definition kingTable.h:621
osl::eval::ml::King25EffectEachMidgame
Definition kingTable.h:534
osl::eval::ml::King25EffectEachOpening
Definition kingTable.h:531
osl::eval::ml::King25EffectEachXY
Definition kingTable.h:612
osl::eval::ml::King25EffectEachXY::DIM
@ DIM
Definition kingTable.h:614
osl::eval::ml::King25EffectEachXY::X_DIM
@ X_DIM
Definition kingTable.h:614
osl::eval::ml::King25EffectEachXY::Y_DIM
@ Y_DIM
Definition kingTable.h:614
osl::eval::ml::King25EffectEachXY::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:897
osl::eval::ml::King25EffectEach
Definition kingTable.h:512
osl::eval::ml::King25EffectEach::effectState
static EffectState effectState(const NumEffectState &state, Square target)
osl::eval::ml::King25EffectEach::DIM
@ DIM
Definition kingTable.h:514
osl::eval::ml::King25EffectEach::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:769
osl::eval::ml::King25EffectEach::table
static CArray< int, 5 *3 *8 *3 > table
Definition kingTable.h:516
osl::eval::ml::King25EffectEach::evalOne
static int evalOne(const NumEffectState &state)
Definition kingTable.cc:820
osl::eval::ml::King25EffectEach::eval
static int eval(const NumEffectState &state)
Definition kingTable.cc:845
osl::eval::ml::King25EffectEach::index
static int index(const NumEffectState &state, Square king, Square target)
Definition kingTable.cc:795
osl::eval::ml::King25EffectSupportedY
Definition kingTable.h:398
osl::eval::ml::King25EffectSupportedY::index
static int index(int piece_count, int supported, int y)
Definition kingTable.h:402
osl::eval::ml::King25EffectSupportedY::eval
static MultiInt eval(int black_attack_piece, int white_attack_piece, int black_attack_supported_piece, int white_attack_supported_piece, int black_king_y, int white_king_y)
Definition kingTable.h:409
osl::eval::ml::King25EffectSupportedY::table
static CArray< MultiInt, ONE_DIM > table
Definition kingTable.h:406
osl::eval::ml::King25EffectSupportedY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:485
osl::eval::ml::King25EffectSupportedY::DIM
@ DIM
Definition kingTable.h:400
osl::eval::ml::King25EffectSupportedY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:400
osl::eval::ml::King25EffectSupported
Definition kingTable.h:374
osl::eval::ml::King25EffectSupported::table
static CArray< MultiInt, ONE_DIM > table
Definition kingTable.h:382
osl::eval::ml::King25EffectSupported::eval
static MultiInt eval(int black_attack_piece, int white_attack_piece, int black_attack_supported_piece, int white_attack_supported_piece)
Definition kingTable.h:385
osl::eval::ml::King25EffectSupported::index
static int index(int piece_count, int supported)
Definition kingTable.h:378
osl::eval::ml::King25EffectSupported::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:476
osl::eval::ml::King25EffectSupported::DIM
@ DIM
Definition kingTable.h:376
osl::eval::ml::King25EffectSupported::ONE_DIM
@ ONE_DIM
Definition kingTable.h:376
osl::eval::ml::King25EffectY2
Definition kingTable.h:345
osl::eval::ml::King25EffectY2::DIM
@ DIM
Definition kingTable.h:347
osl::eval::ml::King25EffectY2::ONE_DIM
@ ONE_DIM
Definition kingTable.h:347
osl::eval::ml::King25EffectY2::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:461
osl::eval::ml::King25EffectY2::eval
static MultiInt eval(const NumEffectState &state, int black_attack_effect, int black_attack_piece, int white_attack_effect, int white_attack_piece, int black_stand_count, int white_stand_count)
Definition kingTable.h:358
osl::eval::ml::King25EffectY2::index
static int index(int king_y, int effect, int piece_count, int stand_count)
Definition kingTable.h:349
osl::eval::ml::King25EffectY2::table
static CArray< MultiInt, ONE_DIM > table
Definition kingTable.h:355
osl::eval::ml::King25EffectYAttack
Definition kingTable.h:230
osl::eval::ml::King25EffectYAttack::table
static CArray< int, 17 *128 *9 > table
Definition kingTable.h:238
osl::eval::ml::King25EffectYAttack::setUp
static void setUp(const Weights &weights)
Definition kingTable.h:239
osl::eval::ml::King25EffectYAttack::DIM
@ DIM
Definition kingTable.h:237
osl::eval::ml::King25EffectYAttack::eval
static int eval(const NumEffectState &state, int black_effect, int black_piece, int white_effect, int white_piece)
Definition kingTable.h:246
osl::eval::ml::King25EffectYAttack::index
static int index(int king_y, int effect, int piece_count)
Definition kingTable.h:232
osl::eval::ml::King25EffectYDefense
Definition kingTable.h:259
osl::eval::ml::King25EffectYDefense::setUp
static void setUp(const Weights &weights, int stage)
Definition kingTable.h:268
osl::eval::ml::King25EffectYDefense::table
static CArray< MultiInt, 17 *128 *9 > table
Definition kingTable.h:267
osl::eval::ml::King25EffectYDefense::DIM
@ DIM
Definition kingTable.h:266
osl::eval::ml::King25EffectYDefense::eval
static MultiInt eval(const NumEffectState &state, int black_effect, int black_piece, int white_effect, int white_piece)
Definition kingTable.h:275
osl::eval::ml::King25EffectYDefense::index
static int index(int king_y, int effect, int piece_count)
Definition kingTable.h:261
osl::eval::ml::King25EffectY
Definition kingTable.h:287
osl::eval::ml::King25EffectY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:609
osl::eval::ml::King25EffectY::attack_table
static CArray< int, DIM/2 > attack_table
Definition kingTable.h:295
osl::eval::ml::King25EffectY::DIM
@ DIM
Definition kingTable.h:289
osl::eval::ml::King25EffectY::index
static int index(int king_y, int effect, int piece_count)
Definition kingTable.h:291
osl::eval::ml::King25EffectY::eval
static int eval(const NumEffectState &state, int black_attack_effect, int black_attack_piece, int white_attack_effect, int white_attack_piece, int black_defense_effect, int black_defense_piece, int white_defense_effect, int white_defense_piece)
Definition kingTable.h:299
osl::eval::ml::King25EffectY::defense_table
static CArray< int, DIM/2 > defense_table
Definition kingTable.h:296
osl::eval::ml::King25Effect
Definition kingTable.h:125
osl::eval::ml::King25Effect::countEffectAndPieces
static void countEffectAndPieces(const NumEffectState &state, const Player attack, int &effect, int &piece)
Definition kingTable.cc:404
osl::eval::ml::King25Effect::DIM
@ DIM
Definition kingTable.h:133
osl::eval::ml::King25Effect::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:395
osl::eval::ml::King25Effect::table
static CArray< int, DIM > table
Definition kingTable.h:134
osl::eval::ml::King25Effect::index
static int index(int effect, int piece_count)
Definition kingTable.cc:432
osl::eval::ml::King25Effect::eval
static int eval(const NumEffectState &state)
Definition kingTable.cc:437
osl::eval::ml::King25EmptyAbsEnding
Definition kingTable.h:495
osl::eval::ml::King25EmptyAbsOpening
Definition kingTable.h:492
osl::eval::ml::King25EmptyAbs
Definition kingTable.h:466
osl::eval::ml::King25EmptyAbs::setUp
static void setUp(const Weights &weigths)
Definition kingTable.cc:1086
osl::eval::ml::King25EmptyAbs::index
static int index(Square king, Square target)
Definition kingTable.cc:1096
osl::eval::ml::King25EmptyAbs::index
static int index(Square king, Square target, Player player)
Definition kingTable.h:474
osl::eval::ml::King25EmptyAbs::table
static CArray< int, 1125 > table
Definition kingTable.h:470
osl::eval::ml::King25EmptyAbs::DIM
@ DIM
Definition kingTable.h:468
osl::eval::ml::King25EmptyAbs::evalWithUpdate
static int evalWithUpdate(const NumEffectState &state, osl::Move moved, int last_value)
Definition kingTable.cc:1154
osl::eval::ml::King25EmptyAbs::evalOne
static int evalOne(const NumEffectState &state)
Definition kingTable.cc:1120
osl::eval::ml::King25EmptySquareNoEffectEnding
Definition kingTable.h:456
osl::eval::ml::King25EmptySquareNoEffectEnding::weights
static const CArray< int, 15 > & weights()
Definition kingTable.h:461
osl::eval::ml::King25EmptySquareNoEffectEnding::table
static CArray< int, 15 > table
Definition kingTable.h:457
osl::eval::ml::King25EmptySquareNoEffectEnding::setUp
static void setUp(const Weights &weigths)
Definition kingTable.h:459
osl::eval::ml::King25EmptySquareNoEffectOpening
Definition kingTable.h:446
osl::eval::ml::King25EmptySquareNoEffectOpening::weights
static const CArray< int, 15 > & weights()
Definition kingTable.h:451
osl::eval::ml::King25EmptySquareNoEffectOpening::table
static CArray< int, 15 > table
Definition kingTable.h:447
osl::eval::ml::King25EmptySquareNoEffectOpening::setUp
static void setUp(const Weights &weigths)
Definition kingTable.h:449
osl::eval::ml::King25MobilityX
Definition kingTable.h:894
osl::eval::ml::King25MobilityX::ONE_DIM
@ ONE_DIM
Definition kingTable.h:896
osl::eval::ml::King25MobilityX::DIM
@ DIM
Definition kingTable.h:896
osl::eval::ml::King25MobilityX::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1791
osl::eval::ml::King25MobilityY
Definition kingTable.h:900
osl::eval::ml::King25MobilityY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:902
osl::eval::ml::King25MobilityY::DIM
@ DIM
Definition kingTable.h:902
osl::eval::ml::King25MobilityY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1800
osl::eval::ml::King25Mobility
Definition kingTable.h:849
osl::eval::ml::King25Mobility::x_table
static CArray< MultiInt, 20480 > x_table
Definition kingTable.h:890
osl::eval::ml::King25Mobility::indexX
static int indexX(Square king, int effect1, int effect2, int i)
Definition kingTable.h:866
osl::eval::ml::King25Mobility::King25MobilityX
friend class King25MobilityX
Definition kingTable.h:850
osl::eval::ml::King25Mobility::indexY
static int indexY(Square king, int effect1, int effect2, int i)
Definition kingTable.h:882
osl::eval::ml::King25Mobility::y_table
static CArray< MultiInt, 36864 > y_table
Definition kingTable.h:891
osl::eval::ml::King25Mobility::ONE_DIM
@ ONE_DIM
Definition kingTable.h:853
osl::eval::ml::King25Mobility::DIM
@ DIM
Definition kingTable.h:853
osl::eval::ml::King25Mobility::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1782
osl::eval::ml::King25Mobility::King25MobilityY
friend class King25MobilityY
Definition kingTable.h:851
osl::eval::ml::King25Mobility::index
static int index(int effect1, int effect2, int i)
Definition kingTable.h:859
osl::eval::ml::King25Mobility::table
static CArray< MultiInt, 4096 > table
Definition kingTable.h:889
osl::eval::ml::King3PiecesXY
Definition kingTable.h:711
osl::eval::ml::King3PiecesXY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1218
osl::eval::ml::King3PiecesXY::DIM
@ DIM
Definition kingTable.h:718
osl::eval::ml::King3PiecesXY::X_DIM
@ X_DIM
Definition kingTable.h:715
osl::eval::ml::King3PiecesXY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:717
osl::eval::ml::King3PiecesXY::Y_DIM
@ Y_DIM
Definition kingTable.h:716
osl::eval::ml::King3Pieces
Definition kingTable.h:626
osl::eval::ml::King3Pieces::evalWithUpdate
static MultiInt evalWithUpdate(const NumEffectState &state, Move last_move, MultiInt &last_value)
Definition kingTable.cc:1319
osl::eval::ml::King3Pieces::value
static MultiInt value(int vertical_index, int horizontal_index, int diagonal_index1, int diagonal_index2, int vertical_index_x, int horizontal_index_x, int diagonal_index1_x, int diagonal_index2_x, int vertical_index_y, int horizontal_index_y, int diagonal_index1_y, int diagonal_index2_y)
Definition kingTable.h:687
osl::eval::ml::King3Pieces::indexY
static int indexY(const Square king_position, PtypeO p1, PtypeO p2)
Definition kingTable.h:653
osl::eval::ml::King3Pieces::table
static CArray< MultiInt, 3072 > table
Definition kingTable.h:705
osl::eval::ml::King3Pieces::evalOne
static void evalOne(const NumEffectState &state, MultiInt &result)
Definition kingTable.cc:1233
osl::eval::ml::King3Pieces::indexX
static int indexX(const Square king_position, PtypeO p1, PtypeO p2)
Definition kingTable.h:667
osl::eval::ml::King3Pieces::King3PiecesXY
friend class King3PiecesXY
Definition kingTable.h:627
osl::eval::ml::King3Pieces::index
static int index(PtypeO p1, PtypeO p2)
Definition kingTable.h:643
osl::eval::ml::King3Pieces::ONE_DIM
@ ONE_DIM
Definition kingTable.h:629
osl::eval::ml::King3Pieces::DIM
@ DIM
Definition kingTable.h:629
osl::eval::ml::King3Pieces::y_table
static CArray< MultiInt, 27648 > y_table
Definition kingTable.h:707
osl::eval::ml::King3Pieces::x_table
static CArray< MultiInt, 15360 > x_table
Definition kingTable.h:706
osl::eval::ml::King3Pieces::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1209
osl::eval::ml::King3Pieces::Direction
Direction
Definition kingTable.h:637
osl::eval::ml::King3Pieces::HORIZONTAL
@ HORIZONTAL
Definition kingTable.h:638
osl::eval::ml::King3Pieces::VERTICAL
@ VERTICAL
Definition kingTable.h:639
osl::eval::ml::King3Pieces::DIAGONAL
@ DIAGONAL
Definition kingTable.h:640
osl::eval::ml::KingMobilitySum
Definition kingTable.h:762
osl::eval::ml::KingMobilitySum::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1543
osl::eval::ml::KingMobilitySum::table
static CArray< MultiInt, 45 *33 > table
Definition kingTable.h:770
osl::eval::ml::KingMobilitySum::DIM
@ DIM
Definition kingTable.h:764
osl::eval::ml::KingMobilitySum::ONE_DIM
@ ONE_DIM
Definition kingTable.h:764
osl::eval::ml::KingMobilitySum::evalOne
static MultiInt evalOne(const NumEffectState &state)
osl::eval::ml::KingMobilityWithBishop
Definition kingTable.h:755
osl::eval::ml::KingMobilityWithBishop::ONE_DIM
@ ONE_DIM
Definition kingTable.h:757
osl::eval::ml::KingMobilityWithBishop::DIM
@ DIM
Definition kingTable.h:757
osl::eval::ml::KingMobilityWithBishop::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1398
osl::eval::ml::KingMobilityWithRook
Definition kingTable.h:749
osl::eval::ml::KingMobilityWithRook::DIM
@ DIM
Definition kingTable.h:751
osl::eval::ml::KingMobilityWithRook::ONE_DIM
@ ONE_DIM
Definition kingTable.h:751
osl::eval::ml::KingMobilityWithRook::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1378
osl::eval::ml::KingMobility
Definition kingTable.h:724
osl::eval::ml::KingMobility::mobilityDir
static int mobilityDir(Square king, Square target)
Definition kingTable.h:735
osl::eval::ml::KingMobility::KingMobilityWithBishop
friend class KingMobilityWithBishop
Definition kingTable.h:726
osl::eval::ml::KingMobility::evalOne
static MultiInt evalOne(const NumEffectState &state)
osl::eval::ml::KingMobility::rook_bishop_table
static CArray< MultiInt, 3240 > rook_bishop_table
Definition kingTable.h:745
osl::eval::ml::KingMobility::table
static CArray< MultiInt, 3240 > table
Definition kingTable.h:742
osl::eval::ml::KingMobility::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:1358
osl::eval::ml::KingMobility::rook_table
static CArray< MultiInt, 3240 > rook_table
Definition kingTable.h:743
osl::eval::ml::KingMobility::bishop_table
static CArray< MultiInt, 3240 > bishop_table
Definition kingTable.h:744
osl::eval::ml::KingMobility::KingMobilityWithRook
friend class KingMobilityWithRook
Definition kingTable.h:725
osl::eval::ml::KingMobility::ONE_DIM
@ ONE_DIM
Definition kingTable.h:728
osl::eval::ml::KingMobility::DIM
@ DIM
Definition kingTable.h:728
osl::eval::ml::KingPieceRelativeNoSupport
Definition kingTable.h:64
osl::eval::ml::KingPieceRelativeNoSupport::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:126
osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate
static MultiInt evalWithUpdate(const NumEffectState &state, Move moved, const CArray< PieceMask, 2 > &effected_mask, const MultiInt &last_values)
Definition kingTable.cc:179
osl::eval::ml::KingPieceRelativeNoSupport::table
static CArray< MultiInt, ONE_DIM > table
Definition kingTable.h:90
osl::eval::ml::KingPieceRelativeNoSupport::index
static int index(const Player player, const Square king, const Ptype ptype, const Square pos)
Definition kingTable.h:77
osl::eval::ml::KingPieceRelativeNoSupport::index
static int index(const Player player, const Square king, const Piece piece)
Definition kingTable.h:85
osl::eval::ml::KingPieceRelativeNoSupport::DIM
@ DIM
Definition kingTable.h:66
osl::eval::ml::KingPieceRelativeNoSupport::ONE_DIM
@ ONE_DIM
Definition kingTable.h:66
osl::eval::ml::KingPieceRelativeNoSupport::adjust
static void adjust(int attack, int defense, MultiInt &out)
Definition kingTable.cc:137
midgame.h
osl::effect
Definition effectedNumTable.h:8
osl::eval::ml
Definition eval_pieceStand.cc:470
osl::eval::ml::EffectState
EffectState
Definition kingTable.h:499
osl::eval::ml::ATTACK_DIFF_1
@ ATTACK_DIFF_1
Definition kingTable.h:506
osl::eval::ml::NO_ATTACK_DEFENSE_0
@ NO_ATTACK_DEFENSE_0
Definition kingTable.h:500
osl::eval::ml::NO_ATTACK_DEFENSE_1
@ NO_ATTACK_DEFENSE_1
Definition kingTable.h:501
osl::eval::ml::STATE_MAX
@ STATE_MAX
Definition kingTable.h:508
osl::eval::ml::ATTACK_DIFF_N1
@ ATTACK_DIFF_N1
Definition kingTable.h:504
osl::eval::ml::ATTACK_DIFF_N2
@ ATTACK_DIFF_N2
Definition kingTable.h:503
osl::eval::ml::NO_ATTACK_DEFENSE_2
@ NO_ATTACK_DEFENSE_2
Definition kingTable.h:502
osl::eval::ml::ATTACK_DIFF_0
@ ATTACK_DIFF_0
Definition kingTable.h:505
osl::eval::ml::ATTACK_DIFF_2
@ ATTACK_DIFF_2
Definition kingTable.h:507
osl::eval
Definition eval_pieceStand.cc:468
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::PTYPE_PIECE_MIN
@ PTYPE_PIECE_MIN
Definition basic_type.h:104
osl::PTYPE_MAX
@ PTYPE_MAX
Definition basic_type.h:105
osl::CArray2d
CArray< CArray< T, Capacity2 >, Capacity1 > CArray2d
Definition container.h:95
osl::MultiIntPair
QuadIntPair MultiIntPair
Definition midgame.h:14
osl::getOwner
Player getOwner(PtypeO ptypeO)
Definition basic_type.h:256
osl::R
@ R
Definition basic_type.h:317
osl::UL
@ UL
Definition basic_type.h:313
osl::U
@ U
Definition basic_type.h:314
osl::L
@ L
Definition basic_type.h:316
osl::UR
@ UR
Definition basic_type.h:315
osl::ptypeOIndex
unsigned int ptypeOIndex(PtypeO ptypeo)
Definition basic_type.h:205
osl::MultiInt
QuadInt MultiInt
Definition midgame.h:13
osl::Player
Player
Definition basic_type.h:8
osl::WHITE
@ WHITE
Definition basic_type.h:10
osl::BLACK
@ BLACK
Definition basic_type.h:9
osl::PtypeO
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
Definition basic_type.h:199
osl::PTYPEO_MIN
@ PTYPEO_MIN
Definition basic_type.h:200
osl::EvalStages
const int EvalStages
Definition midgame.h:12
osl::alt
constexpr Player alt(Player player)
Definition basic_type.h:13
osl::altIfPiece
PtypeO altIfPiece(PtypeO ptypeO)
Pieceの時にはowner を反転する
Definition basic_type.h:281
numEffectState.h
osl::eval::ml::King25EmptySquareNoEffect
Definition kingTable.h:425
osl::eval::ml::King25EmptySquareNoEffect::evalWithUpdate
static std::pair< CArray< int, 2 >, CArray< int, 2 > > evalWithUpdate(const NumEffectState &state, Move last_move, const CArray< int, 15 > &opening, const CArray< int, 15 > &ending, const CArray< int, 2 > &last_opening_value, const CArray< int, 2 > &last_ending_value)
Definition kingTable.cc:719
osl::eval::ml::King25EmptySquareNoEffect::DIM
@ DIM
Definition kingTable.h:426
osl::eval::ml::King25EmptySquareNoEffect::evalOne
static int evalOne(const NumEffectState &state, const CArray< int, 15 > &table)
Definition kingTable.cc:634
osl::eval::ml::King25EmptySquareNoEffect::setUpBase
static void setUpBase(const Weights &weigths, CArray< int, 15 > &table)
Definition kingTable.cc:623
osl::eval::ml::King25EmptySquareNoEffect::index
static int index(int rel_x, int rel_y)
Definition kingTable.h:437
osl::eval::ml::KingPieceRelative
Definition kingTable.h:18
osl::eval::ml::KingPieceRelative::evalWithUpdate
static MultiInt evalWithUpdate(const NumEffectState &state, Move moved, const MultiInt &last_values)
Definition kingTable.cc:59
osl::eval::ml::KingPieceRelative::attack_table
static table_t attack_table
Definition kingTable.h:20
osl::eval::ml::KingPieceRelative::DIM
@ DIM
Definition kingTable.h:52
osl::eval::ml::KingPieceRelative::table_t
CArray2d< MultiInt, PTYPE_SIZE, 17 *9 > table_t
Definition kingTable.h:19
osl::eval::ml::KingPieceRelative::setUp
static void setUp(const Weights &weights, int stage)
Definition kingTable.cc:8
osl::eval::ml::KingPieceRelative::index
static int index(const NumEffectState &state, Player owner, const Square position, bool same_king)
Definition kingTable.h:30
osl::eval::ml::KingPieceRelative::index
static int index(const NumEffectState &state, PtypeO ptypeo, const Square position, bool same_king)
Definition kingTable.h:39
osl::eval::ml::KingPieceRelative::index
static int index(const NumEffectState &state, const Piece piece, bool same_king)
Definition kingTable.h:46
osl::eval::ml::KingPieceRelative::defense_table
static table_t defense_table
Definition kingTable.h:20
osl::eval::ml::KingPieceRelative::TABLE_DIM
@ TABLE_DIM
Definition kingTable.h:54
osl::eval::ml::KingPieceRelative::index
static int index(const NumEffectState &, Player owner, const Square position, Square king)
Definition kingTable.h:21
osl::eval::ml::PtypeYY
Definition kingTable.h:94
osl::eval::ml::PtypeYY::index
static int index(const PtypeO ptypeO, const Square position, const Square king)
Definition kingTable.h:113
osl::eval::ml::PtypeYY::DIM
@ DIM
Definition kingTable.h:95
osl::eval::ml::PtypeYY::ONE_DIM
@ ONE_DIM
Definition kingTable.h:95
osl::eval::ml::PtypeYY::table
static CArray< MultiInt, 2592 > table
Definition kingTable.h:102
osl::eval::ml::PtypeYY::setUp
static void setUp(const Weights &weights)
Definition kingTable.cc:310
osl::eval::ml::PtypeYY::evalWithUpdate
static MultiInt evalWithUpdate(const NumEffectState &state, Move moved, const MultiInt &last_values)
Definition kingTable.cc:351
osl::eval::ml::PtypeYY::adjust
static void adjust(int black, int white, MultiInt &out)
Definition kingTable.cc:322
osl::eval::ml::PtypeYY::index
static int index(const Piece p, const Square king)
Definition kingTable.h:107
osl::eval::ml::Weights
Definition weights.h:18
osl::eval::ml::Weights::dimension
size_t dimension() const
Definition weights.h:29
osl::eval::ml::Weights::value
int value(size_t index) const
Definition weights.h:27
weights.h