Java Utililty Methods Array Multiply

List of utility methods to do Array Multiply

Description

The list of methods to do Array Multiply are organized into topic(s).

Method

intmultiply(final int[] numbers)
multiply
int result = 1;
for (int i = 0; i < numbers.length; i++) {
    result *= numbers[i];
return result;
float[]multiply(float[] array, float factor)
Multiplies all entries of array by factor.
for (int i = 0; i < array.length; i++) {
    array[i] *= factor;
return array;
voidmultiply(float[] array, int multiplier)
multiply
int i, size = array.length;
for (i = 0; i < size; i++)
    array[i] *= multiplier;
float[]multiply(float[] in, float f)
multiply
float[] out = new float[in.length];
for (int i = 0; i < in.length; i++) {
    out[i] = in[i] * f;
return out;
float[]multiply(float[] mat, float[] mat2, float[] dest)
multiply
if (dest == null) {
    dest = mat;
float a00 = mat[0], a01 = mat[1], a02 = mat[2], a03 = mat[3];
float a10 = mat[4], a11 = mat[5], a12 = mat[6], a13 = mat[7];
float a20 = mat[8], a21 = mat[9], a22 = mat[10], a23 = mat[11];
float a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15];
float b0 = mat2[0], b1 = mat2[1], b2 = mat2[2], b3 = mat2[3];
...
float[]multiply(float[] v, double factor)
multiply
float[] r = new float[v.length];
for (int i = 0; i < v.length; i++) {
    r[i] = (float) (v[i] * factor);
return r;
voidmultiply(float[] v1, float[] v2)
multiply
if (v1.length != v2.length) {
    throw new IllegalArgumentException("Arrays lengths are different");
for (int i = 0; i < v1.length; i++) {
    v1[i] = v1[i] * v2[i];
voidmultiply(long[] x, long[] y, long[] z)
multiply
long y0 = y[0], y1 = y[1], y2 = y[2], y3 = y[3];
long y4 = y[4], y5 = y[5], y6 = y[6], y7 = y[7];
long z0 = 0, z1 = 0, z2 = 0, z3 = 0;
long z4 = 0, z5 = 0, z6 = 0, z7 = 0;
long z8 = 0;
for (int i = 0; i < 8; i += 2) {
    long x0 = x[i], x1 = x[i + 1];
    for (int j = 0; j < 64; ++j) {
...
voidmultiply(long[] x, long[] y, long[] z)
multiply
long x0 = x[0], x1 = x[1];
long y0 = y[0], y1 = y[1];
long z0 = 0, z1 = 0, z2 = 0;
for (int j = 0; j < 64; ++j) {
    long m0 = -(x0 & 1L);
    x0 >>>= 1;
    z0 ^= (y0 & m0);
    z1 ^= (y1 & m0);
...
voidmultiply(long[] x, long[] y, long[] z)
multiply
long x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3];
long y0 = y[0], y1 = y[1], y2 = y[2], y3 = y[3];
long z0 = 0, z1 = 0, z2 = 0, z3 = 0, z4 = 0;
for (int j = 0; j < 64; ++j) {
    long m0 = -(x0 & 1L);
    x0 >>>= 1;
    z0 ^= (y0 & m0);
    z1 ^= (y1 & m0);
...