Interface NormalizedPermutationDistanceMeasurerDouble
-
- All Known Subinterfaces:
NormalizedPermutationDistanceMeasurer
- All Known Implementing Classes:
AcyclicEdgeDistance
,BlockInterchangeDistance
,CyclicEdgeDistance
,CyclicRTypeDistance
,DeviationDistance
,DeviationDistanceNormalized
,DeviationDistanceNormalized2005
,ExactMatchDistance
,InterchangeDistance
,KendallTauDistance
,LeeDistance
,ReinsertionDistance
,ReversalDistance
,RTypeDistance
,ScrambleDistance
,SquaredDeviationDistance
public interface NormalizedPermutationDistanceMeasurerDouble
Implement this interface to define a distance metric for permutations that supports normalizing the distance to the interval [0,1].
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
maxf(int length)
Computes the maximum possible distance between permutations of a specified length.double
normalizedDistance(Permutation p1, Permutation p2)
Measures the distance between two permutations, normalized to the interval [0.0, 1.0].
-
-
-
Method Detail
-
normalizedDistance
double normalizedDistance(Permutation p1, Permutation p2)
Measures the distance between two permutations, normalized to the interval [0.0, 1.0].
- Parameters:
p1
- first permutationp2
- second permutation- Returns:
- distance between p1 and p2 normalized to the interval [0.0, 1.0]
- Throws:
IllegalArgumentException
- if p1.length() is not equal to p2.length().
-
maxf
double maxf(int length)
Computes the maximum possible distance between permutations of a specified length.- Parameters:
length
- Permutation length.- Returns:
- the maximum distance between a pair of permutations of the specified length.
-
-