Module org.cicirello.jpt
Package org.cicirello.sequences.distance
Interface SequenceDistanceMeasurerDouble
- All Known Subinterfaces:
SequenceDistanceMeasurer
- All Known Implementing Classes:
EditDistance
,EditDistanceDouble
,ExactMatchDistance
,KendallTauSequenceDistance
,LongestCommonSubsequenceDistance
public interface SequenceDistanceMeasurerDouble
Implement this interface, SequenceDistanceMeasurerDouble, to define a distance metric for
sequences. A sequence may have duplicate elements, unlike a Permutation which must have unique
elements. Some SequenceDistanceMeasurers may require the pair of sequences to be the same length,
while others do not have that requirement. Some SequenceDistanceMeasurers may require the pair of
sequences to contain the same set of elements, while others do not have that requirement.
Implementations of this interface compute distances that are floating-point valued.
If your sequences are guaranteed not to contain duplicates, and the pair is guaranteed to
contain the same set of elements, and are of the same length, then consider instead using the
classes that implement the PermutationDistanceMeasurerDouble
interface. Those classes are specifically for distance between
permutations of the integers from 0 to N-1.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
distancef
(boolean[] s1, boolean[] s2) Measures the distance between two arrays.double
distancef
(byte[] s1, byte[] s2) Measures the distance between two arrays.double
distancef
(char[] s1, char[] s2) Measures the distance between two arrays.double
distancef
(double[] s1, double[] s2) Measures the distance between two arrays.double
distancef
(float[] s1, float[] s2) Measures the distance between two arrays.double
distancef
(int[] s1, int[] s2) Measures the distance between two arrays.double
distancef
(long[] s1, long[] s2) Measures the distance between two arrays.double
distancef
(short[] s1, short[] s2) Measures the distance between two arrays.double
Measures the distance between two arrays of objects.double
Measures the distance between two Strings.<T> double
Measures the distance between two lists of objects.
-
Method Details
-
distancef
double distancef(long[] s1, long[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(int[] s1, int[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(short[] s1, short[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(byte[] s1, byte[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(char[] s1, char[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(double[] s1, double[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(float[] s1, float[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
double distancef(boolean[] s1, boolean[] s2) Measures the distance between two arrays.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
Measures the distance between two Strings.- Parameters:
s1
- First String.s2
- Second String.- Returns:
- distance between s1 and s2
-
distancef
Measures the distance between two arrays of objects. The objects in the arrays must be of a class that has overridden the Object.equals method.- Parameters:
s1
- First array.s2
- Second array.- Returns:
- distance between s1 and s2
-
distancef
Measures the distance between two lists of objects. The objects in the lists must be of a class that has overridden the Object.equals method.- Type Parameters:
T
- Type of List elements.- Parameters:
s1
- First list.s2
- Second list.- Returns:
- distance between s1 and s2
-