osl::eval::ml::PiecePairKing Class Reference

`#include <piecePairKing.h>`

## Public Types

enum | { ONE_DIM = 1488375 , DIM = ONE_DIM }

## Static Public Member Functions

static void | setUp (const Weights &weights)
static CArray< int, 2 > | eval (const NumEffectState &)
template<Player P>
static void | evalWithUpdateBang (const NumEffectState &state, Move moved, CArray< int, 2 > &last_value)
template<Player King>
static int | evalOne (const NumEffectState &)

## Static Private Member Functions

template<Player King>
static int | add (const NumEffectState &state, Square to, Ptype ptype)
template<Player King>
static int | sub (const NumEffectState &state, Square from, Ptype ptype)
template<Player King>
static int | addSub (const NumEffectState &state, Square to, Ptype ptype, Square from)
static int | composeIndex (int king, int i0, int i1)
static int | indexWhite (Square p)
static int | indexKing (Player owner, Square king, bool &flipx)
template<bool FlipX>
static int | indexPiece (Player owner, Square position, Ptype ptype)

## Static Private Attributes

static osl::CArray< int16_t, ONE_DIM > | table

## Detailed Description

Definition at line 14 of file piecePairKing.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
ONE_DIM |
DIM |

Definition at line 17 of file piecePairKing.h.

## Member Function Documentation

## add()

template<osl::Player King>

int osl::eval::ml::PiecePairKing::add | ( | const NumEffectState & | state,
|  | Square | to,
|  | Ptype | ptype )

static private

Definition at line 86 of file piecePairKing.cc.

References osl::BLACK, osl::PieceMask::clearBit(), composeIndex(), indexKing(), indexPiece(), osl::KING, osl::SimpleState::kingSquare(), osl::container::PieceMask64::none(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::Piece::ptype(), osl::Piece::square(), osl::Square::squareForBlack(), table, osl::container::PieceMask64::takeOneBit(), and osl::Square::y().

Referenced by evalWithUpdateBang().

## addSub()

template<osl::Player King>

int osl::eval::ml::PiecePairKing::addSub | ( | const NumEffectState & | state,
|  | Square | to,
|  | Ptype | ptype,
|  | Square | from )

static private

Definition at line 164 of file piecePairKing.cc.

References osl::BLACK, osl::PieceMask::clearBit(), composeIndex(), indexKing(), indexPiece(), osl::KING, osl::SimpleState::kingSquare(), osl::container::PieceMask64::none(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::Piece::ptype(), osl::Piece::square(), osl::Square::squareForBlack(), table, osl::container::PieceMask64::takeOneBit(), and osl::Square::y().

Referenced by evalWithUpdateBang().

## composeIndex()

int osl::eval::ml::PiecePairKing::composeIndex | ( | int | king,
|  | int | i0,
|  | int | i1 )

inline static private

Definition at line 36 of file piecePairKing.h.

Referenced by add(), addSub(), evalOne(), setUp(), and sub().

## eval()

osl::CArray< int, 2 > osl::eval::ml::PiecePairKing::eval | ( | const NumEffectState & | state | ) |

static

Definition at line 28 of file piecePairKing.cc.

References osl::BLACK, evalOne(), and osl::WHITE.

Referenced by osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval().

## evalOne()

template<osl::Player King>

int osl::eval::ml::PiecePairKing::evalOne | ( | const NumEffectState & | state | ) |

static

Definition at line 38 of file piecePairKing.cc.

References osl::BLACK, osl::PieceMask::clearBit(), composeIndex(), indexKing(), indexPiece(), osl::KING, osl::SimpleState::kingSquare(), osl::container::PieceMask64::none(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::FixedCapacityVector< T, Capacity >::push_back(), osl::FixedCapacityVector< T, Capacity >::size(), osl::Piece::square(), osl::Square::squareForBlack(), table, osl::container::PieceMask64::takeOneBit(), and osl::Square::y().

Referenced by eval(), and evalWithUpdateBang().

## evalWithUpdateBang()

template<osl::Player P>

template void osl::eval::ml::PiecePairKing::evalWithUpdateBang< WHITE > | ( | const NumEffectState & | state,
|  | Move | moved,
|  | CArray< int, 2 > & | last_value )

static

Definition at line 213 of file piecePairKing.cc.

References add(), addSub(), osl::alt(), osl::captured(), osl::Move::capturePtype(), evalOne(), osl::Move::from(), osl::Move::isDrop(), osl::Move::isPass(), osl::isPromoted(), osl::KING, osl::SimpleState::kingSquare(), osl::Move::oldPtype(), osl::Move::player(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::Square::squareForBlack(), sub(), osl::Move::to(), and osl::Square::y().

Referenced by osl::eval::ml::OpenMidEndingEval::updateSub().

## indexKing()

int osl::eval::ml::PiecePairKing::indexKing | ( | Player | owner,
|  | Square | king,
|  | bool & | flipx )

inline static private

Definition at line 44 of file piecePairKing.h.

References osl::BLACK, osl::Square::flipHorizontal(), osl::Square::rotate180(), osl::Square::x(), and osl::Square::y().

Referenced by add(), addSub(), evalOne(), setUp(), and sub().

## indexPiece()

template<bool FlipX>

int osl::eval::ml::PiecePairKing::indexPiece | ( | Player | owner,
|  | Square | position,
|  | Ptype | ptype )

inline static private

Definition at line 59 of file piecePairKing.h.

References osl::BLACK, osl::Square::flipHorizontal(), indexWhite(), osl::isPromoted(), osl::PTYPE_BASIC_MIN, osl::Square::rotate180(), and osl::Square::y().

Referenced by add(), addSub(), evalOne(), and sub().

## indexWhite()

int osl::eval::ml::PiecePairKing::indexWhite | ( | Square | p | ) |

inline static private

Definition at line 40 of file piecePairKing.h.

References osl::Square::x(), and osl::Square::y().

Referenced by indexPiece().

## setUp()

void osl::eval::ml::PiecePairKing::setUp | ( | const Weights & | weights | ) |

static

Definition at line 9 of file piecePairKing.cc.

References composeIndex(), osl::eval::ml::Weights::dimension(), indexKing(), table, osl::eval::ml::Weights::value(), and osl::WHITE.

## sub()

template<osl::Player King>

int osl::eval::ml::PiecePairKing::sub | ( | const NumEffectState & | state,
|  | Square | from,
|  | Ptype | ptype )

static private

Definition at line 126 of file piecePairKing.cc.

References osl::BLACK, osl::PieceMask::clearBit(), composeIndex(), indexKing(), indexPiece(), osl::KING, osl::SimpleState::kingSquare(), osl::container::PieceMask64::none(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::Piece::ptype(), osl::Piece::square(), osl::Square::squareForBlack(), table, osl::container::PieceMask64::takeOneBit(), and osl::Square::y().

Referenced by evalWithUpdateBang().

## Member Data Documentation

## table

osl::CArray< int16_t, 1488375 > osl::eval::ml::PiecePairKing::table

static private

Definition at line 69 of file piecePairKing.h.

Referenced by add(), addSub(), evalOne(), setUp(), and sub().

The documentation for this class was generated from the following files:

- piecePairKing.h
- piecePairKing.cc