List of utility methods to do Square
double | square(double a) square return a * a;
|
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]; ... |
double | square(final double num) Simple square number, just num * num. return num * num;
|
float | square(float number, int power) square float newNumber = 1; for (int i = 0; i < power; i++) { newNumber = newNumber * number; return newNumber; |
int | square(int n) Return square of N. if (n < sqCache.length) { return sqCache[n]; return n * n; |
int | square(int value) square return value * value;
|