1 #ifndef PMPL_NEIGHBORS_H_
2 #define PMPL_NEIGHBORS_H_
32 double distance{std::numeric_limits<double>::infinity()};
40 Neighbor(
const VID _target,
const double _distance);
42 Neighbor(
const VID _source,
const VID _target,
const double _distance);
93 Neighbor(
const VID _source,
const VID _target,
const double _distance)
103 return source == _other.source
104 and target == _other.target
105 and distance == _other.distance;
113 return !(*
this == _other);
123 return distance < _other.distance;
136 else if(_a.
target < _b.target)
138 else if(_a.
target > _b.target)
154 else if(_a.
source < _b.source)
156 else if(_a.
source > _b.source)
172 else if(_a.
source < _b.source)
174 else if(_a.
source > _b.source)
176 else if(_a.
target < _b.target)
178 else if(_a.
target > _b.target)
Definition: Neighbors.h:13
static Comparator OrderByDistanceThenSource() noexcept
Orders by distance, then source VID.
Definition: Neighbors.h:148
std::function< bool(const Neighbor &_a, const Neighbor &_b)> Comparator
Definition: Neighbors.h:22
static Comparator OrderByAll() noexcept
Orders by distance, then source, then target.
Definition: Neighbors.h:166
bool operator==(const Neighbor &_other) const noexcept
Checks equality with another Neighbor.
Definition: Neighbors.h:102
static Comparator OrderByDistanceThenTarget() noexcept
Orders by distance, then target VID.
Definition: Neighbors.h:130
double distance
The distance between source and target.
Definition: Neighbors.h:32
bool operator<(const Neighbor &_other) const noexcept
Orders by distance only.
Definition: Neighbors.h:122
bool operator!=(const Neighbor &_other) const noexcept
Checks inequality with another Neighbor.
Definition: Neighbors.h:112
size_t VID
Definition: Neighbors.h:18
VID source
The source VID.
Definition: Neighbors.h:28
VID target
The target VID.
Definition: Neighbors.h:29