List of utility methods to do Euclidean
long | euclideanGCD(final long firstNumerator, final long secondNumerator) euclidean GCD long firstEuclidean = firstNumerator; long secondEuclidean = secondNumerator; while (firstEuclidean != 0) { final long tempEuclidean = firstEuclidean; firstEuclidean = secondEuclidean % firstEuclidean; secondEuclidean = tempEuclidean; return Math.abs(secondEuclidean); ... |
long | euclideanGcd(long a, long b) euclidean Gcd while (b != 0) { long t = b; b = a % b; a = t; return a; |
double | euclideanLength(double[] vector) euclidean Length double x2 = 0; for (double d : vector) { x2 += d * d; return Math.sqrt(x2); |
float | euclideanMod(final float x, final float y) Returns Euclidean modulo of x , y . final float mod = x % y; return (mod < 0) ? mod + y : mod; |
float | euclideanNorm(float vector[]) euclidean Norm int n = vector.length; if (n < 1) { return 0; if (n == 1) { return Math.abs(vector[0]); double scale = 0; ... |
double | euclideanNormSquared(double[] x1, double[] x2) Computing the norm as the Euclidean norm squared (i.e. double distance = 0.0; for (int d = 0; d < x1.length; d++) { double difference = x1[d] - x2[d]; distance += difference * difference; return distance; |