mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
EdgePair Class Reference

An edge pair is simply two indices and a distance. More...

Public Member Functions

 EdgePair (const size_t lesser, const size_t greater, const double dist)
 Initialize an EdgePair with two indices and a distance. More...
 
double Distance () const
 Get the distance. More...
 
double & Distance ()
 Modify the distance. More...
 
size_t Greater () const
 Get the greater index. More...
 
size_t & Greater ()
 Modify the greater index. More...
 
size_t Lesser () const
 Get the lesser index. More...
 
size_t & Lesser ()
 Modify the lesser index. More...
 

Detailed Description

An edge pair is simply two indices and a distance.

It is used as the basic element of an edge list when computing a minimum spanning tree.

Definition at line 28 of file edge_pair.hpp.

Constructor & Destructor Documentation

EdgePair ( const size_t  lesser,
const size_t  greater,
const double  dist 
)
inline

Initialize an EdgePair with two indices and a distance.

The indices are called lesser and greater, implying that they be sorted before calling Init. However, this is not necessary for functionality; it is just a way to keep the edge list organized in other code.

Definition at line 45 of file edge_pair.hpp.

References Log::Assert().

Member Function Documentation

double Distance ( ) const
inline

Get the distance.

Definition at line 63 of file edge_pair.hpp.

double& Distance ( )
inline

Modify the distance.

Definition at line 65 of file edge_pair.hpp.

size_t Greater ( ) const
inline

Get the greater index.

Definition at line 58 of file edge_pair.hpp.

size_t& Greater ( )
inline

Modify the greater index.

Definition at line 60 of file edge_pair.hpp.

size_t Lesser ( ) const
inline

Get the lesser index.

Definition at line 53 of file edge_pair.hpp.

size_t& Lesser ( )
inline

Modify the lesser index.

Definition at line 55 of file edge_pair.hpp.


The documentation for this class was generated from the following file: