osl::Square Class Reference

`#include <basic_type.h>`

## Public Types

enum | { PIECE_STAND =0 , MIN =0 , SIZE =0x100 }

## Public Member Functions

unsigned int | uintValue () const
| Square ()
| Square (int x, int y)
int | x () const
| 将棋としてのX座標を返す.
int | y () const
| 将棋としてのY座標を返す.
int | y1 () const
| y+1を返す
unsigned int | index () const
int | indexForOffset32 () const
bool | isPieceStand () const
bool | isOnBoardSlow () const
bool | isOnBoard () const
| 盤面上を表すかどうかの判定． 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する．
bool | isEdge () const
| onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった．
bool | isValid () const
const Square | squareForBlack (Player player) const
template<Player P>
const Square | squareForBlack () const
| 後手の場合は盤面を引っくり返す.
const Square | rotate180 () const
const Square | rotate180EdgeOK () const
const Square | rotate180Safe () const
const Square | flipHorizontal () const
bool | isOnBoardRegion () const
| squareがONBOARD_MINとONBOARD_MAXの間にある
Square & | operator++ ()
template<Player P>
bool | canPromote () const
bool | canPromote (Player player) const
bool | isULRD (Square sq) const
| 2つのSquare(onBoardであることが前提)が， xが等しいかyが等しい
bool | isUD (Square sq) const
| 2つのSquare(onBoardであることが前提)のxが等しい
template<Player P>
bool | isU (Square sq) const
| sqがPlayer Pにとって上
bool | isLR (Square sq) const
| 2つのSquare(onBoardであることが前提)のyが等しい
Square & | operator+= (Offset offset)
Square & | operator-= (Offset offset)
const Square | operator+ (Offset offset) const
const Square | operator- (Offset offset) const
const Offset | operator- (Square other) const
template<int Y>
bool | yEq ()
template<int Y>
std::enable_if< Y!=2, bool >::type | yLe ()
template<int Y>
std::enable_if< Y==2, bool >::type | yLe ()
template<int Y>
std::enable_if< Y!=7, bool >::type | yGe ()
template<int Y>
std::enable_if< Y==7, bool >::type | yGe ()
template<Player P, Direction D>
const Square | neighbor () const
template<Player P, Direction D>
const Square | back () const
const Square | neighbor (Player P, Direction D) const
const Square | back (Player P, Direction D) const
bool | isNeighboring8 (Square to) const

## Static Public Member Functions

static const Square | makeDirect (int value)
static const Square | STAND ()
static const Square | makeNoCheck (int x, int y)
| assertなしに作る
static const Square | nth (unsigned int i)
static unsigned int | indexMax ()
static const Square | onBoardMax ()
static const Square | onBoardMin ()
static int | reverseX (int x)
static int | reverseY (int y)
template<Player P>
static bool | canPromoteY (int y)

## Private Member Functions

| Square (int p)

## Private Attributes

unsigned int | square

## Detailed Description

Definition at line 531 of file basic_type.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
PIECE_STAND |
MIN |
SIZE |

Definition at line 540 of file basic_type.h.

## Constructor & Destructor Documentation

## Square() [1/3]

osl::Square::Square | ( | int | p | ) |

inline explicit private

Definition at line 534 of file basic_type.h.

References square.

Referenced by back(), flipHorizontal(), isLR(), isNeighboring8(), isU(), isUD(), isULRD(), makeDirect(), makeNoCheck(), neighbor(), nth(), onBoardMax(), onBoardMin(), operator+(), operator++(), operator+=(), operator-(), operator-(), operator-=(), rotate180(), rotate180EdgeOK(), rotate180Safe(), squareForBlack(), squareForBlack(), and STAND().

## Square() [2/3]

osl::Square::Square | ( |  | ) |

inline

Definition at line 545 of file basic_type.h.

References PIECE_STAND, and square.

Referenced by flipHorizontal(), makeDirect(), makeNoCheck(), nth(), onBoardMax(), onBoardMin(), rotate180EdgeOK(), squareForBlack(), and STAND().

## Square() [3/3]

osl::Square::Square | ( | int | x,
|  | int | y )

inline

Definition at line 549 of file basic_type.h.

References SIZE, square, x(), and y().

## Member Function Documentation

## back() [1/2]

template<Player P, Direction D>

const Square osl::Square::back | ( |  | ) | const

inline

Definition at line 750 of file basic_type.h.

References neighbor(), and Square().

Referenced by osl::eval::ml::KnightFork::accumulate().

## back() [2/2]

const osl::Square osl::Square::back | ( | Player | P,
|  | Direction | D ) const

Definition at line 196 of file basic_type.cc.

References osl::alt(), osl::Board_Table, and osl::D.

## canPromote() [1/2]

template<Player P>

bool osl::Square::canPromote | ( |  | ) | const

inline

Definition at line 659 of file basic_type.h.

References canPromote().

Referenced by osl::eval::ml::MajorCheckWithCapture::addOne(), osl::ShouldPromoteCut::canIgnore(), canPromote(), osl::eval::See::computeValue(), osl::effect_action::AlwaysMove< Action >::doAction(), osl::effect_action::BetterToPromote< Action >::doAction(), osl::effect_action::AlwaysMove< Action >::doActionPtype(), osl::effect_action::BetterToPromote< Action >::doActionPtype(), osl::checkmate::PawnCheckmateMoves::effectiveOnlyIfPawnCheckmate(), osl::checkmate::PawnCheckmateMoves::effectiveOnlyIfPawnCheckmate(), osl::eval::ml::RookPawn< Opening >::eval(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::rating::Karanari::index(), osl::rating::LongTarget::isPromotable(), osl::SimpleState::isValidMoveByRule(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::PatternBase< false >::match(), osl::move_probability::PromotionBySacrifice::match(), osl::move_probability::SeeFeature::match(), osl::rating::Karanari::match(), osl::rating::Karanari::matchGeneral(), osl::eval::ml::SilverFork::matchGold(), osl::move_probability::PawnAttack::matchPtype(), osl::eval::ml::SilverFork::matchRook(), osl::ki2::show(), osl::psn::showXP(), and osl::move_probability::PatternCommon::updateCacheOne().

## canPromote() [2/2]

bool osl::Square::canPromote | ( | Player | player | ) | const

inline

Definition at line 662 of file basic_type.h.

References osl::BLACK, and uintValue().

## canPromoteY()

template<Player P>

bool osl::Square::canPromoteY | ( | int | y | ) |

inline static

Definition at line 655 of file basic_type.h.

References osl::BLACK, and y().

## flipHorizontal()

const Square osl::Square::flipHorizontal | ( |  | ) | const

inline

Definition at line 628 of file basic_type.h.

References isPieceStand(), Square(), Square(), x(), and y().

Referenced by osl::SimpleState::flipHorizontal(), osl::eval::ml::PiecePairKing::indexKing(), and osl::eval::ml::PiecePairKing::indexPiece().

## index()

unsigned int osl::Square::index | ( |  | ) | const

inline

Definition at line 572 of file basic_type.h.

References MIN, and square.

Referenced by osl::hash::HashGenTable::addHashKey(), osl::move_probability::PatternCommon::addOne(), osl::move_probability::BishopAttack::addSquare(), osl::Centering3x3::adjustCenter(), osl::Centering5x3::adjustCenter(), osl::container::BoardMaskTable3x3::BoardMaskTable3x3(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::container::BoardMaskTable5x5::BoardMaskTable5x5(), osl::SquareCompressor::compress(), osl::effect::NumSimpleEffectTable::copyFrom(), osl::NumEffectState::copyFrom(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect::NumSimpleEffectTable::doEffectShort(), osl::effect::NumSimpleEffectTable::effectSetAt(), osl::rating::PatternGroup::findMatch(), osl::PathEncodingTable::get(), osl::progress::Effect5x3Table::getAttackEffect(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::SimpleState::getPiecePtr(), osl::container::BoardMask::index(), osl::rating::CountEffect2::index(), osl::Centering3x3::Table::init(), osl::checkmate::EdgeTable::init(), osl::progress::PtypeProgressTable::init(), osl::SquareCompressor::Initializer::Initializer(), isOnBoardRegion(), osl::container::BoardMaskTable3x3::mask(), osl::container::BoardMaskTable5x3Center::mask(), osl::container::BoardMaskTable5x5::mask(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::operator==(), osl::rating::PatternGroup::PatternGroup(), osl::SimpleState::pieceAt(), osl::progress::PtypeProgressTable::progress(), osl::checkmate::EdgeTable::resetEdgeFromLiberty(), osl::SimpleState::setBoard(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::hash::HashGenTable::subHashKey(), osl::Centering5x3::Table::Table(), and osl::move_probability::PatternCommon::updateCacheOne().

## indexForOffset32()

int osl::Square::indexForOffset32 | ( |  | ) | const

inline

Definition at line 574 of file basic_type.h.

References square.

## indexMax()

unsigned int osl::Square::indexMax | ( |  | ) |

inline static

Definition at line 573 of file basic_type.h.

References MIN, and SIZE.

## isEdge()

bool osl::Square::isEdge | ( |  | ) | const

inline

onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった．

Definition at line 591 of file basic_type.h.

References isPieceStand(), square, x(), and y().

Referenced by osl::move_classifier::PawnDropCheckmate< P >::canEscape(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::effect_util::Neighboring8Direct::Table::findNearest(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), and osl::move_probability::BlockLong::makeLongAttackOne().

## isLR()

bool osl::Square::isLR | ( | Square | sq | ) | const

inline

2つのSquare(onBoardであることが前提)のyが等しい

Definition at line 701 of file basic_type.h.

References isOnBoard(), Square(), and uintValue().

## isNeighboring8()

bool osl::Square::isNeighboring8 | ( | Square | to | ) | const

Definition at line 202 of file basic_type.cc.

References osl::Board_Table, and Square().

Referenced by osl::checkmate::ProofNumberTable::countLiberty(), osl::checkmate::ProofNumberTable::countLibertyLong(), osl::checkmate::ProofNumberTable::countLibertyShortNotKnight(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::rating::Karanari::index(), osl::rating::Threatmate::isCandidate(), osl::move_probability::BreakThreatmate::isOpeningKingRoad(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::rating::Karanari::match(), osl::rating::DefenseKing8::matchDrop(), and osl::rating::DefenseKing8::matchMove().

## isOnBoard()

bool osl::Square::isOnBoard | ( |  | ) | const

inline

盤面上を表すかどうかの判定． 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する．

Definition at line 583 of file basic_type.h.

References square.

Referenced by osl::eval::ml::KnightCheck::canCheck(), osl::eval::ml::GoldFeatures::canMoveToSide(), osl::rating::CountEffect2::count(), osl::NumEffectState::countEffect(), osl::NumEffectState::countEffect(), osl::mobility::countMobilityBoth(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::move_probability::ToEffect::find(), osl::progress::Effect5x3Table::getAttackEffect(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::PtypeTable::getEffect(), osl::PtypeTable::getEffectNotLongU(), osl::BoardTable::getShort8(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectByNotPinned(), osl::NumEffectState::hasEffectByNotPinnedAndKing(), osl::NumEffectState::hasEffectByPiece(), osl::effect_util::Neighboring8Direct::hasEffectFromTo(), osl::rating::CountEffect2::index(), osl::eval::ml::BishopExchangeSilverKing::indexRook(), osl::SimpleState::isConsistent(), osl::SimpleState::isEmptyBetween(), osl::SimpleState::isEmptyBetween(), isLR(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::rating::LongTarget::isPromotable(), isU(), isUD(), isULRD(), isValid(), osl::rating::PatternLong::nextPieceOrEnd(), osl::BoardTable::nextSquare(), osl::rating::Pattern::nextSquare(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::SimpleState::pieceOnBoard(), and osl::eval::ml::PiecePair::sanitize().

## isOnBoardRegion()

bool osl::Square::isOnBoardRegion | ( |  | ) | const

inline

squareがONBOARD_MINとONBOARD_MAXの間にある

Definition at line 641 of file basic_type.h.

References index(), onBoardMax(), and onBoardMin().

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

## isOnBoardSlow()

bool osl::Square::isOnBoardSlow | ( |  | ) | const

Definition at line 178 of file basic_type.cc.

References x(), and y().

## isPieceStand()

bool osl::Square::isPieceStand | ( |  | ) | const

inline

Definition at line 576 of file basic_type.h.

References PIECE_STAND, and square.

Referenced by osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::checkmate::LibertyEstimator::attackH(), osl::checkmate::attackProofCost(), osl::ShouldPromoteCut::canIgnore(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::PiecePair::evalWithUpdate(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), osl::eval::ml::BishopRookFork::findDropInLine(), osl::rating::AttackKing8Group::findMatch(), flipHorizontal(), osl::NumEffectState::inCheck(), osl::eval::ml::PiecePair::index(), osl::rating::CountOpen::index(), osl::SimpleState::initPawnMask(), osl::NumEffectState::isAlmostValidMove(), osl::SimpleState::isAlmostValidMove(), osl::SimpleState::isConsistent(), osl::Move::isDrop(), isEdge(), osl::move_classifier::Check< P >::isMember(), osl::move_classifier::PawnDropCheckmate< P >::isMember(), osl::move_classifier::SafeMove< P >::isMember(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::Piece::isOnBoard(), isValid(), osl::SimpleState::isValidMoveByRule(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::NumEffectState::makeMove(), osl::NumEffectState::makePinOpen(), osl::NumEffectState::makeUnmakeMove(), osl::move_probability::MoveFromOpposingSliders::match(), osl::rating::AttackKing8::match(), osl::rating::RookDefense::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::operator<<(), osl::operator<<(), osl::eval::ml::PiecePair::pieceValueDouble(), osl::book::OPiece::position2Bits(), osl::NumEffectState::recalcPinOpen(), rotate180Safe(), osl::eval::See::seeInternal(), osl::SimpleState::setPiece(), osl::csa::show(), osl::ki2::show(), osl::ki2::show(), osl::psn::show(), osl::psn::showXP(), osl::kakinoki::strToMove(), and osl::eval::ml::PiecePair::valueCompiled().

## isU()

template<Player P>

bool osl::Square::isU | ( | Square | sq | ) | const

inline

sqがPlayer Pにとって上

Definition at line 690 of file basic_type.h.

References osl::BLACK, isOnBoard(), Square(), and uintValue().

## isUD()

bool osl::Square::isUD | ( | Square | sq | ) | const

inline

2つのSquare(onBoardであることが前提)のxが等しい

Definition at line 681 of file basic_type.h.

References isOnBoard(), Square(), and uintValue().

## isULRD()

bool osl::Square::isULRD | ( | Square | sq | ) | const

inline

2つのSquare(onBoardであることが前提)が， xが等しいかyが等しい

Definition at line 673 of file basic_type.h.

References isOnBoard(), Square(), and uintValue().

## isValid()

bool osl::Square::isValid | ( |  | ) | const

Definition at line 184 of file basic_type.cc.

References isOnBoard(), and isPieceStand().

Referenced by osl::hash::HashGenTable::addHashKey(), and osl::hash::HashGenTable::subHashKey().

## makeDirect()

const Square osl::Square::makeDirect | ( | int | value | ) |

inline static

Definition at line 538 of file basic_type.h.

References Square(), and Square().

Referenced by osl::rating::PatternGroup::findMatch(), osl::Move::from(), osl::mobility::MobilityContent::get(), osl::NumEffectState::kingMobilityAbs(), osl::container::Square8::operator[](), osl::NumEffectState::recalcPinOpen(), rotate180EdgeOK(), osl::Piece::square(), squareForBlack(), osl::Move::to(), and osl::container::BoardMask::toSquare().

## makeNoCheck()

const Square osl::Square::makeNoCheck | ( | int | x,
|  | int | y )

inline static

assertなしに作る

Definition at line 556 of file basic_type.h.

References osl::Offset::BOARD_HEIGHT, Square(), Square(), x(), and y().

## neighbor() [1/2]

template<Player P, Direction D>

const Square osl::Square::neighbor | ( |  | ) | const

inline

Definition at line 746 of file basic_type.h.

References Square().

Referenced by osl::eval::ml::AttackMajorsInBase::addOne(), back(), osl::eval::ml::GoldFeatures::evalOne(), and osl::eval::ml::KnightFork::updateSquares().

## neighbor() [2/2]

const osl::Square osl::Square::neighbor | ( | Player | P,
|  | Direction | D ) const

Definition at line 190 of file basic_type.cc.

References osl::Board_Table, and osl::D.

## nth()

const Square osl::Square::nth | ( | unsigned int | i | ) |

inline static

Definition at line 559 of file basic_type.h.

References MIN, Square(), and Square().

Referenced by osl::SimpleState::init().

## onBoardMax()

const Square osl::Square::onBoardMax | ( |  | ) |

inline static

Definition at line 635 of file basic_type.h.

References Square(), and Square().

Referenced by isOnBoardRegion().

## onBoardMin()

const Square osl::Square::onBoardMin | ( |  | ) |

inline static

Definition at line 636 of file basic_type.h.

References Square(), and Square().

Referenced by isOnBoardRegion().

## operator+()

const Square osl::Square::operator+ | ( | Offset | offset | ) | const

inline

Definition at line 714 of file basic_type.h.

References Square().

## operator++()

Square & osl::Square::operator++ | ( |  | ) |

inline

Definition at line 646 of file basic_type.h.

References Square(), and square.

## operator+=()

Square & osl::Square::operator+= | ( | Offset | offset | ) |

inline

Definition at line 706 of file basic_type.h.

References osl::Offset::intValue(), Square(), and square.

## operator-() [1/2]

const Square osl::Square::operator- | ( | Offset | offset | ) | const

inline

Definition at line 718 of file basic_type.h.

References Square().

## operator-() [2/2]

const Offset osl::Square::operator- | ( | Square | other | ) | const

inline

Definition at line 722 of file basic_type.h.

References osl::Offset::makeDirect(), Square(), and square.

## operator-=()

Square & osl::Square::operator-= | ( | Offset | offset | ) |

inline

Definition at line 710 of file basic_type.h.

References osl::Offset::intValue(), Square(), and square.

## reverseX()

int osl::Square::reverseX | ( | int | x | ) |

inline static

Definition at line 651 of file basic_type.h.

References x().

## reverseY()

int osl::Square::reverseY | ( | int | y | ) |

inline static

Definition at line 652 of file basic_type.h.

References y().

Referenced by osl::PtypePlayerTraits< T, P >::canDropTo(), osl::PtypeTable::initPtypeSub(), and osl::PtypePlayerTraits< T, P >::mayPromote().

## rotate180()

const Square osl::Square::rotate180 | ( |  | ) | const

inline

Definition at line 613 of file basic_type.h.

References Square(), and squareForBlack().

Referenced by osl::eval::ml::BishopEffectBase::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::PiecePairKing::indexKing(), osl::eval::ml::PiecePairKing::indexPiece(), osl::eval::ml::RookMobilityAll::indexXKingX(), osl::progress::ml::NewProgress::progressOne(), osl::progress::Effect5x3Table::setupAttackEffect(), and osl::progress::Effect5x3Table::setupDefenseEffect().

## rotate180EdgeOK()

const Square osl::Square::rotate180EdgeOK | ( |  | ) | const

inline

Definition at line 617 of file basic_type.h.

References makeDirect(), Square(), Square(), and uintValue().

Referenced by osl::eval::ml::BishopEffectBase::evalOne(), and osl::eval::ml::RookEffectBase::evalOne().

## rotate180Safe()

const Square osl::Square::rotate180Safe | ( |  | ) | const

inline

Definition at line 622 of file basic_type.h.

References isPieceStand(), Square(), and squareForBlack().

Referenced by osl::SimpleState::rotate180().

## squareForBlack() [1/2]

template<Player P>

const Square osl::Square::squareForBlack | ( |  | ) | const

inline

後手の場合は盤面を引っくり返す.

PIECE_STANDの場合は扱えない．

Definition at line 609 of file basic_type.h.

References Square(), and squareForBlack().

Referenced by rotate180(), rotate180Safe(), and squareForBlack().

## squareForBlack() [2/2]

const Square osl::Square::squareForBlack | ( | Player | player | ) | const

inline

Definition at line 598 of file basic_type.h.

References osl::BLACK, makeDirect(), Square(), Square(), and uintValue().

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::AttackMajorsInBase::addOne(), osl::eval::ml::PiecePairKing::addSub(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::eval::ml::PiecePairKing::evalWithUpdateBang(), osl::SimpleState::isConsistent(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::move_probability::KingRelativeY::match(), osl::move_probability::SquareY::match(), osl::move_probability::PawnAttack::matchPtype(), and osl::eval::ml::PiecePairKing::sub().

## STAND()

const Square osl::Square::STAND | ( |  | ) |

inline static

Definition at line 548 of file basic_type.h.

References PIECE_STAND, Square(), and Square().

Referenced by osl::book::OPiece::bits2Square(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::Piece::EDGE(), osl::Piece::EMPTY(), osl::SimpleState::emulateCapture(), osl::SimpleState::emulateHandPiece(), osl::rating::PatternBlock::find(), osl::effect_util::Neighboring8Direct::Table::findNearest(), osl::book::OMove::from(), osl::Centering3x3::Table::init(), osl::progress::PtypeProgressTable::init(), osl::SimpleState::init(), osl::NumEffectState::makeUnmakePass(), osl::SquareCompressor::melt(), osl::Move::Move(), osl::hash::HashKey::newMakeMove(), osl::hash::HashKey::newUnmakeMove(), osl::book::opiece_sort::operator()(), osl::book::oposition_sort::operator()(), osl::usi::parse(), osl::kakinoki::KakinokiFile::parseLine(), osl::NumEffectState::prologueDrop(), osl::progress::PtypeProgress::PtypeProgress(), osl::SimpleState::setPieceAll(), osl::csa::strToMove(), osl::csa::strToPos(), osl::Centering5x3::Table::Table(), osl::book::OMove::to(), and osl::progress::PtypeProgress::update().

## uintValue()

unsigned int osl::Square::uintValue | ( |  | ) | const

inline

Definition at line 539 of file basic_type.h.

References square.

Referenced by canPromote(), osl::BoardTable::getShort8(), osl::BoardTable::getShort8OffsetUnsafe(), osl::BoardTable::getShort8Unsafe(), osl::BoardTable::isBetween(), isLR(), osl::container::Square8::isMember(), isU(), isUD(), isULRD(), osl::NumEffectState::makePinOpenDir(), osl::Move::newAddFrom(), osl::Move::newAddTo(), osl::Move::newFrom(), osl::operator<(), osl::operator==(), osl::operator>(), osl::rating::PatternGroup::PatternGroup(), osl::container::Square8::push_back(), osl::NumEffectState::recalcPinOpen(), rotate180EdgeOK(), osl::mobility::MobilityContent::set(), squareForBlack(), yEq(), yGe(), and yLe().

## x()

int osl::Square::x | ( |  | ) | const

inline

将棋としてのX座標を返す.

Squareの内部表現に依存しない．

Definition at line 563 of file basic_type.h.

References square.

Referenced by osl::move_probability::King5x5Ptype::addOne(), osl::eval::ml::RookMobilityAll::adjust(), osl::eval::ml::PiecePair::adjust12(), osl::Centering3x3::adjustCenterNaive(), osl::Centering5x3::adjustCenterNaive(), osl::rating::BadLance::basicMatch(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::container::BitXmask::clear(), osl::record::KisenUtils::convertSquare(), osl::rating::DefenseKing8::count(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::mobility::RookMobility::countHorizontalAll(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::RookPawn< Opening >::eval(), osl::eval::ml::RookPawnY::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::SilverAdvance26::eval(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::King25BothSide::evalOne(), osl::eval::ml::King25EffectEach< Stage >::evalOne(), osl::eval::ml::King25EffectEachBoth::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KingMobilitySum::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalWithUpdate(), osl::eval::ml::King3Pieces::evalWithUpdate(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), flipHorizontal(), osl::move_probability::SquareX::fromTo(), osl::BoardTable::getShort8(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring8Direct::hasEffectNaive(), osl::eval::ml::AnagumaEmpty::index(), osl::eval::ml::GoldAndSilverNearKing::index(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::King25EmptyAbs< Opening >::index(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::KingXBlocked3::index(), osl::eval::ml::KingXBlockedBase::index(), osl::eval::ml::KingXBlockedYBase::index(), osl::eval::ml::KingXBothBlocked::index(), osl::eval::ml::LanceEffectPieceKingRelative::index(), osl::eval::ml::PawnDropBoth::index(), osl::eval::ml::PiecePair::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PtypeX::index(), osl::progress::ml::NewProgress::index(), osl::eval::ml::BishopEffectBase::index1(), osl::eval::ml::RookEffectBase::index1(), osl::eval::ml::BishopEffectBase::index2(), osl::eval::ml::RookEffectBase::index2(), osl::eval::ml::GoldAndSilverNearKing::indexCombination(), osl::eval::ml::NonPawnAttacked::indexK(), osl::eval::ml::BishopExchangeSilverKing::indexKing(), osl::eval::ml::PiecePairKing::indexKing(), osl::rating::BigramAttack::indexKing(), osl::rating::BigramAttack::indexOfMove(), osl::progress::ml::NewProgress::indexPerEffect(), osl::progress::ml::NewProgress::indexPerEffectX(), osl::progress::ml::NewProgress::indexPerEffectY(), osl::progress::ml::NewProgress::indexRelative(), osl::eval::ml::BishopExchangeSilverKing::indexRook(), osl::eval::ml::GoldFeatures::indexSideX(), osl::eval::ml::BishopExchangeSilverKing::indexSilver(), osl::eval::ml::PiecePairKing::indexWhite(), osl::eval::ml::King25BothSide::indexX(), osl::eval::ml::King25Mobility::indexX(), osl::eval::ml::King3Pieces::indexX(), osl::eval::ml::PawnDropBoth::indexX(), osl::eval::ml::RookMobilityAll::indexX(), osl::progress::ml::NewProgress::indexX(), osl::eval::ml::RookMobilityAll::indexXKingX(), osl::eval::ml::KingXBlocked3::indexY(), osl::eval::ml::KingXBothBlocked::indexY(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::progress::ml::NewProgress::indexY(), osl::checkmate::EdgeTable::init(), osl::SimpleState::initPawnMask(), osl::eval::ml::BishopRookFork::isBishopForkSquare(), osl::eval::ml::KingXBlockedBase::isBlocked(), isEdge(), isOnBoardSlow(), osl::eval::ml::BishopRookFork::isRookForkSquare(), osl::rating::Threatmate::knight2Step(), makeNoCheck(), osl::rating::RelativeKingX::makeOldX(), osl::progress::Effect5x3d::makeProgress(), osl::progress::Effect5x3::makeProgressArea(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::rating::RelativeKingX::makeX(), osl::rating::SquareX::makeX(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::KingBlockade::match(), osl::move_probability::KingRelativeX::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::PawnAttack::match(), osl::move_probability::RookAttack::match(), osl::move_probability::SquareX::match(), osl::rating::PawnAttack::match(), osl::rating::RookDefense::match(), osl::eval::ml::KingMobility::mobilityDir(), osl::Offset32Base< 8, 9 >::Offset32Base(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::book::opiece_sort::operator()(), osl::book::oposition_sort::operator()(), osl::operator<<(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::book::OPiece::position2Bits(), osl::progress::ml::NewProgress::progressOne(), reverseX(), osl::record::KanjiMove::selectCandidates(), osl::container::BitXmask::set(), osl::progress::ml::NewProgress::setUp(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::csa::show(), osl::ki2::show(), osl::ki2::show(), osl::psn::show(), osl::record::myshogi::show(), osl::record::myshogi::show(), Square(), osl::eval::ml::PiecePair::sum12(), osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::eval::ml::KnightFork::updateSquares(), osl::eval::ml::OpenMidEndingEval::updateSub(), and osl::eval::ml::PiecePair::valueCompiled().

## y()

int osl::Square::y | ( |  | ) | const

inline

将棋としてのY座標を返す.

Squareの内部表現に依存しない．

Definition at line 567 of file basic_type.h.

References square.

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::AttackMajorsInBase::addOne(), osl::move_probability::King5x5Ptype::addOne(), osl::eval::ml::PiecePairKing::addSub(), osl::eval::ml::PiecePair::adjust12(), osl::Centering3x3::adjustCenterNaive(), osl::Centering5x3::adjustCenterNaive(), osl::progress::ml::NewProgress::attack5x5Value(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::PtypePlayerTraits< T, P >::canDropTo(), osl::PtypeTable::canDropTo(), osl::ShouldPromoteCut::canIgnore(), canPromoteY(), osl::eval::ml::GoldFeatures::canRetreat(), osl::eval::ml::SilverFeatures::canRetreat(), osl::record::KisenUtils::convertSquare(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::mobility::RookMobility::countVerticalAll(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::King25BothSide::evalOne(), osl::eval::ml::King25EffectCountCombination::evalOne(), osl::eval::ml::King25EffectEach< Stage >::evalOne(), osl::eval::ml::King25EffectEachBoth::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KingMobilitySum::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalWithUpdate(), osl::eval::ml::King3Pieces::evalWithUpdate(), osl::eval::ml::King8EffectEmptySquare< false >::evalWithUpdate(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::eval::ml::PtypeYY::evalWithUpdate(), osl::eval::ml::PiecePairKing::evalWithUpdateBang(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), flipHorizontal(), osl::move_probability::SquareY::fromTo(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::BoardTable::getShort8(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring8Direct::hasEffectNaive(), osl::eval::ml::AnagumaEmpty::index(), osl::eval::ml::GoldAndSilverNearKing::index(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::King25EmptyAbs< Opening >::index(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::KingXBlockedYBase::index(), osl::eval::ml::KnightAdvance::index(), osl::eval::ml::LanceEffectPieceKingRelative::index(), osl::eval::ml::MajorY< Opening, MajorBasic >::index(), osl::eval::ml::PawnAdvanceUtil::index(), osl::eval::ml::PiecePair::index(), osl::eval::ml::PieceStandY::index(), osl::eval::ml::PieceStandY::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PtypeY::index(), osl::eval::ml::PtypeYY::index(), osl::eval::ml::RookPawnY::index(), osl::eval::ml::RookRook::index(), osl::progress::ml::NewProgress::index(), osl::eval::ml::BishopEffectBase::index1(), osl::eval::ml::RookEffectBase::index1(), osl::eval::ml::BishopEffectBase::index2(), osl::eval::ml::RookEffectBase::index2(), osl::eval::ml::GoldAndSilverNearKing::indexCombination(), osl::eval::ml::NonPawnAttacked::indexK(), osl::eval::ml::BishopExchangeSilverKing::indexKing(), osl::eval::ml::PiecePairKing::indexKing(), osl::rating::BigramAttack::indexKing(), osl::rating::BigramAttack::indexOfMove(), osl::progress::ml::NewProgress::indexPerEffect(), osl::progress::ml::NewProgress::indexPerEffectX(), osl::progress::ml::NewProgress::indexPerEffectY(), osl::eval::ml::PiecePairKing::indexPiece(), osl::progress::ml::NewProgress::indexRelative(), osl::eval::ml::GoldFeatures::indexRetreat(), osl::eval::ml::SilverFeatures::indexRetreat(), osl::eval::ml::BishopExchangeSilverKing::indexRook(), osl::eval::ml::GoldFeatures::indexSideY(), osl::eval::ml::BishopExchangeSilverKing::indexSilver(), osl::eval::ml::PiecePairKing::indexWhite(), osl::progress::ml::NewProgress::indexX(), osl::eval::ml::King25BothSide::indexY(), osl::eval::ml::King25Mobility::indexY(), osl::eval::ml::King3Pieces::indexY(), osl::eval::ml::KingXBlocked3::indexY(), osl::eval::ml::KingXBothBlocked::indexY(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::PromotedMinorPieces::indexY(), osl::eval::ml::RookMobilityAll::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::progress::ml::NewProgress::indexY(), osl::checkmate::EdgeTable::init(), osl::eval::ml::BishopRookFork::isBishopForkSquare(), osl::eval::ml::KingXBlockedBase::isBlocked(), osl::SimpleState::isConsistent(), isEdge(), isOnBoardSlow(), osl::eval::ml::BishopRookFork::isRookForkSquare(), osl::rating::Threatmate::knight2Step(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), makeNoCheck(), osl::rating::RelativeKingY::makeOldY(), osl::progress::Effect5x3d::makeProgress(), osl::progress::Effect5x3::makeProgressArea(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::rating::RelativeKingY::makeY(), osl::rating::SquareY::makeY(), osl::move_probability::KingRelativeY::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::SquareY::match(), osl::rating::RookDefense::match(), osl::move_probability::PawnAttack::matchPtype(), osl::PtypePlayerTraits< T, P >::mayPromote(), osl::eval::ml::KingMobility::mobilityDir(), osl::Offset32Base< 8, 9 >::Offset32Base(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::book::opiece_sort::operator()(), osl::book::oposition_sort::operator()(), osl::operator<<(), osl::book::OPiece::position2Bits(), osl::progress::ml::NewProgress::progressOne(), reverseY(), osl::record::KanjiMove::selectCandidates(), osl::progress::ml::NewProgress::setUp(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::csa::show(), osl::ki2::show(), osl::ki2::show(), osl::psn::show(), osl::record::myshogi::show(), osl::record::myshogi::show(), osl::move_probability::CheckFeature::sign(), Square(), osl::eval::ml::PiecePairKing::sub(), osl::eval::ml::PiecePair::sum12(), osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::eval::ml::KnightFork::updateSquares(), osl::eval::ml::OpenMidEndingEval::updateSub(), and osl::eval::ml::PiecePair::valueCompiled().

## y1()

int osl::Square::y1 | ( |  | ) | const

inline

y+1を返す

Definition at line 571 of file basic_type.h.

References square.

## yEq()

template<int Y>

bool osl::Square::yEq | ( |  | ) |

inline

Definition at line 726 of file basic_type.h.

References uintValue().

Referenced by osl::PtypePlayerTraits< T, P >::checkPromote(), and osl::PtypePlayerTraits< T, P >::mustPromote().

## yGe() [1/2]

template<int Y>

std::enable_if< Y==7, bool >::type osl::Square::yGe | ( |  | ) |

inline

Definition at line 742 of file basic_type.h.

References uintValue().

## yGe() [2/2]

template<int Y>

std::enable_if< Y!=7, bool >::type osl::Square::yGe | ( |  | ) |

inline

Definition at line 738 of file basic_type.h.

References uintValue().

Referenced by osl::PtypePlayerTraits< T, P >::canPromote(), osl::PtypePlayerTraits< T, P >::mustPromote(), and osl::PtypePlayerTraits< T, P >::noPromote().

## yLe() [1/2]

template<int Y>

std::enable_if< Y==2, bool >::type osl::Square::yLe | ( |  | ) |

inline

Definition at line 734 of file basic_type.h.

References uintValue().

## yLe() [2/2]

template<int Y>

std::enable_if< Y!=2, bool >::type osl::Square::yLe | ( |  | ) |

inline

Definition at line 730 of file basic_type.h.

References uintValue().

Referenced by osl::PtypePlayerTraits< T, P >::canPromote(), osl::PtypePlayerTraits< T, P >::mustPromote(), and osl::PtypePlayerTraits< T, P >::noPromote().

## Member Data Documentation

## square

unsigned int osl::Square::square

private

Definition at line 533 of file basic_type.h.

Referenced by osl::effect_util::AdditionalOrShadow::count(), osl::effect_util::AdditionalEffect::find(), index(), indexForOffset32(), isEdge(), isOnBoard(), isPieceStand(), osl::move_probability::LureDefender::match(), operator++(), operator+=(), operator-(), operator-=(), Square(), Square(), Square(), uintValue(), x(), y(), and y1().

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

- basic_type.h
- basic_type.cc