osl::eval::ml::KnightFork Class Reference

`#include <minorPiece.h>`

## Public Types

enum | { DROP_DIM = PTYPE_SIZE*PTYPE_SIZE , ONE_DIM = DROP_DIM*2*2 , DIM = ONE_DIM * EvalStages }

## Public Member Functions

template<osl::Player Defense>
osl::MultiIntPair | evalOne (const NumEffectState &state, bool has_knight, BoardMask &knight_fork_squares, std::pair< Square, int > &knight_drop)
template<osl::Player Defense>
osl::MultiIntPair | accumulate (const NumEffectState &state, bool has_knight, const BoardMask &knight_fork_squares, std::pair< Square, int > &knight_drop)
template<osl::Player P>
osl::MultiIntPair | evalWithUpdate (const NumEffectState &state, Move moved, CArray< BoardMask, 2 > &knight_fork_squares, CArray< std::pair< Square, int >, 2 > &knight_drop)

## Static Public Member Functions

static void | setUp (const Weights &weights)
template<Player Defense>
static MultiIntPair | evalOne (const NumEffectState &state, bool has_knight, BoardMask &knight_fork_squares, std::pair< Square, int > &knight_drop)
static MultiIntPair | eval (const NumEffectState &state, CArray< BoardMask, 2 > &knight_fork_squares, CArray< std::pair< Square, int >, 2 > &knight_drop)
template<Player P>
static MultiIntPair | evalWithUpdate (const NumEffectState &state, Move moved, CArray< BoardMask, 2 > &knight_fork_squares, CArray< std::pair< Square, int >, 2 > &knight_drop)
static bool | isForkSquare (const NumEffectState &state, Player defense, int y, int x0, int x1)
static int | index (Ptype a, Ptype b)
static bool | isTarget (Ptype ptype)

## Static Public Attributes

static CArray< MultiInt, ONE_DIM > | table

## Static Private Member Functions

template<Player P, Player Defense>
static void | updateSquares (const NumEffectState &state, Move moved, BoardMask &knight_fork_squares)
template<osl::Player Defense>
static MultiIntPair | accumulate (const NumEffectState &state, bool has_knight, const BoardMask &knight_fork_squares, std::pair< Square, int > &knight_drop)

## Detailed Description

Definition at line 1667 of file minorPiece.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
DROP_DIM |
ONE_DIM |
DIM |

Definition at line 1670 of file minorPiece.h.

## Member Function Documentation

## accumulate() [1/2]

template<osl::Player Defense>

osl::MultiIntPair osl::eval::ml::KnightFork::accumulate | ( | const NumEffectState & | state,
|  | bool | has_knight,
|  | const BoardMask & | knight_fork_squares,
|  | std::pair< Square, int > & | knight_drop )

Definition at line 2829 of file minorPiece.cc.

References osl::container::BoardMask::any(), osl::Square::back(), osl::BLACK, DROP_DIM, osl::NumEffectState::hasEffectAt(), index(), osl::Piece::isOnBoardByOwner(), osl::Piece::ptype(), table, osl::container::BoardMask::takeOneBit(), osl::UUL, osl::UUR, and osl::WHITE.

## accumulate() [2/2]

template<osl::Player Defense>

MultiIntPair osl::eval::ml::KnightFork::accumulate | ( | const NumEffectState & | state,
|  | bool | has_knight,
|  | const BoardMask & | knight_fork_squares,
|  | std::pair< Square, int > & | knight_drop )

static private

Referenced by evalWithUpdate().

## eval()

osl::MultiIntPair osl::eval::ml::KnightFork::eval | ( | const NumEffectState & | state,
|  | CArray< BoardMask, 2 > & | knight_fork_squares,
|  | CArray< std::pair< Square, int >, 2 > & | knight_drop )

static

Definition at line 2736 of file minorPiece.cc.

References osl::alt(), osl::BLACK, osl::NumEffectState::effectedMask(), evalOne(), osl::PieceMask::getMask(), osl::SimpleState::hasPieceOnStand(), osl::KNIGHT, osl::NumEffectState::piecesOnBoard(), osl::PieceMask::selectBit(), and osl::WHITE.

Referenced by evalOne(), and osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval().

## evalOne() [1/2]

template<osl::Player Defense>

osl::MultiIntPair osl::eval::ml::KnightFork::evalOne | ( | const NumEffectState & | state,
|  | bool | has_knight,
|  | BoardMask & | knight_fork_squares,
|  | std::pair< Square, int > & | knight_drop )

Definition at line 2668 of file minorPiece.cc.

References osl::PieceMask::any(), osl::BLACK, osl::container::BoardMask::clear(), osl::PieceMask::clearBit(), DROP_DIM, osl::NumEffectState::hasEffectAt(), index(), osl::Piece::isOnBoardByOwner(), osl::KNIGHT, osl::LANCE, osl::PAWN, osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::playerToIndex(), osl::Piece::ptype(), osl::container::BoardMask::set(), osl::sign(), osl::CArray< T, Capacity >::size(), osl::Piece::square(), table, osl::container::PieceMask64::takeOneBit(), osl::WHITE, osl::Square::x(), and osl::Square::y().

## evalOne() [2/2]

template<Player Defense>

MultiIntPair osl::eval::ml::KnightFork::evalOne | ( | const NumEffectState & | state,
|  | bool | has_knight,
|  | BoardMask & | knight_fork_squares,
|  | std::pair< Square, int > & | knight_drop )

static

References eval().

Referenced by eval(), and evalWithUpdate().

## evalWithUpdate() [1/2]

template<osl::Player P>

osl::MultiIntPair osl::eval::ml::KnightFork::evalWithUpdate | ( | const NumEffectState & | state,
|  | Move | moved,
|  | CArray< BoardMask, 2 > & | knight_fork_squares,
|  | CArray< std::pair< Square, int >, 2 > & | knight_drop )

Definition at line 2871 of file minorPiece.cc.

References accumulate(), osl::alt(), osl::BLACK, osl::NumEffectState::effectedMask(), evalOne(), osl::PieceMask::getMask(), osl::SimpleState::hasPieceOnStand(), osl::KNIGHT, osl::NumEffectState::piecesOnBoard(), osl::PieceMask::selectBit(), updateSquares(), and osl::WHITE.

## evalWithUpdate() [2/2]

template<Player P>

MultiIntPair osl::eval::ml::KnightFork::evalWithUpdate | ( | const NumEffectState & | state,
|  | Move | moved,
|  | CArray< BoardMask, 2 > & | knight_fork_squares,
|  | CArray< std::pair< Square, int >, 2 > & | knight_drop )

static

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

## index()

int osl::eval::ml::KnightFork::index | ( | Ptype | a,
|  | Ptype | b )

inline static

Definition at line 1692 of file minorPiece.h.

References osl::PTYPE_SIZE.

Referenced by accumulate(), evalOne(), and setUp().

## isForkSquare()

bool osl::eval::ml::KnightFork::isForkSquare | ( | const NumEffectState & | state,
|  | Player | defense,
|  | int | y,
|  | int | x0,
|  | int | x1 )

static

## isTarget()

bool osl::eval::ml::KnightFork::isTarget | ( | Ptype | ptype | ) |

inline static

Definition at line 1696 of file minorPiece.h.

References osl::KNIGHT, osl::LANCE, osl::PAWN, and osl::unpromote().

Referenced by updateSquares().

## setUp()

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

static

Definition at line 2651 of file minorPiece.cc.

References DROP_DIM, index(), osl::NStages, ONE_DIM, osl::PTYPE_SIZE, table, and osl::eval::ml::Weights::value().

## updateSquares()

template<osl::Player P, osl::Player Defense>

void osl::eval::ml::KnightFork::updateSquares | ( | const NumEffectState & | state,
|  | Move | moved,
|  | BoardMask & | knight_fork_squares )

static private

Definition at line 2786 of file minorPiece.cc.

References osl::BLACK, osl::Move::from(), osl::Move::isCapture(), osl::Move::isDrop(), osl::container::BoardMask::isInvalid(), isTarget(), osl::L, osl::Square::neighbor(), osl::Move::ptype(), osl::R, osl::container::BoardMask::reset(), osl::container::BoardMask::set(), osl::Move::to(), osl::U, osl::UUL, osl::UUR, osl::WHITE, osl::Square::x(), and osl::Square::y().

Referenced by evalWithUpdate().

## Member Data Documentation

## table

osl::CArray< osl::MultiInt, 256 *2 *2 > osl::eval::ml::KnightFork::table

static

Definition at line 1688 of file minorPiece.h.

Referenced by accumulate(), evalOne(), and setUp().

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

- minorPiece.h
- minorPiece.cc