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

float[]multiplyHarmonics(float[] powerSpectrumInOut, int nHarmonics)
multiply Harmonics
for (int h = 0; h < nHarmonics; h++) {
    final int hop = h + 1;
    final int lim = powerSpectrumInOut.length / hop;
    for (int i = 0; i < lim; i++)
        powerSpectrumInOut[i] *= powerSpectrumInOut[i * hop];
return powerSpectrumInOut;
voidmultiplyInPlace(double[] img, double val)
multiply In Place
for (int i = 0; i < img.length; i++) {
    img[i] *= val;
voidmultiplyInto(double[] out, double[] a, double[] b)
multiply Into
double a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3], a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
        a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11], a30 = a[12], a31 = a[13], a32 = a[14],
        a33 = a[15];
double b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;
out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;
out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;
out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
...
voidmultiplyP(int[] x)
multiply P
boolean lsb = (x[3] & 1) != 0;
shiftRight(x);
if (lsb) {
    x[0] ^= 0xe1000000;
voidmultiplyP(int[] x)
multiply P
if (shiftRight(x) != 0) {
    x[0] ^= E1;
voidmultiplyP(int[] x)
multiply P
int m = shiftRight(x) >> 8;
x[0] ^= (m & E1);
voidmultiplyP(int[] x)
multiply P
boolean lsb = (x[3] & 1) != 0;
shiftRight(x);
if (lsb) {
    x[0] ^= 0xe1000000;
voidmultiplyP8(int[] x)
multiply P
int lsw = x[3];
shiftRightN(x, 8);
for (int i = 7; i >= 0; --i) {
    if ((lsw & (1 << i)) != 0) {
        x[0] ^= (0xe1000000 >>> (7 - i));
voidmultiplyP8(int[] x)
multiply P
int lsw = x[3];
shiftRightN(x, 8);
for (int i = 7; i >= 0; --i) {
    if ((lsw & (1 << i)) != 0) {
        x[0] ^= (0xe1000000 >>> (7 - i));
voidMultiplyPointSimilarityInhomogenous(double[] xp, int idx, double[] H, double[] x, int idx2)
Multiply an in-homogenous point by a similarity.
public static void MultiplyPointSimilarityInhomogenous(double[] xp, int idx, double[] H, double[] x, int idx2) {
    xp[idx + 0] = H[0] * x[idx2 + 0] + H[1] * x[idx2 + 1] + H[2];
    xp[idx + 1] = H[3] * x[idx2 + 0] + H[4] * x[idx2 + 1] + H[5];