public class ManhattanDistance extends KNNDistance
values, valuesLength| Constructor and Description |
|---|
ManhattanDistance() |
| Modifier and Type | Method and Description |
|---|---|
void |
calculateValues(double v1,
double v2)
Method to cumulate partial calculations of distance between two vectors and save it to values array.
|
double |
nom(double v1,
double v2)
Method to calculate the distance between two points from two vectors.
|
double |
result()
Calculate the result from cumulated values.
|
initializeValuespublic double nom(double v1,
double v2)
KNNDistancenom in class KNNDistancev1 - value of an item in the first vectorv2 - value of an item in the second vectorpublic void calculateValues(double v1,
double v2)
KNNDistancecalculateValues in class KNNDistancev1 - value of an item in the first vectorv2 - value of an item in the second vectorpublic double result()
KNNDistanceresult in class KNNDistance