GClasses

GClasses::SOM::NodeAndDistance Class Reference

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

#include <GSelfOrganizingMap.h>

List of all members.

Public Member Functions

 NodeAndDistance (std::size_t nodeIdx, double distance)
 Create a NodeAndDistance object with the given index and distance.
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.

Public Attributes

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.
double distance
 The distance to the node from another point.

Detailed Description

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


Constructor & Destructor Documentation

GClasses::SOM::NodeAndDistance::NodeAndDistance ( std::size_t  nodeIdx,
double  distance 
) [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

The distance to the node from another point.

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.