osl::checkmate::King8Info Class Reference

敵玉の8近傍の状態を表す. More...

`#include <king8Info.h>`

## Public Member Functions

| King8Info (uint64_t v)
uint64_t | uint64Value () const
unsigned int | dropCandidate () const
| 0-7 bit 目を返す
unsigned int | liberty () const
| 8-15 bit 目を 0-7bitにshiftして返す
unsigned int | libertyDropMask () const
| 0-15bit
unsigned int | libertyCandidate () const
| 16-23 bit 目を 0-7bitにshiftして返す
unsigned int | moveCandidate2 () const
| 24-31 bit 目を 0-7bitにshiftして返す
unsigned int | spaces () const
unsigned int | moves () const
unsigned int | libertyCount () const
| libertyの数
template<Player P, Direction Dir>
unsigned int | moveCandidateDir (NumEffectState const &state, Square target) const
template<Player P>
unsigned int | countMoveCandidate (NumEffectState const &state) const
unsigned int | countMoveCandidate (Player player, NumEffectState const &state) const
template<Player P>
unsigned int | moveCandidateMask (NumEffectState const &state) const
template<Player P>
bool | hasMoveCandidate (NumEffectState const &state) const
template<osl::Player P>
const osl::checkmate::King8Info | make (NumEffectState const &state, Square target, PieceMask pinned)
template<osl::Player P>
const osl::checkmate::King8Info | make (NumEffectState const &state, Square target)

## Static Public Member Functions

template<Player P>
static const King8Info | make (NumEffectState const &state, Square king, PieceMask pinned)
template<Player P>
static const King8Info | make (NumEffectState const &state, Square king)
static const King8Info | make (Player attack, NumEffectState const &state)
| alt(attack) のking について計算
static const King8Info | makeWithPin (Player attack, NumEffectState const &state, const PieceMask &pinned)
| alt(attack) のking について計算.

## Static Private Member Functions

template<Player P, Direction Dir>
static uint64_t | hasEffectMask (NumEffectState const &state, Square target, PieceMask pinned, PieceMask on_board_defense)
| alt(P)の玉にDirの方向で迫るcanMoveMaskを計算する.

## Private Attributes

uint64_t | value

## Detailed Description

敵玉の8近傍の状態を表す.

王手がかかっている場合も含むことにする． Dirは相手の玉に対してDir方向で王手をかける位置 0-7 : 敵玉以外の利きがなく，自分の利きがある空白 (駒を打つ候補となりうる点) 8-15 : 敵玉がDirに移動可能(王手がかかっている場合は長い利きも延ばす) 16-23 : 空白か味方の駒(利き次第では移動可能になる) 24-31 : 敵玉以外の利きがなく，自分の利きがある空白，敵駒 (OLD 24-31 : 敵玉以外の利きがなく，自分の利きが2つ以上ある空白，敵駒 (駒を動かす候補となりうる点) ) 32-39 : 空白(駒打ち王手の候補) 40-47 : 味方の利き(kingの利きも含んでいる)がある空白，敵駒 48-51 : 敵玉がDirに移動可能(王手がかかっている場合は長い利きも延ばす)な数

Definition at line 28 of file king8Info.h.

## Constructor & Destructor Documentation

## King8Info()

osl::checkmate::King8Info::King8Info | ( | uint64_t | v | ) |

inline explicit

Definition at line 32 of file king8Info.h.

References value.

Referenced by make(), make(), and make().

## Member Function Documentation

## countMoveCandidate() [1/2]

template<Player P>

unsigned int osl::checkmate::King8Info::countMoveCandidate | ( | NumEffectState const & | state | ) | const

inline

Definition at line 95 of file king8Info.h.

References osl::alt(), osl::SimpleState::kingSquare(), and moveCandidateDir().

Referenced by countMoveCandidate(), and osl::checkmate::ProofNumberTable::disproofAfterAllCheck().

## countMoveCandidate() [2/2]

unsigned int osl::checkmate::King8Info::countMoveCandidate | ( | Player | player,
|  | NumEffectState const & | state ) const

inline

Definition at line 108 of file king8Info.h.

References osl::BLACK, and countMoveCandidate().

## dropCandidate()

unsigned int osl::checkmate::King8Info::dropCandidate | ( |  | ) | const

inline

0-7 bit 目を返す

Definition at line 49 of file king8Info.h.

References value.

Referenced by osl::eval::ml::CanCheckNonPawnPieceStandCombination::canCheck(), osl::checkmate::ProofNumberTable::disproofAfterAllCheck(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::rating::Threatmate::isCandidate(), and osl::checkmate::operator<<().

## hasEffectMask()

template<osl::Player P, osl::Direction Dir>

uint64_t osl::checkmate::King8Info::hasEffectMask | ( | NumEffectState const & | state,
|  | Square | target,
|  | PieceMask | pinned,
|  | PieceMask | on_board_defense )

static private

alt(P)の玉にDirの方向で迫るcanMoveMaskを計算する.

Parameters

  P(template) | - 攻撃側のplayer
  Dir(template) | - 敵玉に迫る方向(shortの8方向)
  state | - 初期状態
  target | - alt(P)の玉があるpotision

Definition at line 66 of file king8Info.cc.

References osl::alt(), osl::Piece::canMoveOn(), osl::NumEffectState::hasEffectAt(), osl::Piece::isEdge(), osl::Piece::isEmpty(), osl::Piece::isOnBoardByOwner(), and osl::SimpleState::pieceAt().

Referenced by make().

## hasMoveCandidate()

template<Player P>

bool osl::checkmate::King8Info::hasMoveCandidate | ( | NumEffectState const & | state | ) | const

inline

Definition at line 128 of file king8Info.h.

References osl::alt(), osl::SimpleState::kingSquare(), and moveCandidateDir().

Referenced by osl::eval::ml::CanCheckNonPawnPieceStandCombination::canCheck().

## liberty()

unsigned int osl::checkmate::King8Info::liberty | ( |  | ) | const

inline

8-15 bit 目を 0-7bitにshiftして返す

Definition at line 54 of file king8Info.h.

References value.

Referenced by osl::move_probability::KingBlockade::blockAll(), osl::checkmate::ProofNumberTable::countLiberty(), osl::checkmate::ProofNumberTable::countLibertyLong(), osl::checkmate::ProofNumberTable::countLibertyShortNotKnight(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::King8EffectAll::eval(), osl::eval::ml::KingXBlocked3::eval(), osl::eval::ml::KingXBothBlocked::eval(), osl::eval::ml::KingXBlockedBase::isBlocked(), osl::rating::Threatmate::isCandidate(), osl::move_classifier::PawnDropCheckmate< P >::isMember(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::KingBlockade::match(), osl::checkmate::operator<<(), and osl::checkmate::ImmediateCheckmateTable::ptypeDropMask().

## libertyCandidate()

unsigned int osl::checkmate::King8Info::libertyCandidate | ( |  | ) | const

inline

16-23 bit 目を 0-7bitにshiftして返す

Definition at line 64 of file king8Info.h.

References value.

Referenced by osl::checkmate::operator<<().

## libertyCount()

unsigned int osl::checkmate::King8Info::libertyCount | ( |  | ) | const

inline

libertyの数

Definition at line 82 of file king8Info.h.

References value.

Referenced by osl::checkmate::PureLibertyEstimator::attackH(), osl::checkmate::ProofNumberTable::countLiberty(), osl::checkmate::ProofNumberTable::libertyAfterAllDrop(), osl::move_probability::KingBlockade::match(), and osl::move_probability::PatternCommon::updateCacheOne().

## libertyDropMask()

unsigned int osl::checkmate::King8Info::libertyDropMask | ( |  | ) | const

inline

0-15bit

Definition at line 59 of file king8Info.h.

References value.

Referenced by osl::checkmate::ImmediateCheckmateTable::dropPtypeMask(), osl::move_probability::StateInfo::findCheckmateDefender(), and osl::checkmate::ProofNumberTable::libertyAfterAllDrop().

## make() [1/5]

template<Player P>

const King8Info osl::checkmate::King8Info::make | ( | NumEffectState const & | state,
|  | Square | king )

static

References King8Info().

## make() [2/5]

template<Player P>

const King8Info osl::checkmate::King8Info::make | ( | NumEffectState const & | state,
|  | Square | king,
|  | PieceMask | pinned )

static

References King8Info().

Referenced by make(), make(), and makeWithPin().

## make() [3/5]

template<osl::Player P>

const osl::checkmate::King8Info osl::checkmate::King8Info::make | ( | NumEffectState const & | state,
|  | Square | target )

Definition at line 142 of file king8Info.cc.

References osl::alt(), make(), and osl::NumEffectState::pin().

## make() [4/5]

template<osl::Player P>

const osl::checkmate::King8Info osl::checkmate::King8Info::make | ( | NumEffectState const & | state,
|  | Square | target,
|  | PieceMask | pinned )

Definition at line 111 of file king8Info.cc.

References osl::alt(), osl::misc::GeneralMask< Integer >::any(), osl::Board_Table, hasEffectMask(), King8Info(), osl::NumEffectState::longEffectAt(), osl::SimpleState::pieceOf(), osl::NumEffectState::piecesOnBoard(), osl::PieceMask::reset(), osl::Piece::square(), and osl::misc::GeneralMask< Integer >::takeOneBit().

## make() [5/5]

const osl::checkmate::King8Info osl::checkmate::King8Info::make | ( | Player | attack,
|  | NumEffectState const & | state )

static

alt(attack) のking について計算

Definition at line 148 of file king8Info.cc.

References osl::alt(), osl::BLACK, osl::SimpleState::kingSquare(), and make().

## makeWithPin()

const osl::checkmate::King8Info osl::checkmate::King8Info::makeWithPin | ( | Player | attack,
|  | NumEffectState const & | state,
|  | const PieceMask & | pinned )

static

alt(attack) のking について計算.

pinが既に求まっている

Definition at line 158 of file king8Info.cc.

References osl::alt(), osl::BLACK, osl::SimpleState::kingSquare(), and make().

## moveCandidate2()

unsigned int osl::checkmate::King8Info::moveCandidate2 | ( |  | ) | const

inline

24-31 bit 目を 0-7bitにshiftして返す

Definition at line 69 of file king8Info.h.

References value.

Referenced by osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::rating::Threatmate::isCandidate(), and osl::checkmate::operator<<().

## moveCandidateDir()

template<Player P, Direction Dir>

unsigned int osl::checkmate::King8Info::moveCandidateDir | ( | NumEffectState const & | state,
|  | Square | target ) const

inline

Definition at line 87 of file king8Info.h.

References osl::NumEffectState::countEffect(), osl::effect_util::AdditionalEffect::hasEffect(), and value.

Referenced by countMoveCandidate(), hasMoveCandidate(), and moveCandidateMask().

## moveCandidateMask()

template<Player P>

unsigned int osl::checkmate::King8Info::moveCandidateMask | ( | NumEffectState const & | state | ) | const

inline

Definition at line 114 of file king8Info.h.

References osl::alt(), osl::D, osl::DL, osl::DR, osl::SimpleState::kingSquare(), osl::L, moveCandidateDir(), osl::R, osl::U, osl::UL, and osl::UR.

Referenced by osl::checkmate::ProofNumberTable::libertyAfterAllMove().

## moves()

unsigned int osl::checkmate::King8Info::moves | ( |  | ) | const

inline

Definition at line 77 of file king8Info.h.

References value.

## spaces()

unsigned int osl::checkmate::King8Info::spaces | ( |  | ) | const

inline

Definition at line 73 of file king8Info.h.

References value.

Referenced by osl::move_probability::StateInfo::findCheckmateDefender().

## uint64Value()

uint64_t osl::checkmate::King8Info::uint64Value | ( |  | ) | const

inline

Definition at line 46 of file king8Info.h.

References value.

Referenced by osl::NumEffectState::isConsistent(), osl::NumEffectState::makeKing8Info(), and osl::checkmate::EdgeTable::resetEdgeFromLiberty().

## Member Data Documentation

## value

uint64_t osl::checkmate::King8Info::value

private

Definition at line 30 of file king8Info.h.

Referenced by dropCandidate(), King8Info(), liberty(), libertyCandidate(), libertyCount(), libertyDropMask(), moveCandidate2(), moveCandidateDir(), moves(), spaces(), and uint64Value().

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

- king8Info.h
- king8Info.cc