---
name: "mlpack_emst_EdgePair"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_emst_EdgePair"
---

# mlpack\_emst\_EdgePair(3)

An edge pair is simply two indices and a distance.

## NAME

mlpack::emst::EdgePair -

An edge pair is simply two indices and a distance.

## SYNOPSIS

### Public Member Functions

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

### Private Attributes

double **distance**\
 *Distance between two indices.*  size\_t **greater**\
 *Greater index.*  size\_t **lesser**\
 *Lesser index.*

## 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 38 of file edge\_pair.hpp.

## Constructor & Destructor Documentation

### mlpack::emst::EdgePair::EdgePair (const size\_tlesser, const size\_tgreater, const doubledist)` [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 55 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 73 of file edge\_pair.hpp.

References distance.

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

### double& mlpack::emst::EdgePair::Distance ()` [inline]`

Modify the distance.

Definition at line 75 of file edge\_pair.hpp.

References distance.

### size\_t mlpack::emst::EdgePair::Greater () const` [inline]`

Get the greater index.

Definition at line 68 of file edge\_pair.hpp.

References greater.

### size\_t& mlpack::emst::EdgePair::Greater ()` [inline]`

Modify the greater index.

Definition at line 70 of file edge\_pair.hpp.

References greater.

### size\_t mlpack::emst::EdgePair::Lesser () const` [inline]`

Get the lesser index.

Definition at line 63 of file edge\_pair.hpp.

References lesser.

### size\_t& mlpack::emst::EdgePair::Lesser ()` [inline]`

Modify the lesser index.

Definition at line 65 of file edge\_pair.hpp.

References lesser.

## Member Data Documentation

### double mlpack::emst::EdgePair::distance` [private]`

Distance between two indices.

Definition at line 46 of file edge\_pair.hpp.

Referenced by Distance().

### size\_t mlpack::emst::EdgePair::greater` [private]`

Greater index.

Definition at line 44 of file edge\_pair.hpp.

Referenced by Greater().

### size\_t mlpack::emst::EdgePair::lesser` [private]`

Lesser index.

Definition at line 42 of file edge\_pair.hpp.

Referenced by Lesser().

## Author

Generated automatically by Doxygen for MLPACK from the source code.
