osl::PieceMask Class Reference

駒番号のビットセット. More...

`#include <pieceMask.h>`

Inheritance diagram for osl::PieceMask:

## Public Member Functions

| PieceMask ()
| PieceMask (const PieceMaskBase &base)
void | setMask (int index, mask_t val)
void | xorMask (int index, mask_t val)
void | orMask (int index, mask_t val)
bool | test (int num) const
void | set (int num)
void | flip (int num)
void | reset (int num)
bool | any () const
const mask_t | getMask (int num) const
template<Ptype PTYPE>
const mask_t | getMask () const
| unpromote(PTYPE) の駒のbit を*含む*mask_tを取り出す
template<Ptype PTYPE>
const mask_t | selectBit () const
| unpromote(PTYPE) の駒のbit だけ取り出す
template<Ptype PTYPE>
void | clearBit ()
| unpromote(PTYPE) の駒のbit を消す
template<Ptype PTYPE>
void | setBit ()
| unpromote(PTYPE) の駒のbit を立てる
Public Member Functions inherited from osl::container::PieceMask64
| PieceMask64 ()
| PieceMask64 (misc::Mask64 const &m)
const misc::Mask64 & | getMask (int) const
void | resetAll ()
void | setAll ()
PieceMask64 & | operator^= (const PieceMask64 &o)
PieceMask64 & | operator&= (const PieceMask64 &o)
PieceMask64 & | operator|= (const PieceMask64 &o)
PieceMask64 & | operator-= (const PieceMask64 &o)
PieceMask64 & | operator+= (const PieceMask64 &o)
bool | none () const
bool | hasMultipleBit () const
int | countBit2 () const
| bit の数を2まで数える
int | countBit () const
int | takeOneBit ()

## Static Public Member Functions

static const mask_t | numToMask (int num)
Static Public Member Functions inherited from osl::container::PieceMask64
static int | numToIndex (int)
static int | numToOffset (int num)

## Private Member Functions

mask_t & | mutableMaskNum (int num)
const mask_t | getMaskNum (int num) const

## Additional Inherited Members

Protected Member Functions inherited from osl::container::PieceMask64
misc::Mask64 & | mutableMask (int)
Protected Attributes inherited from osl::container::PieceMask64
Mask64 | mask

## Detailed Description

駒番号のビットセット.

64bitのMask64を一つもしくは，32bitのMask32を2枚で表現する． 各メソッドの変数名は num は駒番号に， index はマスクのID(0-1)に用いられている．

Definition at line 20 of file pieceMask.h.

## Constructor & Destructor Documentation

## PieceMask() [1/2]

osl::PieceMask::PieceMask | ( |  | ) |

inline

Definition at line 23 of file pieceMask.h.

## PieceMask() [2/2]

osl::PieceMask::PieceMask | ( | const PieceMaskBase & | base | ) |

inline

Definition at line 24 of file pieceMask.h.

## Member Function Documentation

## any()

bool osl::PieceMask::any | ( |  | ) | const

inline

Definition at line 57 of file pieceMask.h.

References osl::container::PieceMask64::none().

Referenced by osl::eval::ml::MajorCheckWithCapture::addOne(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::BishopExchangeSilverKing::eval(), osl::eval::ml::BishopRookFork::eval(), osl::eval::ml::KingPieceRelativeNoSupport::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::Pin::eval(), osl::eval::ml::SimplePin::eval(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::rating::EscapePinGroup::findMatch(), osl::rating::FeatureSet::generateRating(), osl::effect_util::AdditionalEffect::hasEffect(), osl::NumEffectState::hasEffectByNotPinned(), osl::NumEffectState::hasEffectByNotPinnedAndKing(), osl::rating::PinAttack::index(), osl::move_probability::CoverFork::match(), osl::rating::PinAttack::match(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::eval::ml::NonPawnAttacked::updateEffectChanged(), osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne(), and osl::move_probability::StateInfo::updatePinnedGenerals().

## clearBit()

template<Ptype PTYPE>

void osl::PieceMask::clearBit | ( |  | ) |

inline

unpromote(PTYPE) の駒のbit を消す

Definition at line 74 of file pieceMask.h.

References osl::PtypeFuns< T >::basicType, osl::container::PieceMask64::mask, and osl::container::PieceMask64::mutableMask().

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::PiecePairKing::addSub(), osl::eval::ml::BishopExchangeSilverKing::eval(), osl::eval::ml::BishopRookFork::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::PromotedMinorPieces::eval(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::King25EffectCountCombination::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::NumEffectState::findThreatenedPiece(), osl::effect_util::AdditionalEffect::hasEffect(), osl::NumEffectState::hasEffectByNotPinnedAndKing(), osl::move_probability::CoverFork::match(), osl::eval::ml::PiecePairKing::sub(), osl::progress::ml::NewProgress::updateAttack5x5Pieces(), and osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne().

## flip()

void osl::PieceMask::flip | ( | int | num | ) |

inline

Definition at line 51 of file pieceMask.h.

References mutableMaskNum(), and numToMask().

Referenced by osl::effect::NumBitmapEffect::playerEffect().

## getMask() [1/2]

template<Ptype PTYPE>

const mask_t osl::PieceMask::getMask | ( |  | ) | const

inline

unpromote(PTYPE) の駒のbit を*含む*mask_tを取り出す

Definition at line 62 of file pieceMask.h.

References getMask().

Referenced by osl::effect::NumBitmapEffect::countEffect(), getMask(), getMaskNum(), osl::effect::NumBitmapEffect::hasAny(), selectBit(), and osl::effect::NumBitmapEffect::selectLong().

## getMask() [2/2]

const mask_t osl::PieceMask::getMask | ( | int | num | ) | const

inline

Definition at line 59 of file pieceMask.h.

References osl::container::PieceMask64::getMask().

Referenced by osl::eval::ml::KnightFork::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::KnightFork::evalWithUpdate(), osl::rating::EscapePinGroup::findMatch(), osl::NumEffectState::findThreatenedPiece(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectInDirection(), osl::NumEffectState::hasMultipleEffectAt(), osl::rating::ImmediateAddSupport::index(), osl::NumEffectState::longEffectAt(), osl::move_probability::ToEffectLong::match(), osl::rating::EscapePin::match(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::operator&(), osl::operator<<(), osl::operator==(), osl::operator|(), osl::operator~(), osl::ki2::show(), osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne(), and osl::progress::ml::NewProgress::updatePawnFacing().

## getMaskNum()

const mask_t osl::PieceMask::getMaskNum | ( | int | num | ) | const

inline private

Definition at line 35 of file pieceMask.h.

References getMask(), and osl::container::PieceMask64::numToIndex().

Referenced by test().

## mutableMaskNum()

mask_t & osl::PieceMask::mutableMaskNum | ( | int | num | ) |

inline private

Definition at line 32 of file pieceMask.h.

References osl::container::PieceMask64::mutableMask(), and osl::container::PieceMask64::numToIndex().

Referenced by flip(), reset(), and set().

## numToMask()

const mask_t osl::PieceMask::numToMask | ( | int | num | ) |

inline static

Definition at line 25 of file pieceMask.h.

References osl::misc::GeneralMask< mask_int_t >::makeDirect(), and osl::container::PieceMask64::numToOffset().

Referenced by flip(), osl::effect::NumBitmapEffect::playerEffect(), osl::effect::NumBitmapEffect::playerEffectMask(), osl::effect::NumBitmapEffect::playerEffectMask(), osl::NumEffectState::prologueCapture(), reset(), set(), and test().

## orMask()

void osl::PieceMask::orMask | ( | int | index,
|  | mask_t | val )

inline

Definition at line 42 of file pieceMask.h.

References osl::container::PieceMask64::mutableMask().

Referenced by osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), and osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne().

## reset()

void osl::PieceMask::reset | ( | int | num | ) |

inline

Definition at line 54 of file pieceMask.h.

References mutableMaskNum(), and numToMask().

Referenced by osl::eval::ml::KingPieceRelativeNoSupport::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::checkmate::King8Info::make(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::eval::ml::NonPawnAttacked::updateEffectChanged(), and osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne().

## selectBit()

template<Ptype PTYPE>

const mask_t osl::PieceMask::selectBit | ( |  | ) | const

inline

unpromote(PTYPE) の駒のbit だけ取り出す

Definition at line 66 of file pieceMask.h.

References osl::PtypeFuns< T >::basicType, getMask(), osl::misc::GeneralMask< mask_int_t >::makeDirect(), and osl::container::PieceMask64::mask.

Referenced by osl::eval::ml::KnightFork::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::KnightFork::evalWithUpdate(), osl::progress::ml::NewProgress::updateAttack5x5Pieces(), osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne(), and osl::progress::ml::NewProgress::updatePawnFacing().

## set()

void osl::PieceMask::set | ( | int | num | ) |

inline

Definition at line 48 of file pieceMask.h.

References mutableMaskNum(), and numToMask().

Referenced by osl::eval::See::findEffectPiecesAfterMove(), osl::NumEffectState::makePinOpenDir(), and osl::move_probability::ToEffect::supportAttack().

## setBit()

template<Ptype PTYPE>

void osl::PieceMask::setBit | ( |  | ) |

inline

unpromote(PTYPE) の駒のbit を立てる

Definition at line 81 of file pieceMask.h.

References osl::PtypeFuns< T >::basicType, osl::misc::GeneralMask< mask_int_t >::makeDirect(), osl::container::PieceMask64::mask, and osl::container::PieceMask64::mutableMask().

Referenced by osl::eval::ml::BishopRookFork::eval().

## setMask()

void osl::PieceMask::setMask | ( | int | index,
|  | mask_t | val )

inline

Definition at line 28 of file pieceMask.h.

References osl::container::PieceMask64::mutableMask().

Referenced by osl::effect::NumBitmapEffect::playerEffect().

## test()

bool osl::PieceMask::test | ( | int | num | ) | const

inline

Definition at line 45 of file pieceMask.h.

References getMaskNum(), and numToMask().

Referenced by osl::eval::See::computeValue(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiece(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtype(), osl::NumEffectState::hasEffectByPiece(), osl::hash::HashKey::HashKey(), osl::NumEffectState::isConsistent(), osl::move_classifier::KingOpenMove< P >::isMember(), osl::SimpleState::isOffBoard(), osl::NumEffectState::isOnBoardNum(), osl::NumEffectState::makePinOpenDir(), osl::book::MiniBoard::MiniBoard(), osl::progress::PtypeProgress::PtypeProgress(), osl::move_probability::PatternCommon::updateCacheOne(), and osl::eval::ml::NonPawnAttackedPtype::updateChanged().

## xorMask()

void osl::PieceMask::xorMask | ( | int | index,
|  | mask_t | val )

inline

Definition at line 39 of file pieceMask.h.

References osl::container::PieceMask64::mutableMask().

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

- pieceMask.h