The list of methods to do Square are organized into topic(s).
double[]
square(double[] in, double[] out) Squares each element of the input vector and puts it into the out vector.
if (out == null) {
out = new double[in.length];
if (in.length != out.length) {
throw new IllegalArgumentException("in.length != out.length: " + in.length + " vs. " + out.length);
for (int i = 0; i < in.length; i++) {
double a = in[i];
...
double[][]
square(double[][] m) Multiply a square matrix by itself
assert (m[0].length == m.length);
int n = m.length;
double[][] res = new double[n][n];
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++) {
double sum = 0.0;
for (int k = 0; k < n; k++)
sum += m[i][k] * m[j][k];
...
int
square(int n) Return square of N.
if (n < sqCache.length) {
return sqCache[n];
return n * n;