All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
osl::Square Class Reference

#include <square.h>

List of all members.

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 squareForBlackSlow (Player player) const
const Square squareForBlack (Int2Type< BLACK >) const
const Square squareForBlack (Int2Type< WHITE >) const
template<Player P>
const Square squareForBlack () const
 後手の場合は盤面を引っくり返す.
const Square squareForBlack (Player player) 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の間にある
Squareoperator++ ()
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が等しい
Squareoperator+= (Offset offset)
Squareoperator-= (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>
bool yLe (typename boost::enable_if_c< Y!=2 >::type *=0)
template<int Y>
bool yLe (typename boost::enable_if_c< Y==2 >::type *=0)
template<int Y>
bool yGe (typename boost::enable_if_c< Y!=7 >::type *=0)
template<int Y>
bool yGe (typename boost::enable_if_c< Y==7 >::type *=0)
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

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)
bool canPromote (Int2Type< BLACK >) const
bool canPromote (Int2Type< WHITE >) const

Static Private Member Functions

template<Player P>
static bool canPromoteY (int y, Int2Type< P >)
static bool canPromoteY (int y, Int2Type< BLACK >)
static bool canPromoteY (int y, Int2Type< WHITE >)

Private Attributes

unsigned int square

Detailed Description

Definition at line 41 of file square.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
PIECE_STAND 
MIN 
SIZE 

Definition at line 50 of file square.h.


Constructor & Destructor Documentation

osl::Square::Square ( int  p) [inline, explicit, private]

Definition at line 44 of file square.h.

osl::Square::Square ( ) [inline]
osl::Square::Square ( int  x,
int  y 
) [inline]

Definition at line 59 of file square.h.

References SIZE, and square.


Member Function Documentation

template<Player P, Direction D>
const Square osl::Square::back ( ) const [inline]

Definition at line 288 of file square.h.

References osl::D.

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

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

Definition at line 37 of file square.cc.

References osl::alt(), osl::Board_Table, and osl::BoardTable::nextSquare().

bool osl::Square::canPromote ( Int2Type< BLACK ) const [inline, private]

Definition at line 187 of file square.h.

References uintValue().

Referenced by osl::eval::ml::MajorCheckWithCapture::addOne(), osl::search::QuiescenceGenerator< P >::attackGoldWithPawn(), osl::search::QuiescenceGenerator< P >::attackKnightWithPawn(), osl::search::QuiescenceGenerator< P >::attackMajorPieceFirstSelection(), osl::search::QuiescenceGenerator< P >::attackSilverWithPawn(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateAttackRooks(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateRookRankBonus(), osl::search::ShouldPromoteCut::canIgnore(), osl::search::QuiescenceGenerator< P >::check(), osl::eval::See::computeValue(), osl::eval::TakeBackValue::computeValue(), osl::effect_action::SimpleBetterToPromote< Action >::doAction(), osl::effect_action::Promote< Action >::doAction(), osl::effect_action::SimpleMove< Action >::doAction(), osl::effect_action::BetterToPromote< Action >::doAction(), osl::effect_action::AlwaysMove< Action >::doAction(), osl::effect_action::SimpleBetterToPromote< Action >::doActionPtype(), osl::effect_action::SimpleMove< Action >::doActionPtype(), osl::effect_action::Promote< Action >::doActionPtype(), osl::effect_action::BetterToPromote< Action >::doActionPtype(), osl::effect_action::AlwaysMove< Action >::doActionPtype(), osl::checkmate::PawnCheckmateMoves::effectiveOnlyIfPawnCheckmate(), osl::eval::ml::RookPawn< Opening >::eval(), osl::move_generator::promote::MayPromoteDir< P, T, noCapture, Dir >::generateIfValid(), osl::move_generator::piece_on_board::generateLong(), osl::move_generator::without_effect::generateLongMove(), osl::move_generator::addeffect8::generateLongMove(), osl::move_generator::without_effect::generateLongMoveDirectCanPromote(), osl::move_generator::without_effect::generateMove(), osl::move_generator::detail::generateMovePiecePtypeMask(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::move_generator::addeffect8::generateShortMove(), osl::search::BigramKillerMove::getMove(), osl::checkmate::ImmediateCheckmate::hasCheckmateMoveDirPiece(), osl::Move::ignoreUnpromote(), osl::rating::Karanari::index(), osl::rating::LongTarget::isPromotable(), osl::state::SimpleState::isValidMoveByRule(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::rating::Karanari::match(), osl::move_probability::SeeFeature::match(), osl::move_probability::PatternBase< TestPromotable >::match(), osl::move_probability::LureDefender::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::Karanari::matchGeneral(), osl::eval::ml::SilverFork::matchGold(), osl::move_probability::PawnAttack::matchPtype(), osl::eval::ml::SilverFork::matchRook(), osl::record::ki2::show(), osl::record::psn::showXP(), osl::move_probability::PatternCommon::updateCacheOne(), osl::search::StateElements::validCaptureMove(), and osl::search::StateElements::validSimpleMove().

bool osl::Square::canPromote ( Int2Type< WHITE ) const [inline, private]

Definition at line 190 of file square.h.

References uintValue().

template<Player P>
bool osl::Square::canPromote ( ) const [inline]

Definition at line 197 of file square.h.

bool osl::Square::canPromote ( Player  player) const [inline]

Definition at line 200 of file square.h.

References osl::BLACK.

template<Player P>
static bool osl::Square::canPromoteY ( int  y,
Int2Type< P >   
) [static, private]
static bool osl::Square::canPromoteY ( int  y,
Int2Type< BLACK  
) [inline, static, private]

Definition at line 179 of file square.h.

static bool osl::Square::canPromoteY ( int  y,
Int2Type< WHITE  
) [inline, static, private]

Definition at line 183 of file square.h.

template<Player P>
static bool osl::Square::canPromoteY ( int  y) [inline, static]

Definition at line 195 of file square.h.

References canPromoteY().

Referenced by canPromoteY().

const Square osl::Square::flipHorizontal ( ) const [inline]
unsigned int osl::Square::index ( ) const [inline]

Definition at line 82 of file square.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::move_classifier::canAttackInThreeMoves(), osl::SquareCompressor::compress(), osl::state::NumEffectState::copyFrom(), osl::effect::NumSimpleEffectTable::copyFrom(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect::NumSimpleEffectTable::doEffectShort(), osl::search::BigramKillerMove::dump(), osl::checkmate::EdgeTable::EdgeTable(), osl::effect::NumSimpleEffectTable::effectSetAt(), osl::rating::PatternGroup::findMatch(), osl::progress::Effect5x3Table::getAttackEffect(), osl::effect::BoardBitMaskTable::getBishopMask(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::move_generator::addeffect8::AddEffect8Table::getDropSquare(), osl::effect::BoardBitMaskTable::getLanceMask(), osl::move_generator::addeffect8::AddEffect8Table::getLongDrop2Square(), osl::move_generator::addeffect8::AddEffect8Table::getLongDropDirect(), osl::move_generator::addeffect8::AddEffect8Table::getLongDropSquare(), osl::effect::BoardBitMaskTable::getMask(), osl::state::SimpleState::getPiecePtr(), osl::effect::BoardBitMaskTable::getRookMask(), osl::rating::CountEffect2::index(), osl::container::BoardMask::index(), osl::effect::BoardBitMaskTable::initBetweenMask(), osl::move_generator::addeffect8::AddEffect8Table::initDropSquare(), osl::SquareCompressor::Initializer::Initializer(), osl::move_generator::addeffect8::AddEffect8Table::initLongDropSquare(), osl::effect::BoardBitMaskTable::initMaskOfSquare(), isOnBoardRegion(), osl::eval::endgame::KingPieceTable::kingIndex(), main(), osl::container::BoardMaskTable5x5::mask(), osl::container::BoardMaskTable3x3::mask(), osl::container::BoardMaskTable5x3Center::mask(), osl::move_probability::LanceAttack::match(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::operator==(), osl::search::BigramKillerMove::operator[](), osl::eval::endgame::KingPieceTable::otherIndex(), osl::rating::PatternGroup::PatternGroup(), osl::state::SimpleState::pieceAt(), osl::progress::PtypeProgressTable::progress(), osl::progress::PtypeProgressTable::PtypeProgressTable(), osl::eval::endgame::KingPieceTable::randomize(), osl::checkmate::EdgeTable::resetEdgeFromLiberty(), osl::eval::endgame::KingPieceTable::resetWeights(), osl::ntesuki::Rzone::Rzone(), osl::eval::endgame::KingPieceTable::saveText(), osl::state::SimpleState::setBoard(), osl::search::BigramKillerMove::setMove(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::hash::HashGenTable::subHashKey(), osl::Centering3x3::Table::Table(), osl::Centering5x3::Table::Table(), osl::ntesuki::Rzone::test(), osl::search::MoveMarker::toIndex(), and osl::move_probability::PatternCommon::updateCacheOne().

int osl::Square::indexForOffset32 ( ) const [inline]

Definition at line 84 of file square.h.

References square.

static unsigned int osl::Square::indexMax ( ) [inline, static]

Definition at line 83 of file square.h.

References MIN, and SIZE.

Referenced by osl::ntesuki::Rzone::Rzone().

bool osl::Square::isEdge ( ) const [inline]
bool osl::Square::isLR ( Square  sq) const [inline]

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

Definition at line 239 of file square.h.

References isOnBoard(), and uintValue().

Referenced by osl::move_generator::detail::generateRookLongMove().

bool osl::Square::isOnBoard ( ) const [inline]

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

Definition at line 93 of file square.h.

References square.

Referenced by adjust(), osl::checkmate::detail::blockingDiagonalAttack(), osl::checkmate::detail::blockingVerticalAttack(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateSilverPenalty(), osl::eval::ml::KnightCheck::canCheck(), osl::eval::ml::GoldFeatures::canMoveToSide(), osl::rating::CountEffect2::count(), osl::state::NumEffectState::countEffect(), osl::mobility::countMobilityBoth(), osl::checkmate::FixedDepthSearcher::defense(), osl::checkmate::FixedDepthSearcher2::defense(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::move_probability::ToEffect::find(), osl::move_generator::Capture< Action >::generate(), osl::move_generator::detail::generateBishopLongMove(), osl::move_generator::detail::generateBishopLongMoveNotKing(), osl::move_generator::Escape< Action >::generateBlocking(), osl::move_generator::detail::generateDir(), osl::move_generator::detail::generateDirNotKing(), osl::move_generator::detail::generateKnightDir(), osl::move_generator::addeffect8::generateLongMove(), osl::ntesuki::NtesukiRecord::generateMoves(), osl::move_generator::addeffect8::generateShortMove(), osl::move_generator::AddEffect8Defense< P >::generateTo(), osl::move_generator::CaptureEffectToAroundKing8< P >::generateTo(), osl::progress::Effect5x3Table::getAttackEffect(), osl::effect::BoardBitMaskTable::getBishopMask(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::PtypeTable::getEffect(), osl::PtypeTable::getEffectNotLongU(), osl::effect::BoardBitMaskTable::getLanceMask(), osl::effect::Liberty8Table::getLongEffect(), osl::effect::Liberty8Table::getLongEffect2(), osl::effect::BoardBitMaskTable::getMask(), osl::move_generator::AddEffectTable::getNearMask(), osl::move_generator::AddEffectTable::getNearMaskLong(), osl::move_generator::AddEffectTable::getNearMaskPBISHOP(), osl::move_generator::AddEffectTable::getNearMaskPROOK(), osl::move_generator::AddEffectTable::getNearMaskWithPromote(), osl::move_generator::AddEffectTable::getOffsetLong(), osl::move_generator::AddEffectTable::getOffsetPBISHOP(), osl::move_generator::AddEffectTable::getOffsetPROOK(), osl::effect::BoardBitMaskTable::getRookMask(), osl::BoardTable::getShort8(), osl::effect::Liberty8Table::getShortMask(), osl::effect_util::Neighboring8Effect::Table::hasAtMaxPieceBetween(), osl::checkmate::ImmediateCheckmate::hasCheckmateMove(), osl::checkmate::ImmediateCheckmate::hasCheckmateMoveDir(), osl::state::NumEffectState::hasEffectAt(), osl::state::NumEffectState::hasEffectByNotPinned(), osl::state::NumEffectState::hasEffectByNotPinnedAndKing(), osl::state::NumEffectState::hasEffectByPiece(), osl::effect_util::Neighboring25Direct::hasEffectFromTo(), osl::effect_util::Neighboring8Effect::hasEffectFromTo(), osl::effect_util::Neighboring8Direct::hasEffectFromTo(), osl::checkmate::detail::hasKnightCheckmate(), osl::rating::CountEffect2::index(), osl::eval::ml::BishopExchangeSilverKing::indexRook(), osl::move_generator::addeffect8::AddEffect8Table::initDropSquare(), osl::move_generator::addeffect8::AddEffect8Table::initLongDropSquare(), osl::state::SimpleState::isConsistent(), osl::state::SimpleState::isEmptyBetween(), isLR(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::rating::LongTarget::isPromotable(), isU(), isUD(), isULRD(), osl::Move::isValid(), main(), osl::effect_util::Pin::makeByPiece(), osl::effect_util::Pin::makeByPieceKing(), osl::effect_util::Pin::makeNaive(), osl::Move::Move(), osl::rating::PatternLong::nextPieceOrEnd(), osl::rating::Pattern::nextSquare(), osl::BoardTable::nextSquare(), osl::effect::AddMaskAction< Liberty, P, T >::operator()(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::state::SimpleState::pieceOnBoard(), osl::effect::BoardBitMask::positionToOffset(), osl::threatmate::RichPredictor::predict(), osl::ntesuki::Rzone::Rzone(), osl::eval::ml::PiecePair::sanitize(), osl::ntesuki::NtesukiMoveGenerator::setOrder(), and squareForBlack().

bool osl::Square::isOnBoardRegion ( ) const [inline]

squareがONBOARD_MINとONBOARD_MAXの間にある

Definition at line 164 of file square.h.

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

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

Definition at line 10 of file square.cc.

References x(), and y().

bool osl::Square::isPieceStand ( ) const [inline]

Definition at line 86 of file square.h.

References PIECE_STAND, and square.

Referenced by osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::checkmate::LibertyEstimator::attackH(), osl::checkmate::attackProofCost(), osl::search::ShouldPromoteCut::canIgnore(), osl::eval::PieceEval::computeDiffAfterMove(), osl::eval::ppair::PiecePairEval< PiecePairWithStand< Table >, Table >::diffWithMove(), osl::eval::endgame::KingPieceTable::effectiveIndexOf(), 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::move_generator::promote::AllPromoteDir< P, T, noCapture, Dir >::generateIfValid(), osl::move_generator::promote::MayPromoteDir< P, T, noCapture, Dir >::generateIfValid(), osl::ntesuki::NtesukiRecord::generateMoves(), osl::move_generator::addeffect8::generateShortDrop(), osl::search::BigramKillerMove::getMove(), osl::state::NumEffectState::inCheck(), osl::eval::ml::PiecePair::index(), osl::rating::CountOpen::index(), osl::state::SimpleState::initPawnMask(), osl::state::SimpleState::isAlmostValidDrop(), osl::state::SimpleState::isAlmostValidMove(), osl::state::NumEffectState::isAlmostValidMove(), osl::state::SimpleState::isConsistent(), osl::Move::isDrop(), isEdge(), osl::move_classifier::Check< P >::isMember(), osl::move_classifier::SafeMove< P >::isMember(), osl::move_classifier::TrapRook< P >::isMember(), osl::move_classifier::PawnDropCheckmate< P >::isMember(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::Piece::isOnBoard(), osl::eval::ppair::PiecePairRawTable::loadFromBinaryFile(), osl::state::NumEffectState::makeMove(), osl::state::NumEffectState::makePinOpen(), osl::state::NumEffectState::makeUnmakeMove(), osl::rating::AttackKing8::match(), osl::rating::RookDefense::match(), osl::move_probability::MoveFromOpposingSliders::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::record::opening::OMove::OMove(), osl::operator<<(), osl::eval::ml::PiecePair::pieceValueDouble(), osl::record::OPiece::position2Bits(), osl::eval::endgame::KingPieceTable::randomize(), osl::state::NumEffectState::recalcPinOpen(), osl::eval::endgame::KingPieceTable::resetWeights(), rotate180Safe(), osl::eval::endgame::KingPieceTable::saveText(), osl::search::QuiescenceSearch2< EvalT >::searchMain(), osl::state::SimpleState::setPiece(), osl::record::psn::show(), osl::record::csa::show(), osl::record::ki2::show(), osl::container::PieceValues::showValues(), osl::record::psn::showXP(), osl::record::kakinoki::strToMove(), and osl::eval::ml::PiecePair::valueCompiled().

template<Player P>
bool osl::Square::isU ( Square  sq) const [inline]

sqがPlayer Pにとって上

Definition at line 228 of file square.h.

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

Referenced by osl::checkmate::detail::blockingVerticalAttack().

bool osl::Square::isUD ( Square  sq) const [inline]

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

Definition at line 219 of file square.h.

References isOnBoard(), and uintValue().

Referenced by osl::move_generator::detail::generateDirNotKing(), and osl::move_generator::detail::generateRookLongMove().

bool osl::Square::isULRD ( Square  sq) const [inline]

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

Definition at line 211 of file square.h.

References isOnBoard(), and uintValue().

Referenced by osl::move_generator::detail::generateRookLongMove(), and osl::move_generator::detail::generateRookLongMoveNotKing().

bool osl::Square::isValid ( ) const
static const Square osl::Square::makeDirect ( int  value) [inline, static]
static const Square osl::Square::makeNoCheck ( int  x,
int  y 
) [inline, static]
template<Player P, Direction D>
const Square osl::Square::neighbor ( ) const [inline]
const osl::Square osl::Square::neighbor ( Player  P,
Direction  D 
) const

Definition at line 31 of file square.cc.

References osl::Board_Table, and osl::BoardTable::nextSquare().

static const Square osl::Square::nth ( unsigned int  i) [inline, static]
static const Square osl::Square::onBoardMax ( ) [inline, static]

Definition at line 158 of file square.h.

References Square().

Referenced by isOnBoardRegion().

static const Square osl::Square::onBoardMin ( ) [inline, static]

Definition at line 159 of file square.h.

References Square().

Referenced by isOnBoardRegion(), and osl::search::MoveMarker::toIndex().

const Square osl::Square::operator+ ( Offset  offset) const [inline]

Definition at line 252 of file square.h.

References result.

Square& osl::Square::operator++ ( ) [inline]

Definition at line 169 of file square.h.

References square.

Square& osl::Square::operator+= ( Offset  offset) [inline]

Definition at line 244 of file square.h.

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

const Square osl::Square::operator- ( Offset  offset) const [inline]

Definition at line 256 of file square.h.

References result.

const Offset osl::Square::operator- ( Square  other) const [inline]

Definition at line 260 of file square.h.

References makeDirect(), and square.

Square& osl::Square::operator-= ( Offset  offset) [inline]

Definition at line 248 of file square.h.

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

static int osl::Square::reverseX ( int  x) [inline, static]

Definition at line 174 of file square.h.

References x().

static int osl::Square::reverseY ( int  y) [inline, static]
const Square osl::Square::rotate180 ( ) const [inline]
const Square osl::Square::rotate180EdgeOK ( ) const [inline]
const Square osl::Square::rotate180Safe ( ) const [inline]

Definition at line 145 of file square.h.

References isPieceStand().

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

const Square osl::Square::squareForBlack ( Int2Type< BLACK ) const [inline]
const Square osl::Square::squareForBlack ( Int2Type< WHITE ) const [inline]

Definition at line 116 of file square.h.

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

template<Player P>
const Square osl::Square::squareForBlack ( ) const [inline]

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

PIECE_STANDの場合は扱えない.

Definition at line 126 of file square.h.

const Square osl::Square::squareForBlack ( Player  player) const [inline]

Definition at line 129 of file square.h.

References osl::BLACK.

Definition at line 22 of file square.cc.

References osl::BLACK.

static const Square osl::Square::STAND ( ) [inline, static]
unsigned int osl::Square::uintValue ( ) const [inline]
int osl::Square::x ( ) const [inline]

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

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

Definition at line 73 of file square.h.

References square.

Referenced by osl::move_probability::King5x5Ptype::addOne(), osl::eval::ml::PiecePair::adjust12(), osl::Centering3x3::adjustCenterNaive(), osl::Centering5x3::adjustCenterNaive(), osl::search::QuiescenceGenerator< P >::attackGoldWithPawn(), osl::search::QuiescenceGenerator< P >::attackKing8(), osl::search::QuiescenceGenerator< P >::attackKnightWithPawn(), osl::search::QuiescenceGenerator< P >::attackSilverWithPawn(), osl::rating::BadLance::basicMatch(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::search::QuiescenceGenerator< P >::breakThreatmate(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateEnterKingBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateRookRankBonus(), osl::container::BitXmask::clear(), osl::record::KisenUtils::convertSquare(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), osl::mobility::RookMobility::countHorizontalAll(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::checkmate::EdgeTable::EdgeTable(), osl::eval::endgame::KingPieceTable::effectiveIndexOf(), osl::eval::ml::RookPawn< Opening >::eval(), osl::eval::ml::RookPawnY::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::King25EffectEach< Stage >::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::King25EffectEachBoth::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KingMobilitySum::evalOne(), osl::eval::ml::King25BothSide::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::eval::ml::King25EmptyAbs< Opening >::evalWithUpdate(), osl::eval::ml::King3Pieces::evalWithUpdate(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), osl::move_generator::addeffect8::findBlocker(), flipHorizontal(), osl::move_probability::SquareX::fromTo(), osl::search::BreakThreatmate::generate(), osl::search::BreakThreatmate::generateAddEffect(), osl::move_generator::detail::generateBishopLongMove(), osl::move_generator::detail::generateBishopLongMoveNotKing(), osl::search::BreakThreatmate::generateBreakDrop(), osl::move_generator::detail::generateDir(), osl::move_generator::detail::generateDirNotKing(), osl::move_generator::escape::generateDrop(), osl::ntesuki::NtesukiRecord::generateMoves(), osl::move_generator::detail::generateRookLongMove(), osl::move_generator::detail::generateRookLongMoveNotKing(), osl::move_generator::addeffect8::generateShortDrop(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring25Direct::hasEffectNaive(), osl::effect_util::Neighboring8Effect::hasEffectNaive(), osl::effect_util::Neighboring8Direct::hasEffectNaive(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PiecePair::index(), osl::eval::ml::PawnDropBoth::index(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::progress::ml::NewProgress::index(), osl::eval::ml::KingXBlockedBase::index(), osl::eval::ml::KingXBlockedYBase::index(), osl::eval::ml::KingXBothBlocked::index(), osl::eval::ml::KingXBlocked3::index(), osl::eval::ml::AnagumaEmpty::index(), osl::eval::ml::King25EmptyAbs< Opening >::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::PtypeX::index(), osl::eval::ml::LanceEffectPieceKingRelative::index(), osl::eval::ml::GoldAndSilverNearKing::index(), osl::eval::ml::RookEffectBase::index1(), osl::eval::ml::BishopEffectBase::index1(), osl::eval::ml::RookEffectBase::index2(), osl::eval::ml::BishopEffectBase::index2(), osl::eval::ml::GoldAndSilverNearKing::indexCombination(), osl::eval::ml::NonPawnAttacked::indexK(), osl::rating::BigramAttack::indexKing(), osl::eval::ml::PiecePairKing::indexKing(), osl::eval::ml::BishopExchangeSilverKing::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::RookMobilityAll::indexX(), osl::eval::ml::PawnDropBoth::indexX(), osl::progress::ml::NewProgress::indexX(), osl::eval::ml::King3Pieces::indexX(), osl::eval::ml::King25BothSide::indexX(), osl::eval::ml::King25Mobility::indexX(), osl::eval::ml::RookMobilityAll::indexXKingX(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::progress::ml::NewProgress::indexY(), osl::eval::ml::KingXBothBlocked::indexY(), osl::eval::ml::KingXBlocked3::indexY(), osl::state::SimpleState::initPawnMask(), osl::eval::ml::BishopRookFork::isBishopForkSquare(), osl::eval::ml::KingXBlockedBase::isBlocked(), isEdge(), osl::search::FirstMoveThreatmate::isMember(), isOnBoardSlow(), osl::eval::ml::BishopRookFork::isRookForkSquare(), osl::rating::Threatmate::knight2Step(), main(), 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::rating::RookDefense::match(), osl::move_probability::SquareX::match(), osl::rating::PawnAttack::match(), osl::move_probability::KingRelativeX::match(), osl::move_probability::PawnAttack::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::KingBlockade::match(), osl::eval::ml::KingMobility::mobilityDir(), osl::Offset32Base< Width, Width2 >::Offset32Base(), osl::record::opening::OMove::OMove(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::record::oposition_sort::operator()(), osl::record::opiece_sort::operator()(), osl::operator<<(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::record::OPiece::position2Bits(), osl::effect::BoardBitMask::positionToOffset(), osl::threatmate::RichPredictor::predict(), osl::progress::ml::NewProgress::progressOne(), osl::search::QuiescenceGenerator< P >::promote(), reverseX(), osl::record::KanjiMove::selectCandidates(), osl::progress::ml::NewProgress::setUp(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::record::myshogi::show(), osl::record::psn::show(), osl::record::csa::show(), osl::record::ki2::show(), show(), osl::checkmate::ImmediateCheckmate::slowHasCheckmateMoveDirPiece(), osl::search::QuiescenceSearch2< EvalT >::staticValue(), osl::eval::ml::PiecePair::sum12(), osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::eval::ml::OpenMidEndingEval::updateSub(), and osl::eval::ml::PiecePair::valueCompiled().

int osl::Square::y ( ) const [inline]

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

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

Definition at line 77 of file square.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::Centering5x3::adjustCenterNaive(), osl::Centering3x3::adjustCenterNaive(), osl::move_generator::detail::blockingU(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateEnterKingBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateGoldPenalty(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateMiddleKingBonus(), osl::eval::ProgressEvalGeneral< OpeningEval >::calculateSilverPenalty(), osl::PtypeTable::canDropTo(), osl::PtypePlayerTraits< T, P >::canDropTo(), osl::search::ShouldPromoteCut::canIgnore(), osl::eval::ml::SilverFeatures::canRetreat(), osl::eval::ml::GoldFeatures::canRetreat(), osl::record::KisenUtils::convertSquare(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), osl::mobility::RookMobility::countVerticalAll(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::checkmate::EdgeTable::EdgeTable(), osl::eval::endgame::KingPieceTable::effectiveIndexOf(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::King25EffectEach< Stage >::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::King25EffectEachBoth::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KingMobilitySum::evalOne(), osl::eval::ml::King25BothSide::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::PtypeYY::evalWithUpdate(), osl::eval::ml::King25EmptyAbs< Opening >::evalWithUpdate(), osl::eval::ml::King3Pieces::evalWithUpdate(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::eval::ml::PiecePairKing::evalWithUpdateBang(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), osl::move_generator::addeffect8::findBlocker(), flipHorizontal(), osl::move_probability::SquareY::fromTo(), osl::move_generator::detail::generateBishopLongMove(), osl::move_generator::detail::generateBishopLongMoveNotKing(), osl::move_generator::piece_on_board::generateLance(), osl::ntesuki::NtesukiRecord::generateMoves(), osl::move_generator::detail::generateOpenOrCapture(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::move_generator::detail::generateRookLongMove(), osl::move_generator::detail::generateRookLongMoveNotKing(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring25Direct::hasEffectNaive(), osl::effect_util::Neighboring8Effect::hasEffectNaive(), osl::effect_util::Neighboring8Direct::hasEffectNaive(), osl::Move::ignoreUnpromote(), osl::eval::ml::MajorY< true, ROOK >::index(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PiecePair::index(), osl::progress::ml::NewProgress::index(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::eval::ml::RookPawnY::index(), osl::eval::ml::PtypeYY::index(), osl::eval::ml::PieceStandY::index(), osl::eval::ml::KingXBlockedYBase::index(), osl::eval::ml::AnagumaEmpty::index(), osl::eval::ml::King25EmptyAbs< Opening >::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::PawnAdvanceUtil::index(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::RookRook::index(), osl::eval::ml::KnightAdvance::index(), osl::eval::ml::PtypeY::index(), osl::eval::ml::LanceEffectPieceKingRelative::index(), osl::eval::ml::GoldAndSilverNearKing::index(), osl::eval::ml::RookEffectBase::index1(), osl::eval::ml::BishopEffectBase::index1(), osl::eval::ml::RookEffectBase::index2(), osl::eval::ml::BishopEffectBase::index2(), osl::eval::ml::GoldAndSilverNearKing::indexCombination(), osl::eval::ml::NonPawnAttacked::indexK(), osl::rating::BigramAttack::indexKing(), osl::eval::ml::PiecePairKing::indexKing(), osl::eval::ml::BishopExchangeSilverKing::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::SilverFeatures::indexRetreat(), osl::eval::ml::GoldFeatures::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::King8Effect::indexY(), osl::eval::ml::RookMobilityAll::indexY(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::progress::ml::NewProgress::indexY(), osl::eval::ml::KingXBothBlocked::indexY(), osl::eval::ml::KingXBlocked3::indexY(), osl::eval::ml::King3Pieces::indexY(), osl::eval::ml::King25BothSide::indexY(), osl::eval::ml::King25Mobility::indexY(), osl::eval::ml::PromotedMinorPieces::indexY(), osl::eval::ml::BishopRookFork::isBishopForkSquare(), osl::eval::ml::KingXBlockedBase::isBlocked(), isEdge(), osl::search::FirstMoveThreatmate::isMember(), isOnBoardSlow(), osl::eval::ml::BishopRookFork::isRookForkSquare(), osl::rating::Threatmate::knight2Step(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), main(), 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::SquareY::match(), osl::rating::RookDefense::match(), osl::move_probability::KingRelativeY::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::PawnAttack::matchPtype(), osl::PtypePlayerTraits< T, P >::mayPromote(), osl::eval::ml::KingMobility::mobilityDir(), osl::Offset32Base< Width, Width2 >::Offset32Base(), osl::record::opening::OMove::OMove(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::record::oposition_sort::operator()(), osl::record::opiece_sort::operator()(), osl::operator<<(), osl::record::OPiece::position2Bits(), osl::effect::BoardBitMask::positionToOffset(), osl::threatmate::RichPredictor::predict(), osl::progress::ml::NewProgress::progressOne(), osl::search::QuiescenceGenerator< P >::promote(), reverseY(), osl::record::KanjiMove::selectCandidates(), osl::progress::ml::NewProgress::setUp(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::record::myshogi::show(), osl::record::psn::show(), osl::record::csa::show(), osl::record::ki2::show(), show(), osl::move_probability::CheckFeature::sign(), osl::checkmate::ImmediateCheckmate::slowHasCheckmateMoveDirPiece(), osl::search::QuiescenceSearch2< EvalT >::staticValue(), 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().

int osl::Square::y1 ( ) const [inline]

y+1を返す

Definition at line 81 of file square.h.

References square.

Referenced by osl::move_generator::piece_on_board::generateLong().

template<int Y>
bool osl::Square::yEq ( ) [inline]
template<int Y>
bool osl::Square::yGe ( typename boost::enable_if_c< Y!=7 >::type *  = 0) [inline]
template<int Y>
bool osl::Square::yGe ( typename boost::enable_if_c< Y==7 >::type *  = 0) [inline]

Definition at line 280 of file square.h.

References uintValue().

template<int Y>
bool osl::Square::yLe ( typename boost::enable_if_c< Y!=2 >::type *  = 0) [inline]
template<int Y>
bool osl::Square::yLe ( typename boost::enable_if_c< Y==2 >::type *  = 0) [inline]

Definition at line 272 of file square.h.

References uintValue().


Member Data Documentation

unsigned int osl::Square::square [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines