public class VectorTools extends Object
| Constructor and Description |
|---|
VectorTools() |
| Modifier and Type | Method and Description |
|---|---|
static double |
manhattanDistance(double[] left,
double[] right)
Computes the Manhattan distance between the two given vectors.
|
static double |
manhattanDistance(List<Double> left,
List<Double> right)
Computes the Manhattan distance between the two given lists.
|
static double |
manhattanDistanceToZero(double[] values)
Computes the Manhattan distance of the given value vector to zero
|
static double |
manhattanDistanceToZero(List<Double> values)
Computes the Manhattan distance of the given value vector to zero
|
static double[] |
midPoint(double[] left,
double[] right)
Computes the midpoint of the two given vectors.
|
static double[] |
normalize(double[] v,
double sum)
Normalizes the given vector such that the sum of the elements
equals "sum"
|
static double |
sum(double[] v)
Computes the sum of the elements in v
|
public static double[] midPoint(double[] left,
double[] right)
left - right - public static double sum(double[] v)
v - public static double manhattanDistance(double[] left,
double[] right)
left - right - public static double manhattanDistance(List<Double> left, List<Double> right)
left - right - public static double manhattanDistanceToZero(List<Double> values)
values - a list of doubles.public static double manhattanDistanceToZero(double[] values)
values - a list of doubles.public static double[] normalize(double[] v,
double sum)
v - sum - Copyright © 2018. All rights reserved.