GClasses
GClasses::GCycleCut Class Reference

Detailed Description

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

#include <GNeighborFinder.h>

Public Member Functions

 GCycleCut (GNeighborGraph *pNeighborGraph, const 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. More...
 
 ~GCycleCut ()
 
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. More...
 
void onDetectBigAtomicCycle (std::vector< size_t > &cycle)
 Internal method. More...
 
void setCycleThreshold (size_t cycleThresh)
 Sets the cycle-length threshold. (The default is 14.) More...
 

Static Public Member Functions

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

Protected Member Functions

bool doAnyBigAtomicCyclesExist ()
 

Protected Attributes

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

Constructor & Destructor Documentation

GClasses::GCycleCut::GCycleCut ( GNeighborGraph pNeighborGraph,
const 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_cycleThresh
protected
size_t GClasses::GCycleCut::m_k
protected
GNeighborGraph* GClasses::GCycleCut::m_pNeighborGraph
protected
const GMatrix* GClasses::GCycleCut::m_pPoints
protected