metrics
Class EuclidesMetric

java.lang.Object
  extended by metrics.EuclidesMetric
All Implemented Interfaces:
MetricModel

public class EuclidesMetric
extends java.lang.Object
implements MetricModel

Euclides metric return distance calculated by function: sum[sqrt(x_i - y_i)] for each element from inputs vectors, where x_i is first input vector element, y_i is second vector element.


Constructor Summary
EuclidesMetric()
          Creates a new instance of CityBlockMetric
 
Method Summary
 double getDistance(double[] firstVector, double[] secondVector)
          Return value containing the distance information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EuclidesMetric

public EuclidesMetric()
Creates a new instance of CityBlockMetric

Method Detail

getDistance

public double getDistance(double[] firstVector,
                          double[] secondVector)
Return value containing the distance information. firstVector vector and secondVector must have the same size otherwise function return -1

Specified by:
getDistance in interface MetricModel
Parameters:
firstVector - first vector
secondVector - second vector
Returns:
distance information