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.
00123 { 00124 OverlayKey dist1(x - y); 00125 OverlayKey dist2(y - x); 00126 00127 if (dist1 > dist2) 00128 return dist2; 00129 else 00130 return dist1; 00131 }