GClasses
|
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 |
GNeighborGraph * | m_pNeighborGraph |
const GMatrix * | m_pPoints |
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 | ( | ) |
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.
|
protected |
void GClasses::GCycleCut::onDetectBigAtomicCycle | ( | std::vector< size_t > & | cycle | ) |
Internal method.
|
inline |
Sets the cycle-length threshold. (The default is 14.)
|
static |
Performs unit tests for this class. Throws an exception if there is a failure.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |