@Reference(authors="R. W. Hamming", title="Error detecting and error correcting codes", booktitle="Bell System technical journal, 29(2)", url="http://dx.doi.org/10.1002/j.1538-7305.1950.tb00463.x") public class HammingDistanceFunction extends AbstractSetDistanceFunction<FeatureVector<?>> implements NumberVectorDistanceFunction<FeatureVector<?>>
R. W. Hamming
Error detecting and error correcting codes
Bell System technical journal, 29(2)
Modifier and Type | Class and Description |
---|---|
static class |
HammingDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static HammingDistanceFunction |
STATIC
Static instance.
|
DOUBLE_NULL, INTEGER_NULL, STRING_NULL
Constructor and Description |
---|
HammingDistanceFunction() |
Modifier and Type | Method and Description |
---|---|
double |
distance(FeatureVector<?> o1,
FeatureVector<?> o2)
Computes the distance between two given DatabaseObjects according to this
distance function.
|
double |
distance(NumberVector o1,
NumberVector o2)
Computes the distance between two given vectors according to this distance
function.
|
SimpleTypeInformation<? super FeatureVector<?>> |
getInputTypeRestriction()
Get the input data type of the function.
|
private double |
hammingDistanceNumberVector(NumberVector o1,
NumberVector o2)
Version for number vectors.
|
boolean |
isMetric()
Is this distance function metric (in particular, does it satisfy the
triangle equation?)
|
isNull
instantiate, isSymmetric
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
instantiate, isSymmetric
public static final HammingDistanceFunction STATIC
public boolean isMetric()
DistanceFunction
isMetric
in interface DistanceFunction<FeatureVector<?>>
isMetric
in class AbstractPrimitiveDistanceFunction<FeatureVector<?>>
true
when metric.public double distance(FeatureVector<?> o1, FeatureVector<?> o2)
PrimitiveDistanceFunction
distance
in interface PrimitiveDistanceFunction<FeatureVector<?>>
distance
in class AbstractPrimitiveDistanceFunction<FeatureVector<?>>
o1
- first DatabaseObjecto2
- second DatabaseObjectpublic double distance(NumberVector o1, NumberVector o2)
NumberVectorDistanceFunction
distance
in interface NumberVectorDistanceFunction<FeatureVector<?>>
o1
- first DatabaseObjecto2
- second DatabaseObjectprivate double hammingDistanceNumberVector(NumberVector o1, NumberVector o2)
o1
- First vectoro2
- Second vectorpublic SimpleTypeInformation<? super FeatureVector<?>> getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<FeatureVector<?>>
getInputTypeRestriction
in interface PrimitiveDistanceFunction<FeatureVector<?>>
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.