This wraps a neighbor finding algorithm. It caches the queries for neighbors for the purpose of improving runtime performance.
More...
|
| GNeighborGraph (GNeighborFinder *pNF, bool own) |
| If own is true, then this will take ownership of pNF. More...
|
|
virtual | ~GNeighborGraph () |
|
size_t * | cache () |
| Returns the cache of neighbors. (You should probably call fillCache before calling this.) More...
|
|
size_t | cutShortcuts (size_t cycleLen) |
| Uses CycleCut to remove shortcut connections. (Assumes fillCache has already been called.) More...
|
|
void | fillCache () |
| Ensures that the cache is populated with data for every index in the dataset. More...
|
|
void | fillDistances (GDistanceMetric *pMetric) |
| (Re)computes all neighbor distances using the specified metric. More...
|
|
virtual bool | isCached () |
| See the comment for GNeighborFinder::isCached. More...
|
|
bool | isConnected () |
| Returns true iff the neighbors form a connected graph when each neighbor is evaluated as a bi-directional edge. (Assumes that fillCache has already been called.) More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, size_t index) |
| Returns the k-nearest neighbors of the point specified by index. The neighbors are not necessarily sorted, but you can call GNeighborFinder::sortNeighbors if you want them to be sorted. pOutNeighbors should be an array of size neighborCount. index refers to the point/vector whose neighbors you want to obtain. The value INVALID_INDEX may be used to fill slots with no point if necessary. More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, double *pOutDistances, size_t index) |
| Returns the k-nearest neighbors of the point specified by index. The neighbors are not necessarily sorted, but you can call GNeighborFinder::sortNeighbors if you want them to be sorted. pOutNeighbors and pOutDistances should both be arrays of size neighborCount. index refers to the point/vector whose neighbors you want to obtain. If there are not enough points in the data set to fill the neighbor array, the empty ones will have an index of INVALID_INDEX. More...
|
|
void | normalizeDistances () |
| Normalizes all the neighborhoods so that all neighbor distances are approximately 1. More...
|
|
void | patchMissingSpots (GRand *pRand) |
| Patches any missing neighbors by randomly selecting another of its neighbors to fill both spots. More...
|
|
GRandomIndexIterator & | randomEdgeIterator (GRand &rand) |
| Returns an iterator that can visit each edge in random order. More...
|
|
double * | squaredDistanceTable () |
| Returns the table of squared dissimilarities. More...
|
|
GNeighborFinder * | wrappedNeighborFinder () |
| Returns a pointer to the neighbor finder that this wraps. More...
|
|
| GNeighborFinder (const GMatrix *pData, size_t neighborCount) |
|
virtual | ~GNeighborFinder () |
|
virtual bool | canGeneralize () |
| Returns true if this neighbor finder can operate on points that are not in the dataset passed to the constructor. More...
|
|
const GMatrix * | data () |
| Returns the data passed to the constructor of this object. More...
|
|
size_t | neighborCount () |
| Returns the number of neighbors to find. More...
|
|
void | sortNeighbors (size_t *pNeighbors, double *pDistances) |
| Uses Quick Sort to sort the neighbors from least to most dissimilar, followed by any slots for with INVALID_INDEX for the index. (Note: This method is pointless, since the neighors are already guaranteed to come in sorted order. Todo: figure out why it is still here) More...
|
|
This wraps a neighbor finding algorithm. It caches the queries for neighbors for the purpose of improving runtime performance.