summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java')
-rw-r--r--src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java b/src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java
index c95038cc..d186c83c 100644
--- a/src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java
+++ b/src/de/lmu/ifi/dbs/elki/distance/distancefunction/ArcCosineDistanceFunction.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.distance.distancefunction;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -40,14 +40,14 @@ import de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizer;
* @author Arthur Zimek
*/
@Alias({ "arccos" })
-public class ArcCosineDistanceFunction extends AbstractSpatialDoubleDistanceFunction {
+public class ArcCosineDistanceFunction extends AbstractSpatialDistanceFunction {
/**
* Static instance
*/
public static final ArcCosineDistanceFunction STATIC = new ArcCosineDistanceFunction();
/**
- * Provides a CosineDistanceFunction.
+ * Constructor - use {@link #STATIC} instead.
*
* @deprecated Use static instance!
*/
@@ -67,18 +67,18 @@ public class ArcCosineDistanceFunction extends AbstractSpatialDoubleDistanceFunc
* @return the cosine distance for two given feature vectors v1 and v2
*/
@Override
- public double doubleDistance(NumberVector<?> v1, NumberVector<?> v2) {
+ public double distance(NumberVector v1, NumberVector v2) {
double d = Math.acos(VectorUtil.cosAngle(v1, v2));
- if (d < 0) {
+ if(d < 0) {
d = 0;
}
return d;
}
@Override
- public double doubleMinDist(SpatialComparable mbr1, SpatialComparable mbr2) {
+ public double minDist(SpatialComparable mbr1, SpatialComparable mbr2) {
double d = Math.acos(VectorUtil.minCosAngle(mbr1, mbr2));
- if (d < 0) {
+ if(d < 0) {
d = 0;
}
return d;
@@ -91,17 +91,17 @@ public class ArcCosineDistanceFunction extends AbstractSpatialDoubleDistanceFunc
@Override
public boolean equals(Object obj) {
- if (obj == null) {
+ if(obj == null) {
return false;
}
- if (obj == this) {
+ if(obj == this) {
return true;
}
return this.getClass().equals(obj.getClass());
}
@Override
- public SimpleTypeInformation<? super NumberVector<?>> getInputTypeRestriction() {
+ public SimpleTypeInformation<? super NumberVector> getInputTypeRestriction() {
return TypeUtil.NUMBER_VECTOR_VARIABLE_LENGTH;
}