Functions | |
bool | StaticIs1VitalAndConnected (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color) |
Check for 1-vitality, as explained in [Mueller 95, p. | |
bool | Has2SureLiberties (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color, const SgVector< SgPoint > &boundaryAnchors) |
Test if a point set is 2-vital for color. | |
bool | Has2IPorEyes (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color, const SgVector< SgPoint > &boundaryAnchors) |
Test if pts has 2 IP or eyes. | |
bool | IsSingleBlock (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color) |
Do pts belong to only one block? pts must be non-empty. | |
bool | IsSmallRegion (const GoBoard &board, const SgPointSet &pts, SgBlackWhite opp) |
A region is called small iff its interior is completely filled by opponent stones (or there is no interior). | |
void | FindCurrentAnchors (const GoBoard &board, const SgVector< SgPoint > &origAnchors, SgVector< SgPoint > *currentAnchors) |
Find anchors of all blocks represented by origAnchors that are present in current board position. |
void GoRegionUtil::FindCurrentAnchors | ( | const GoBoard & | board, | |
const SgVector< SgPoint > & | origAnchors, | |||
SgVector< SgPoint > * | currentAnchors | |||
) |
Find anchors of all blocks represented by origAnchors that are present in current board position.
Some of the origAnchors may have been captured in the meantime, and some anchors may have changed by extending and/or merging of blocks.
Definition at line 129 of file GoRegionUtil.cpp.
References GoBoard::Anchor(), SgVector< T >::Insert(), SgVector< T >::IsEmpty(), and SG_ASSERT.
bool GoRegionUtil::Has2IPorEyes | ( | const GoBoard & | board, | |
const SgPointSet & | pts, | |||
SgBlackWhite | color, | |||
const SgVector< SgPoint > & | boundaryAnchors | |||
) |
Test if pts has 2 IP or eyes.
Has2IPorEyes is called after all interior points are 2conn proved. It returns true if two intersection points are found or single boundary block forms two separate eyes.
Definition at line 138 of file GoRegionUtil.cpp.
References GoBoard::All(), SgPointSet::Disjoint(), SgPointSet::IsConnected(), and SgVector< T >::IsLength().
bool GoRegionUtil::Has2SureLiberties | ( | const GoBoard & | board, | |
const SgPointSet & | pts, | |||
SgBlackWhite | color, | |||
const SgVector< SgPoint > & | boundaryAnchors | |||
) |
Test if a point set is 2-vital for color.
Definition at line 149 of file GoRegionUtil.cpp.
References GoBoard::All(), GoBoard::AllEmpty(), SgPointSet::Border(), SG_ASSERT, GoBoard::Size(), and SgPointSet::SubsetOf().
bool GoRegionUtil::IsSingleBlock | ( | const GoBoard & | board, | |
const SgPointSet & | pts, | |||
SgBlackWhite | color | |||
) |
Do pts belong to only one block? pts must be non-empty.
Definition at line 178 of file GoRegionUtil.cpp.
References GoBoard::Anchor(), GoBoard::IsColor(), SgPointSet::NonEmpty(), SG_ASSERT, SG_DEBUG_ONLY, SG_NULLPOINT, GoBoard::Size(), and GoBoard::TotalNumEmpty().
bool GoRegionUtil::IsSmallRegion | ( | const GoBoard & | board, | |
const SgPointSet & | pts, | |||
SgBlackWhite | opp | |||
) |
A region is called small iff its interior is completely filled by opponent stones (or there is no interior).
This definition (and the name "small") is due to Benson. pts must be a region completely surrounded by opponent stones.
Definition at line 202 of file GoRegionUtil.cpp.
References GoBoard::All(), SgPointSet::Kernel(), GoBoard::Size(), and SgPointSet::SubsetOf().
Referenced by GoRegion::DoComputeFlag(), and StaticIs1VitalAndConnected().
bool GoRegionUtil::StaticIs1VitalAndConnected | ( | const GoBoard & | board, | |
const SgPointSet & | pts, | |||
SgBlackWhite | color | |||
) |
Check for 1-vitality, as explained in [Mueller 95, p.
****]
Definition at line 209 of file GoRegionUtil.cpp.
References GoBoardUtil::BlocksAdjacentToPoints(), GoBoard::IsEmpty(), IsSmallRegion(), SgVector< T >::MaxLength(), SgVector< T >::MinLength(), and SgOppBW().