de.unibi.techfak.jpredictor.clustering
Class EuclideanDistance

java.lang.Object
  extended by de.unibi.techfak.jpredictor.clustering.RelationMeasure
      extended by de.unibi.techfak.jpredictor.clustering.VectorRelationMeasure
          extended by de.unibi.techfak.jpredictor.clustering.MinkowskiDistance
              extended by de.unibi.techfak.jpredictor.clustering.EuclideanDistance
All Implemented Interfaces:
Computable, java.lang.Comparable

public class EuclideanDistance
extends MinkowskiDistance

The Minkowski distance for the special case p=2.


Field Summary
 
Fields inherited from class de.unibi.techfak.jpredictor.clustering.MinkowskiDistance
p
 
Fields inherited from class de.unibi.techfak.jpredictor.clustering.VectorRelationMeasure
vectorList
 
Fields inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
computationResult
 
Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING
 
Constructor Summary
EuclideanDistance()
          Generates the distance measure and sets the exponent to 1.
 
Method Summary
static double calculate(double[] x, double[] y)
          Calculates the Euclidean distance between two given arrays.
 java.lang.String toString()
          Creates a short string of this relation measure and maybe some results if available.
 
Methods inherited from class de.unibi.techfak.jpredictor.clustering.MinkowskiDistance
atomicCombine, atomicNormalize, calculate, compute, getP, newInstance, optimum, setP
 
Methods inherited from class de.unibi.techfak.jpredictor.clustering.VectorRelationMeasure
add, add, add, clear, length
 
Methods inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
atomicCombine, compareTo, optimum, result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EuclideanDistance

public EuclideanDistance()
Generates the distance measure and sets the exponent to 1.

Method Detail

calculate

public static double calculate(double[] x,
                               double[] y)
Calculates the Euclidean distance between two given arrays. Returns Double.NaN in case of any error, e.g. x or y are null or of inequal length.

Parameters:
x - The first array.
y - The second array
Returns:
The Euclidean distance between the two arrays.

toString

public java.lang.String toString()
Description copied from class: RelationMeasure
Creates a short string of this relation measure and maybe some results if available.

Overrides:
toString in class MinkowskiDistance
Returns:
A string with a short description of the class.