GClasses
GClasses::GSequenceNeighborFinder Class Reference

A simple neighbor-finder that reports the nearest neighbors in the sequence. (That is, the previous and next rows are the closest neighbors.) The distance is sequential distance to the neighbor (not squared). More...

#include <GNeighborFinder.h>

Inheritance diagram for GClasses::GSequenceNeighborFinder:
GClasses::GNeighborFinder

Public Member Functions

 GSequenceNeighborFinder (GMatrix *pData, int neighborCount)
 
virtual ~GSequenceNeighborFinder ()
 
virtual void neighbors (size_t *pOutNeighbors, size_t index)
 Computes the neighbors of the specified vector. More...
 
virtual void neighbors (size_t *pOutNeighbors, double *pOutDistances, size_t index)
 Computes the neighbors and distances of the specified vector. More...
 
- Public Member Functions inherited from GClasses::GNeighborFinder
 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 GMatrixdata ()
 Returns the data passed to the constructor of this object. More...
 
virtual bool isCached ()
 Returns true iff the neighbors and distances are pre-computed. 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from GClasses::GNeighborFinder
static void sortNeighbors (size_t neighborCount, 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...
 
- Protected Attributes inherited from GClasses::GNeighborFinder
size_t m_neighborCount
 
const GMatrixm_pData
 

Detailed Description

A simple neighbor-finder that reports the nearest neighbors in the sequence. (That is, the previous and next rows are the closest neighbors.) The distance is sequential distance to the neighbor (not squared).

Constructor & Destructor Documentation

GClasses::GSequenceNeighborFinder::GSequenceNeighborFinder ( GMatrix pData,
int  neighborCount 
)
virtual GClasses::GSequenceNeighborFinder::~GSequenceNeighborFinder ( )
virtual

Member Function Documentation

virtual void GClasses::GSequenceNeighborFinder::neighbors ( size_t *  pOutNeighbors,
size_t  index 
)
virtual

Computes the neighbors of the specified vector.

Implements GClasses::GNeighborFinder.

virtual void GClasses::GSequenceNeighborFinder::neighbors ( size_t *  pOutNeighbors,
double *  pOutDistances,
size_t  index 
)
virtual

Computes the neighbors and distances of the specified vector.

Implements GClasses::GNeighborFinder.