public class EuclideanDistanceMeasure extends Object implements DistanceMeasure
Modifier and Type | Method and Description |
---|---|
double |
distance(VectorWithNorm v1,
VectorWithNorm v2)
Measures the distance between two vectors.
|
int |
findClosest(VectorWithNorm[] centroids,
VectorWithNorm point)
Finds the index of the closest center to the given point.
|
static EuclideanDistanceMeasure |
getInstance() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInstance
public static final String NAME
public static EuclideanDistanceMeasure getInstance()
public double distance(VectorWithNorm v1, VectorWithNorm v2)
DistanceMeasure
Required: The two vectors should have the same dimension.
distance
in interface DistanceMeasure
public int findClosest(VectorWithNorm[] centroids, VectorWithNorm point)
DistanceMeasure
findClosest
in interface DistanceMeasure
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.