Package org.ujmp.core.util
Class EuclidianDistance
java.lang.Object
org.ujmp.core.util.EuclidianDistance
- All Implemented Interfaces:
DistanceMeasure
This distance measure yields the euclidian distance between two
samples of
double
values.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDistance
(double[] sample1, double[] sample2) Get the distance between two data samples.
-
Constructor Details
-
EuclidianDistance
public EuclidianDistance()
-
-
Method Details
-
getDistance
Get the distance between two data samples.- Specified by:
getDistance
in interfaceDistanceMeasure
- Parameters:
sample1
- the first sample ofdouble
valuessample2
- the second sample ofdouble
values- Returns:
- the distance between
sample1
andsample2
- Throws:
IllegalArgumentException
- if the two samples contain different amounts of values
-