GClasses

GClasses::GCycleCut Class Reference

This finds the shortcuts in a table of neighbors and replaces them with INVALID_INDEX. More...

#include <GNeighborFinder.h>

List of all members.

Public Member Functions

 GCycleCut (size_t *pNeighborhoods, GMatrix *pPoints, size_t k)
 pNeighborMap is expected to be an array of size n*k, where n is the number pPoints->rows(), and k is the number of neighbors.
 ~GCycleCut ()
void setCycleThreshold (size_t cycleThresh)
 Sets the cycle-length threshold. (The default is 14.)
size_t cut ()
 Do the cutting. Returns the number of edges that were removed. Any atomic cycles in the graph (where neighbors are treated as bi-directional) with a cycle-length of cycleThresh or bigger will be cut. It will make the smallest cut that removes all big atomic cycles.
void onDetectBigAtomicCycle (std::vector< size_t > &cycle)
 Internal method.

Static Public Member Functions

static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure.

Protected Member Functions

bool doAnyBigAtomicCyclesExist ()

Protected Attributes

size_t * m_pNeighborhoods
GMatrixm_pPoints
std::map< std::pair< size_t,
size_t >, double > 
m_capacities
std::vector< size_t > m_cuts
size_t m_k
size_t m_cycleThresh
double m_aveDist
size_t m_cutCount

Detailed Description

This finds the shortcuts in a table of neighbors and replaces them with INVALID_INDEX.


Constructor & Destructor Documentation

GClasses::GCycleCut::GCycleCut ( size_t *  pNeighborhoods,
GMatrix pPoints,
size_t  k 
)

pNeighborMap is expected to be an array of size n*k, where n is the number pPoints->rows(), and k is the number of neighbors.

GClasses::GCycleCut::~GCycleCut ( )

Member Function Documentation

size_t GClasses::GCycleCut::cut ( )

Do the cutting. Returns the number of edges that were removed. Any atomic cycles in the graph (where neighbors are treated as bi-directional) with a cycle-length of cycleThresh or bigger will be cut. It will make the smallest cut that removes all big atomic cycles.

bool GClasses::GCycleCut::doAnyBigAtomicCyclesExist ( ) [protected]
void GClasses::GCycleCut::onDetectBigAtomicCycle ( std::vector< size_t > &  cycle)

Internal method.

void GClasses::GCycleCut::setCycleThreshold ( size_t  cycleThresh) [inline]

Sets the cycle-length threshold. (The default is 14.)

static void GClasses::GCycleCut::test ( ) [static]

Performs unit tests for this class. Throws an exception if there is a failure.


Member Data Documentation

double GClasses::GCycleCut::m_aveDist [protected]
std::map<std::pair<size_t, size_t>, double> GClasses::GCycleCut::m_capacities [protected]
size_t GClasses::GCycleCut::m_cutCount [protected]
std::vector<size_t> GClasses::GCycleCut::m_cuts [protected]
size_t GClasses::GCycleCut::m_k [protected]