Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoRegionUtil Namespace Reference


Functions

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.
bool Has2IPorEyes (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color, const SgVector< SgPoint > &boundaryAnchors)
 Test if pts has 2 IP or eyes.
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 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).
bool StaticIs1VitalAndConnected (const GoBoard &board, const SgPointSet &pts, SgBlackWhite color)
 Check for 1-vitality, as explained in [Mueller 95, p.


Function Documentation

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 132 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 141 of file GoRegionUtil.cpp.

References GoBoard::All(), SgPointSet::Disjoint(), Has2IntersectionPoints(), 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 152 of file GoRegionUtil.cpp.

References GoBoard::All(), GoBoard::AllEmpty(), SgPointSet::Border(), Has2IntersectionPoints(), SG_ASSERT, GoBoard::Size(), and TwoSeparateEyes().

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 181 of file GoRegionUtil.cpp.

References GoBoard::Anchor(), GoBoard::IsColor(), SgPointSet::NonEmpty(), SG_ASSERT, SG_DEBUG_ONLY, SG_NULLPOINT, GoBoard::Size(), and GoBoard::TotalNumEmpty().

Referenced by TwoSeparateEyes().

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 205 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 212 of file GoRegionUtil.cpp.

References GoBoardUtil::BlocksAdjacentToPoints(), IsAdjacentToAll(), GoBoard::IsEmpty(), IsSmallRegion(), SgVector< T >::MaxLength(), SgVector< T >::MinLength(), and SgOppBW().


17 Jun 2010 Doxygen 1.4.7