osl::eval::ml::NonPawnAttacked Class Reference

`#include <minorPiece.h>`

## Public Types

enum | { ONE_DIM = 64 , DIM = ONE_DIM * EvalStages }

## Static Public Member Functions

static void | setUp (const Weights &weights)
static void | eval (const NumEffectState &state, MultiIntPair &out)
template<Player P>
static void | evalWithUpdateBang (const NumEffectState &state, Move moved, const CArray< PieceMask, 2 > &effected_mask, MultiIntPair &last_value_and_out)
template<int Sign>
static void | adjust (int black_turn_king_attack, int black_turn_king_defense, int white_turn_king_attack, int white_turn_king_defense, MultiIntPair &result)

## Static Private Member Functions

static int | index (bool same_turn, bool has_support, Ptype ptype)
template<bool Attack>
static int | indexK (Square king, bool same_turn, bool has_support, Square position, Player owner, Ptype ptype)
template<bool Attack>
static int | indexK (Square king, bool same_turn, bool has_support, Piece piece)
template<Player Attacked>
static void | updateEffectChanged (const NumEffectState &state, const CArray< PieceMask, 2 > &effected_mask, const CArray< PieceMask, 2 > &new_mask, int moved_piece_number, MultiIntPair &result)

## Static Private Attributes

static CArray< MultiInt, 64 > | table
static CArray< MultiInt, 19584 > | king_table

## Friends

class | NonPawnAttackedKingRelative

## Detailed Description

Definition at line 909 of file minorPiece.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
ONE_DIM |
DIM |

Definition at line 913 of file minorPiece.h.

## Member Function Documentation

## adjust()

template<int Sign>

void osl::eval::ml::NonPawnAttacked::adjust | ( | int | black_turn_king_attack,
|  | int | black_turn_king_defense,
|  | int | white_turn_king_attack,
|  | int | white_turn_king_defense,
|  | MultiIntPair & | result )

static

Definition at line 1134 of file minorPiece.cc.

References osl::BLACK, king_table, and osl::WHITE.

Referenced by eval(), evalWithUpdateBang(), and updateEffectChanged().

## eval()

void osl::eval::ml::NonPawnAttacked::eval | ( | const NumEffectState & | state,
|  | MultiIntPair & | out )

static

Definition at line 1155 of file minorPiece.cc.

References adjust(), osl::PieceMask::any(), osl::BLACK, osl::PieceMask::clearBit(), osl::NumEffectState::effectedMask(), osl::PieceMask::getMask(), osl::KingTraits< T >::index, indexK(), osl::SimpleState::kingSquare(), osl::PieceMask::orMask(), osl::PAWN, osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::NumEffectState::promotedPieces(), osl::PieceMask::reset(), osl::PieceMask::selectBit(), osl::container::PieceMask64::takeOneBit(), and osl::WHITE.

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

## evalWithUpdateBang()

template<osl::Player P>

template void osl::eval::ml::NonPawnAttacked::evalWithUpdateBang< WHITE > | ( | const NumEffectState & | state,
|  | Move | moved,
|  | const CArray< PieceMask, 2 > & | effected_mask,
|  | MultiIntPair & | last_value_and_out )

static

Definition at line 1239 of file minorPiece.cc.

References adjust(), osl::alt(), osl::BLACK, osl::captured(), osl::Move::capturePtype(), osl::NumEffectState::effectedMask(), eval(), osl::Move::from(), indexK(), osl::Move::isDrop(), osl::KING, osl::SimpleState::kingSquare(), osl::Piece::number(), osl::Move::oldPtype(), osl::Piece::owner(), osl::PAWN, osl::SimpleState::pieceAt(), osl::NumEffectState::promotedPieces(), osl::Move::ptype(), osl::PTYPE_EMPTY, osl::container::PieceMask64::takeOneBit(), osl::Move::to(), updateEffectChanged(), and osl::WHITE.

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

## index()

int osl::eval::ml::NonPawnAttacked::index | ( | bool | same_turn,
|  | bool | has_support,
|  | Ptype | ptype )

inline static private

Definition at line 929 of file minorPiece.h.

References osl::PTYPE_SIZE.

## indexK() [1/2]

template<bool Attack>

int osl::eval::ml::NonPawnAttacked::indexK | ( | Square | king,
|  | bool | same_turn,
|  | bool | has_support,
|  | Piece | piece )

inline static private

Definition at line 947 of file minorPiece.h.

References indexK(), osl::Piece::owner(), osl::Piece::ptype(), and osl::Piece::square().

## indexK() [2/2]

template<bool Attack>

int osl::eval::ml::NonPawnAttacked::indexK | ( | Square | king,
|  | bool | same_turn,
|  | bool | has_support,
|  | Square | position,
|  | Player | owner,
|  | Ptype | ptype )

inline static private

Definition at line 935 of file minorPiece.h.

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

Referenced by eval(), evalWithUpdateBang(), indexK(), and updateEffectChanged().

## setUp()

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

static

Definition at line 1102 of file minorPiece.cc.

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

## updateEffectChanged()

template<Player Attacked>

void osl::eval::ml::NonPawnAttacked::updateEffectChanged | ( | const NumEffectState & | state,
|  | const CArray< PieceMask, 2 > & | effected_mask,
|  | const CArray< PieceMask, 2 > & | new_mask,
|  | int | moved_piece_number,
|  | MultiIntPair & | result )

inline static private

Definition at line 956 of file minorPiece.h.

References adjust(), osl::alt(), osl::PieceMask::any(), osl::BLACK, indexK(), osl::SimpleState::kingSquare(), osl::Piece::number(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::PieceMask::reset(), osl::container::PieceMask64::takeOneBit(), and osl::WHITE.

Referenced by evalWithUpdateBang().

## Friends And Related Symbol Documentation

## NonPawnAttackedKingRelative

friend class NonPawnAttackedKingRelative

friend

Definition at line 911 of file minorPiece.h.

References NonPawnAttackedKingRelative.

Referenced by NonPawnAttackedKingRelative.

## Member Data Documentation

## king_table

osl::CArray< MultiInt, 19584 > osl::eval::ml::NonPawnAttacked::king_table

static private

Definition at line 1075 of file minorPiece.h.

Referenced by adjust(), and osl::eval::ml::NonPawnAttackedKingRelative::setUp().

## table

osl::CArray< MultiInt, 64 > osl::eval::ml::NonPawnAttacked::table

static private

Definition at line 1074 of file minorPiece.h.

Referenced by setUp(), and osl::eval::ml::NonPawnAttackedKingRelative::setUp().

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

- minorPiece.h
- minorPiece.cc