org.ujmp.core.util
Class EuclidianDistance

java.lang.Object
  extended by org.ujmp.core.util.EuclidianDistance
All Implemented Interfaces:
DistanceMeasure

public class EuclidianDistance
extends Object
implements DistanceMeasure

This distance measure yields the euclidian distance between two samples of double values.


Constructor Summary
EuclidianDistance()
           
 
Method Summary
 double getDistance(double[] sample1, double[] sample2)
          Get the distance between two data samples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EuclidianDistance

public EuclidianDistance()
Method Detail

getDistance

public double getDistance(double[] sample1,
                          double[] sample2)
                   throws IllegalArgumentException
Get the distance between two data samples.

Specified by:
getDistance in interface DistanceMeasure
Parameters:
sample1 - the first sample of double values
sample2 - the second sample of double values
Returns:
the distance between sample1 and sample2
Throws:
IllegalArgumentException - if the two samples contain different amounts of values


Copyright © 2010. All Rights Reserved.