OverlayKey Ring Metric. More...
#include <Comparator.h>
Static Public Member Functions | |
| static OverlayKey | distance (const OverlayKey &x, const OverlayKey &y) |
| calculates the distance from x to y on a bidirectional ring | |
OverlayKey Ring Metric.
Definition at line 111 of file Comparator.h.
| static OverlayKey KeyRingMetric::distance | ( | const OverlayKey & | x, | |
| const OverlayKey & | y | |||
| ) | [inline, static] |
calculates the distance from x to y on a bidirectional ring
| x | origination key | |
| y | destination key |
Definition at line 121 of file Comparator.h.
{
OverlayKey dist1(x - y);
OverlayKey dist2(y - x);
if (dist1 > dist2)
return dist2;
else
return dist1;
}
1.7.1