org.ujmp.core.util
Class EuclidianDistance
- java.lang.Object
-
- org.ujmp.core.util.EuclidianDistance
-
- All Implemented Interfaces:
- DistanceMeasure
public class EuclidianDistance extends java.lang.Object implements DistanceMeasure
This distance measure yields the euclidian distance between two samples ofdoublevalues.
-
-
Constructor Summary
Constructors Constructor and Description EuclidianDistance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetDistance(double[] sample1, double[] sample2)Get the distance between two data samples.
-
-
-
Method Detail
-
getDistance
public double getDistance(double[] sample1, double[] sample2) throws java.lang.IllegalArgumentExceptionGet the distance between two data samples.- Specified by:
getDistancein interfaceDistanceMeasure- Parameters:
sample1- the first sample ofdoublevaluessample2- the second sample ofdoublevalues- Returns:
- the distance between
sample1andsample2 - Throws:
java.lang.IllegalArgumentException- if the two samples contain different amounts of values
-
-
DataMelt 3.0 © DataMelt by jWork.ORG