osl::move_probability::StateInfo Struct Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
osl::move_probability::StateInfo Struct Reference

`#include <stateInfo.h>`

Collaboration diagram for osl::move_probability::StateInfo:
[legend]

## 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 21 of file stateInfo.h.

## Member Typedef Documentation

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

Definition at line 28 of file stateInfo.h.

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

Definition at line 30 of file stateInfo.h.

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

Definition at line 38 of file stateInfo.h.

## Constructor & Destructor Documentation

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

Definition at line 48 of file stateInfo.h.

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

Definition at line 51 of file stateInfo.h.

References clearOldCache(), finishUpdate(), and threatmate_move.

## Member Function Documentation

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

Definition at line 14 of file stateInfo.cc.

References osl::alt(), osl::BLACK, osl::Board_Table, osl::checkmate::ImmediateCheckmateTable::dropPtypeMask(), osl::BoardTable::getOffset(), osl::checkmate::Immediate_Checkmate_Table, osl::KNIGHT, osl::PTYPE_BASIC_MIN, osl::PTYPE_MAX, osl::UUL, osl::UUR, and osl::WHITE.

Referenced by reset0(), and StateInfo().

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

Definition at line 160 of file stateInfo.cc.

References osl::alt(), osl::Board_Table, osl::misc::BitOp::bsf(), osl::Piece::EMPTY(), osl::BoardTable::getOffset(), osl::checkmate::Immediate_Checkmate_Table, osl::checkmate::King8Info::libertyDropMask(), osl::PTYPE_BASIC_MIN, and osl::checkmate::King8Info::spaces().

Referenced by makePinOfLongPieces().

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

Definition at line 222 of file stateInfo.cc.

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

Referenced by osl::game_playing::UsiResponse::genmoveProbability().

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

Definition at line 59 of file stateInfo.cc.

References osl::alt(), osl::BLACK, book(), osl::find(), osl::GOLD, osl::isMajor(), osl::Piece::isOnBoardByOwner(), osl::KNIGHT, osl::LANCE, osl::PTYPE_EMPTY, osl::SHORT8_DIRECTION_MAX, osl::SHORT8_DIRECTION_MIN, osl::SILVER, osl::unpromote(), and osl::WHITE.

Referenced by reset(), and StateInfo().

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

Definition at line 89 of file stateInfo.h.

References state.

Referenced by osl::move_probability::KingBlockade::match().

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

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

Definition at line 103 of file stateInfo.cc.

References osl::BLACK, osl::D, osl::DL, osl::DR, findCheckmateDefender(), osl::Piece::isOnBoard(), osl::isPiece(), osl::KING, osl::L, osl::Piece::ptype(), osl::R, osl::Piece::square(), osl::U, osl::UL, osl::UR, and osl::WHITE.

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

Definition at line 84 of file stateInfo.h.

References osl::find(), and pin_by_opposing_sliders.

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

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

Definition at line 93 of file stateInfo.h.

References progress16.

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

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

Definition at line 74 of file stateInfo.h.

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

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

Definition at line 59 of file stateInfo.h.

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

Referenced by reset().

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

Definition at line 69 of file stateInfo.h.

References history.

Referenced by reset().

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

Definition at line 82 of file stateInfo.h.

References threatmate_move.

Referenced by reset().

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

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

Definition at line 185 of file stateInfo.cc.

References osl::alt(), osl::Board_Table, osl::misc::BitOp::bsf(), osl::PtypeTable::getMoveMask(), osl::BoardTable::getOffset(), osl::Piece::isEmpty(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::PAWN, osl::Piece::ptype(), osl::Ptype_Table, osl::Piece::ptypeO(), osl::Piece::square(), and target.

## Member Data Documentation

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

Definition at line 32 of file stateInfo.h.

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

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

Definition at line 45 of file stateInfo.h.

Referenced by osl::move_probability::BookMove::match().

BoardMask osl::move_probability::StateInfo::changed_effects

Definition at line 42 of file stateInfo.h.

Referenced by osl::move_probability::PatternCommon::updateCacheOne().

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

Definition at line 43 of file stateInfo.h.

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

NumEffectState osl::move_probability::StateInfo::copy
| mutable

Definition at line 41 of file stateInfo.h.

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

bool osl::move_probability::StateInfo::dirty

Definition at line 46 of file stateInfo.h.

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

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

Definition at line 39 of file stateInfo.h.

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

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

Definition at line 24 of file stateInfo.h.

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

PieceVector osl::move_probability::StateInfo::king8_long_pieces

Definition at line 26 of file stateInfo.h.

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

PieceMask osl::move_probability::StateInfo::last_add_effect

Definition at line 33 of file stateInfo.h.

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

Ptype osl::move_probability::StateInfo::last_move_ptype5

Definition at line 34 of file stateInfo.h.

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

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

Definition at line 29 of file stateInfo.h.

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

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

Definition at line 40 of file stateInfo.h.

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

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

Definition at line 31 of file stateInfo.h.

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

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

Definition at line 35 of file stateInfo.h.

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

PieceVector osl::move_probability::StateInfo::pin_by_opposing_sliders

Definition at line 26 of file stateInfo.h.

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

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

Definition at line 44 of file stateInfo.h.

Referenced by osl::move_probability::ThreatmateByCapture::match().

Progress16 osl::move_probability::StateInfo::progress16

Definition at line 25 of file stateInfo.h.

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

Square8 osl::move_probability::StateInfo::sendoffs

Definition at line 37 of file stateInfo.h.

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

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

Definition at line 23 of file stateInfo.h.

Referenced by osl::move_probability::PatternCommon::addOne(), osl::move_probability::AddEffectLong::addOne(), osl::move_probability::BishopAttack::addOne(), osl::move_probability::King5x5Ptype::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(), osl::move_probability::BlockLong::findAll(), osl::move_probability::FeatureSet::generateRating(), king8Info(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::CheckFeature::match(), osl::move_probability::CapturePtype::match(), osl::move_probability::KingRelativeY::match(), osl::move_probability::KingRelativeX::match(), osl::move_probability::FromEffect::match(), osl::move_probability::FromEffectLong::match(), osl::move_probability::ToEffectLong::match(), osl::move_probability::MoveFromOpposingSliders::match(), osl::move_probability::AttackFromOpposingSliders::match(), osl::move_probability::AttackToOpposingSliders::match(), osl::move_probability::PawnAttack::match(), osl::move_probability::LongRecapture::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::LureDefender::match(), osl::move_probability::CheckmateIfCapture::match(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::SacrificeAttack::match(), osl::move_probability::King5x5Ptype::match(), osl::move_probability::KingBlockade::match(), osl::move_probability::CoverFork::match(), osl::move_probability::PromotionBySacrifice::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::PawnAttack::matchPtype(), osl::move_probability::operator==(), reset0(), osl::move_probability::ToEffect::supportAttack(), osl::move_probability::BlockLong::updateCache(), and osl::move_probability::PatternCommon::updateCacheOne().

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

Definition at line 27 of file stateInfo.h.

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

Move osl::move_probability::StateInfo::threatmate_move

Definition at line 36 of file stateInfo.h.

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

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

- stateInfo.h
- stateInfo.cc