osl::move_probability::StateInfo Struct Reference

`#include <stateInfo.h>`

## Public Types

typedef FixedCapacityVector< int, 8 > | long_attack_t
typedef CArray< int, 16 > | pattern_square_t
typedef FixedCapacityVector< PinnedGeneral, 64 > | pinned_gs_t

## Public Member Functions

| StateInfo ()
| StateInfo (const NumEffectState &s, Progress16 p, const MoveStack &h, Move t=Move())
void | reset0 (const NumEffectState &s, Progress16 p)
void | reset1 (const MoveStack &h)
void | finishUpdate ()
void | reset (const NumEffectState &s, Progress16 p, const MoveStack &h, Move threatmate_move=Move())
void | setThreatmate (Move move)
bool | pinByOpposingSliders (Piece p) const
King8Info | king8Info (Player pl) const
int | progress8 () const

## Static Public Member Functions

static std::pair< Piece, Square > | findCheckmateDefender (const NumEffectState &state, Player king)
static Move | findShortThreatmate (const NumEffectState &, Move last_move)

## Public Attributes

const NumEffectState * | state
const MoveStack * | history
Progress16 | progress16
PieceVector | pin_by_opposing_sliders
PieceVector | king8_long_pieces
CArray< Piece, 2 > | threatened
CArray2d< long_attack_t, 40, 8 > | long_attack_cache
CArray< pattern_square_t, Square::SIZE > | pattern_cache
CArray2d< bool, 40, 2 > | attack_shadow
PieceMask | last_add_effect
Ptype | last_move_ptype5
CArray< PieceMask, 2 > | pin
Move | threatmate_move
Square8 | sendoffs
CArray< pinned_gs_t, 2 > | exchange_pins
CArray< bool, 2 > | move_candidate_exists
NumEffectState | copy
BoardMask | changed_effects
CArray< std::pair< Piece, Square >, 2 > | checkmate_defender
unsigned int | possible_threatmate_ptype
CArray< Move, 2 > | bookmove
bool | dirty

## Private Member Functions

void | clearOldCache ()
void | updateDelayed ()
void | makePinOfLongPieces ()
void | makeLongAttacks ()
void | updatePinnedGenerals (Player owner)

## Detailed Description

Definition at line 20 of file stateInfo.h.

## Member Typedef Documentation

## long_attack_t

typedef FixedCapacityVector<int,8> osl::move_probability::StateInfo::long_attack_t

Definition at line 27 of file stateInfo.h.

## pattern_square_t

typedef CArray<int,16> osl::move_probability::StateInfo::pattern_square_t

Definition at line 29 of file stateInfo.h.

## pinned_gs_t

typedef FixedCapacityVector<PinnedGeneral,64> osl::move_probability::StateInfo::pinned_gs_t

Definition at line 37 of file stateInfo.h.

## Constructor & Destructor Documentation

## StateInfo() [1/2]

osl::move_probability::StateInfo::StateInfo | ( |  | ) |

inline

Definition at line 47 of file stateInfo.h.

References dirty, history, progress16, and state.

## StateInfo() [2/2]

osl::move_probability::StateInfo::StateInfo | ( | const NumEffectState & | s,
|  | Progress16 | p,
|  | const MoveStack & | h,
|  | Move | t = Move() )

inline

Definition at line 50 of file stateInfo.h.

References clearOldCache(), dirty, finishUpdate(), history, progress16, state, and threatmate_move.

## Member Function Documentation

## clearOldCache()

void osl::move_probability::StateInfo::clearOldCache | ( |  | ) |

private

Definition at line 13 of file stateInfo.cc.

References osl::alt(), attack_shadow, osl::BLACK, osl::Board_Table, bookmove, changed_effects, checkmate_defender, findCheckmateDefender(), osl::checkmate::Immediate_Checkmate_Table, king8Info(), osl::KNIGHT, move_candidate_exists, pin, possible_threatmate_ptype, osl::PTYPE_BASIC_MIN, osl::PTYPE_MAX, sendoffs, state, threatened, threatmate_move, osl::UUL, osl::UUR, and osl::WHITE.

Referenced by reset0(), and StateInfo().

## findCheckmateDefender()

std::pair< osl::Piece, osl::Square > osl::move_probability::StateInfo::findCheckmateDefender | ( | const NumEffectState & | state,
|  | Player | king )

static

Definition at line 159 of file stateInfo.cc.

References osl::alt(), osl::misc::GeneralMask< Integer >::any(), osl::Board_Table, osl::misc::BitOp::bsf(), osl::Piece::EMPTY(), osl::checkmate::Immediate_Checkmate_Table, osl::checkmate::King8Info::libertyDropMask(), osl::misc::GeneralMask< mask_int_t >::makeDirect(), osl::PTYPE_BASIC_MIN, osl::checkmate::King8Info::spaces(), state, and osl::misc::GeneralMask< Integer >::takeOneBit().

Referenced by clearOldCache().

## findShortThreatmate()

osl::Move osl::move_probability::StateInfo::findShortThreatmate | ( | const NumEffectState & | state,
|  | Move | last_move )

static

Definition at line 221 of file stateInfo.cc.

References osl::alt(), copy, osl::GOLD, osl::checkmate::FixedDepthSearcher::hasCheckmateMoveOfTurn(), osl::Neighboring8Direct::hasEffect(), osl::checkmate::ProofDisproof::isCheckmateSuccess(), osl::checkmate::ProofDisproof::isFinal(), osl::Move::isNormal(), osl::Move::ptypeO(), state, and osl::Move::to().

## finishUpdate()

void osl::move_probability::StateInfo::finishUpdate | ( |  | ) |

Definition at line 58 of file stateInfo.cc.

References osl::alt(), osl::BLACK, bookmove, copy, dirty, osl::effect_util::SendOffSquare::find(), osl::GOLD, history, osl::BookInMemory::instance(), osl::isMajor(), osl::Piece::isOnBoardByOwner(), king8_long_pieces, osl::KNIGHT, osl::LANCE, last_add_effect, last_move_ptype5, makePinOfLongPieces(), osl::PTYPE_EMPTY, sendoffs, osl::SHORT8_DIRECTION_MAX, osl::SHORT8_DIRECTION_MIN, osl::SILVER, osl::FixedCapacityVector< T, Capacity >::size(), state, osl::unpromote(), osl::move_probability::BlockLong::updateCache(), osl::move_probability::PatternCommon::updateCache(), updatePinnedGenerals(), and osl::WHITE.

Referenced by reset(), and StateInfo().

## king8Info()

King8Info osl::move_probability::StateInfo::king8Info | ( | Player | pl | ) | const

inline

Definition at line 88 of file stateInfo.h.

References state.

Referenced by clearOldCache(), and osl::move_probability::KingBlockade::match().

## makeLongAttacks()

void osl::move_probability::StateInfo::makeLongAttacks | ( |  | ) |

private

## makePinOfLongPieces()

void osl::move_probability::StateInfo::makePinOfLongPieces | ( |  | ) |

private

Definition at line 102 of file stateInfo.cc.

References osl::BLACK, osl::D, osl::DL, osl::DR, osl::PtypeFuns< T >::indexMask, osl::Piece::isOnBoard(), osl::isPiece(), osl::KING, osl::L, osl::misc::GeneralMask< mask_int_t >::makeDirect(), pin_by_opposing_sliders, osl::Piece::ptype(), osl::R, osl::Piece::square(), state, osl::U, osl::UL, osl::UR, and osl::WHITE.

Referenced by finishUpdate().

## pinByOpposingSliders()

bool osl::move_probability::StateInfo::pinByOpposingSliders | ( | Piece | p | ) | const

inline

Definition at line 83 of file stateInfo.h.

References pin_by_opposing_sliders.

Referenced by osl::move_probability::MoveInfo::adhocAdjustSlider(), osl::move_probability::AttackFromOpposingSliders::match(), and osl::move_probability::MoveFromOpposingSliders::match().

## progress8()

int osl::move_probability::StateInfo::progress8 | ( |  | ) | const

inline

Definition at line 92 of file stateInfo.h.

References progress16.

Referenced by osl::move_probability::StandardFeatureSet::logProbSeePlus(), osl::move_probability::StandardFeatureSet::logProbTakeBack(), osl::move_probability::KingRelativeX::match(), osl::move_probability::KingRelativeY::match(), osl::move_probability::SeeFeature::match(), osl::move_probability::SquareX::match(), and osl::move_probability::SquareY::match().

## reset()

void osl::move_probability::StateInfo::reset | ( | const NumEffectState & | s,
|  | Progress16 | p,
|  | const MoveStack & | h,
|  | Move | threatmate_move = Move() )

inline

Definition at line 73 of file stateInfo.h.

References finishUpdate(), reset0(), reset1(), setThreatmate(), and threatmate_move.

## reset0()

void osl::move_probability::StateInfo::reset0 | ( | const NumEffectState & | s,
|  | Progress16 | p )

inline

Definition at line 58 of file stateInfo.h.

References clearOldCache(), dirty, king8_long_pieces, long_attack_cache, pin_by_opposing_sliders, progress16, and state.

Referenced by reset().

## reset1()

void osl::move_probability::StateInfo::reset1 | ( | const MoveStack & | h | ) |

inline

Definition at line 68 of file stateInfo.h.

References history.

Referenced by reset().

## setThreatmate()

void osl::move_probability::StateInfo::setThreatmate | ( | Move | move | ) |

inline

Definition at line 81 of file stateInfo.h.

References threatmate_move.

Referenced by reset().

## updateDelayed()

void osl::move_probability::StateInfo::updateDelayed | ( |  | ) |

private

## updatePinnedGenerals()

void osl::move_probability::StateInfo::updatePinnedGenerals | ( | Player | owner | ) |

private

Definition at line 184 of file stateInfo.cc.

References osl::alt(), osl::PieceMask::any(), osl::Board_Table, osl::misc::BitOp::bsf(), exchange_pins, osl::Piece::isEmpty(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::PAWN, osl::Piece::ptype(), osl::Ptype_Table, osl::Piece::ptypeO(), osl::Piece::square(), state, and osl::container::PieceMask64::takeOneBit().

Referenced by finishUpdate().

## Member Data Documentation

## attack_shadow

CArray2d<bool,40,2> osl::move_probability::StateInfo::attack_shadow

Definition at line 31 of file stateInfo.h.

Referenced by clearOldCache(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::operator==(), and osl::move_probability::PatternCommon::updateCacheOne().

## bookmove

CArray<Move,2> osl::move_probability::StateInfo::bookmove

Definition at line 44 of file stateInfo.h.

Referenced by clearOldCache(), finishUpdate(), and osl::move_probability::BookMove::match().

## changed_effects

BoardMask osl::move_probability::StateInfo::changed_effects

Definition at line 41 of file stateInfo.h.

Referenced by clearOldCache(), and osl::move_probability::PatternCommon::updateCacheOne().

## checkmate_defender

CArray<std::pair<Piece,Square>,2> osl::move_probability::StateInfo::checkmate_defender

Definition at line 42 of file stateInfo.h.

Referenced by osl::move_probability::MoveInfo::adhocAdjustAttackCheckmateDefender(), osl::move_probability::MoveInfo::adhocAdjustKeepCheckmateDefender(), clearOldCache(), and osl::move_probability::operator==().

## copy

NumEffectState osl::move_probability::StateInfo::copy

mutable

Definition at line 40 of file stateInfo.h.

Referenced by findShortThreatmate(), finishUpdate(), osl::move_probability::CheckmateIfCapture::match(), and osl::move_probability::operator==().

## dirty

bool osl::move_probability::StateInfo::dirty

Definition at line 45 of file stateInfo.h.

Referenced by finishUpdate(), osl::move_probability::FeatureSet::generateRating(), reset0(), StateInfo(), and StateInfo().

## exchange_pins

CArray<pinned_gs_t,2> osl::move_probability::StateInfo::exchange_pins

Definition at line 38 of file stateInfo.h.

Referenced by osl::move_probability::LureDefender::match(), osl::move_probability::operator==(), and updatePinnedGenerals().

## history

const MoveStack* osl::move_probability::StateInfo::history

Definition at line 23 of file stateInfo.h.

Referenced by finishUpdate(), osl::move_probability::ContinueCapture::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::DropCaptured::match(), osl::move_probability::SacrificeAttack::match(), osl::move_probability::TakeBackFeature::match(), osl::move_probability::operator==(), reset1(), StateInfo(), StateInfo(), and osl::move_probability::PatternCommon::updateCacheOne().

## king8_long_pieces

PieceVector osl::move_probability::StateInfo::king8_long_pieces

Definition at line 25 of file stateInfo.h.

Referenced by finishUpdate(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::operator==(), and reset0().

## last_add_effect

PieceMask osl::move_probability::StateInfo::last_add_effect

Definition at line 32 of file stateInfo.h.

Referenced by finishUpdate(), osl::move_probability::operator==(), and osl::move_probability::PatternCommon::updateCacheOne().

## last_move_ptype5

Ptype osl::move_probability::StateInfo::last_move_ptype5

Definition at line 33 of file stateInfo.h.

Referenced by finishUpdate(), osl::move_probability::operator==(), and osl::move_probability::PatternCommon::updateCacheOne().

## long_attack_cache

CArray2d<long_attack_t,40,8> osl::move_probability::StateInfo::long_attack_cache

Definition at line 28 of file stateInfo.h.

Referenced by osl::move_probability::BlockLong::addPiece(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::operator==(), and reset0().

## move_candidate_exists

CArray<bool,2> osl::move_probability::StateInfo::move_candidate_exists

Definition at line 39 of file stateInfo.h.

Referenced by clearOldCache(), osl::move_probability::CheckmateIfCapture::match(), and osl::move_probability::operator==().

## pattern_cache

CArray<pattern_square_t,Square::SIZE> osl::move_probability::StateInfo::pattern_cache

Definition at line 30 of file stateInfo.h.

Referenced by osl::move_probability::PatternCommon::addOne(), osl::move_probability::BishopAttack::addSquare(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::operator==(), and osl::move_probability::PatternCommon::updateCacheOne().

## pin

CArray<PieceMask,2> osl::move_probability::StateInfo::pin

Definition at line 34 of file stateInfo.h.

Referenced by clearOldCache(), osl::move_probability::operator==(), osl::move_probability::ToEffect::supportAttack(), and osl::move_probability::PatternCommon::updateCacheOne().

## pin_by_opposing_sliders

PieceVector osl::move_probability::StateInfo::pin_by_opposing_sliders

Definition at line 25 of file stateInfo.h.

Referenced by makePinOfLongPieces(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::AttackToOpposingSliders::match(), osl::move_probability::operator==(), pinByOpposingSliders(), and reset0().

## possible_threatmate_ptype

unsigned int osl::move_probability::StateInfo::possible_threatmate_ptype

Definition at line 43 of file stateInfo.h.

Referenced by clearOldCache(), and osl::move_probability::ThreatmateByCapture::match().

## progress16

Progress16 osl::move_probability::StateInfo::progress16

Definition at line 24 of file stateInfo.h.

Referenced by osl::move_probability::operator==(), progress8(), reset0(), StateInfo(), and StateInfo().

## sendoffs

Square8 osl::move_probability::StateInfo::sendoffs

Definition at line 36 of file stateInfo.h.

Referenced by clearOldCache(), finishUpdate(), osl::move_probability::SendOff::match(), and osl::move_probability::operator==().

## state

const NumEffectState* osl::move_probability::StateInfo::state

Definition at line 22 of file stateInfo.h.

Referenced by osl::move_probability::AddEffectLong::addOne(), osl::move_probability::BishopAttack::addOne(), osl::move_probability::King5x5Ptype::addOne(), osl::move_probability::PatternCommon::addOne(), osl::move_probability::BlockLong::addPiece(), osl::move_probability::MoveInfo::adhocAdjustAttackCheckmateDefender(), osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::move_probability::MoveInfo::adhocAdjustBreakThreatmate(), osl::move_probability::MoveInfo::adhocAdjustKeepCheckmateDefender(), osl::move_probability::MoveInfo::adhocAdjustSlider(), clearOldCache(), osl::move_probability::BlockLong::findAll(), osl::move_probability::BlockLong::findAll(), findCheckmateDefender(), findShortThreatmate(), finishUpdate(), osl::move_probability::FeatureSet::generateRating(), king8Info(), osl::move_probability::BlockLong::makeLongAttackOne(), makePinOfLongPieces(), osl::move_probability::AttackFromOpposingSliders::match(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::AttackToOpposingSliders::match(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::CapturePtype::match(), osl::move_probability::CheckFeature::match(), osl::move_probability::CheckmateIfCapture::match(), osl::move_probability::CoverFork::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::FromEffect::match(), osl::move_probability::FromEffectLong::match(), osl::move_probability::King5x5Ptype::match(), osl::move_probability::KingBlockade::match(), osl::move_probability::KingRelativeX::match(), osl::move_probability::KingRelativeY::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::LongRecapture::match(), osl::move_probability::LureDefender::match(), osl::move_probability::MoveFromOpposingSliders::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::PawnAttack::match(), osl::move_probability::PromotionBySacrifice::match(), osl::move_probability::RookAttack::match(), osl::move_probability::SacrificeAttack::match(), osl::move_probability::ToEffectLong::match(), osl::move_probability::PawnAttack::matchPtype(), osl::move_probability::operator==(), reset0(), StateInfo(), StateInfo(), osl::move_probability::ToEffect::supportAttack(), osl::move_probability::BlockLong::updateCache(), osl::move_probability::PatternCommon::updateCacheOne(), and updatePinnedGenerals().

## threatened

CArray<Piece,2> osl::move_probability::StateInfo::threatened

Definition at line 26 of file stateInfo.h.

Referenced by clearOldCache(), osl::move_probability::CapturePtype::match(), osl::move_probability::EscapeThreatened::match(), and osl::move_probability::operator==().

## threatmate_move

Move osl::move_probability::StateInfo::threatmate_move

Definition at line 35 of file stateInfo.h.

Referenced by osl::move_probability::MoveInfo::adhocAdjustBreakThreatmate(), clearOldCache(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::PromotionBySacrifice::match(), osl::move_probability::operator==(), reset(), setThreatmate(), and StateInfo().

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

- stateInfo.h
- stateInfo.cc