GClasses
GClasses::SOM::NodeAndDistance Class Reference

Detailed Description

Used for creating an array of nodes sorted by nearness to a source node.

#include <GSelfOrganizingMap.h>

Public Member Functions

 NodeAndDistance (std::size_t nodeIndex, double dist)
 Create a NodeAndDistance object with the given index and distance. More...
 
bool operator< (const NodeAndDistance &rhs) const
 Return true if this node has a smaller distance than rhs, or on equal distance compares their indices, breaking ties. More...
 

Public Attributes

double distance
 The distance to the node from another point. More...
 
std::size_t nodeIdx
 The index of the node to which this object gives the distance. I don't use a pointer in case the node array gets copied or reallocated. More...
 

Constructor & Destructor Documentation

GClasses::SOM::NodeAndDistance::NodeAndDistance ( std::size_t  nodeIndex,
double  dist 
)
inline

Create a NodeAndDistance object with the given index and distance.

Member Function Documentation

bool GClasses::SOM::NodeAndDistance::operator< ( const NodeAndDistance rhs) const
inline

Return true if this node has a smaller distance than rhs, or on equal distance compares their indices, breaking ties.

Member Data Documentation

double GClasses::SOM::NodeAndDistance::distance

The distance to the node from another point.

std::size_t GClasses::SOM::NodeAndDistance::nodeIdx

The index of the node to which this object gives the distance. I don't use a pointer in case the node array gets copied or reallocated.