mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::emst::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...
 

Private Attributes

double distance
 Distance between two indices. More...
 
size_t greater
 Greater index. More...
 
size_t lesser
 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

mlpack::emst::EdgePair::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 mlpack::Log::Assert().

Member Function Documentation

double mlpack::emst::EdgePair::Distance ( ) const
inline

Get the distance.

Definition at line 63 of file edge_pair.hpp.

References distance.

Referenced by mlpack::emst::DualTreeBoruvka< MetricType, MatType, TreeType >::SortEdgesHelper::operator()().

double& mlpack::emst::EdgePair::Distance ( )
inline

Modify the distance.

Definition at line 65 of file edge_pair.hpp.

References distance.

size_t mlpack::emst::EdgePair::Greater ( ) const
inline

Get the greater index.

Definition at line 58 of file edge_pair.hpp.

References greater.

size_t& mlpack::emst::EdgePair::Greater ( )
inline

Modify the greater index.

Definition at line 60 of file edge_pair.hpp.

References greater.

size_t mlpack::emst::EdgePair::Lesser ( ) const
inline

Get the lesser index.

Definition at line 53 of file edge_pair.hpp.

References lesser.

size_t& mlpack::emst::EdgePair::Lesser ( )
inline

Modify the lesser index.

Definition at line 55 of file edge_pair.hpp.

References lesser.

Member Data Documentation

double mlpack::emst::EdgePair::distance
private

Distance between two indices.

Definition at line 36 of file edge_pair.hpp.

Referenced by Distance().

size_t mlpack::emst::EdgePair::greater
private

Greater index.

Definition at line 34 of file edge_pair.hpp.

Referenced by Greater().

size_t mlpack::emst::EdgePair::lesser
private

Lesser index.

Definition at line 32 of file edge_pair.hpp.

Referenced by Lesser().


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