Java Utililty Methods Matrix Square

List of utility methods to do Matrix Square

Description

The list of methods to do Matrix Square are organized into topic(s).

Method

double[]sqr(double[] a, double res[])
sqr
for (int i = 0; i < a.length; i++) {
    res[i] = a[i] * a[i];
return res;
floatsqrdist(float[] a, float[] b)
sqrdist
float sum = 0;
for (int i = 0; i < a.length; i++) {
    float diff = a[i] - b[i];
    sum += diff * diff;
return sum;
floatsqrEuclidianDist(float[] p, float[] q)
Squared Euclidian distance of p and q.
float sum = 0;
for (int i = 0; i < p.length; i++) {
    sum += (p[i] - q[i]) * (p[i] - q[i]);
return sum;
double[]sqrt(double[] v)
sqrt
double[] newv = new double[v.length];
for (int i = 0; i < v.length; i++)
    newv[i] = Math.sqrt(v[i]);
return newv;
voidsqrt(double[] vector)
sqrt
for (int i = 0; i < vector.length; i++)
    vector[i] = Math.sqrt(vector[i]);