<p>Performs an element by element division operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> / b<sub>ij</sub> <br>
</p>
@param a The left matrix in the division operation. Modified.
@param b The right matrix in the division operation. Not modified.
333113
public static void elementDiv( DMatrix2x2 a , DMatrix2x2 b) {
        a.a11 /= b.a11; a.a12 /= b.a12;
        a.a21 /= b.a21; a.a22 /= b.a22;
    }
127831
public static void subtract(double val , DMatrixD1 a , DMatrixD1 c ) {
        c.reshape(a.numRows,a.numCols);

        final int length = a.getNumElements();

        for( int i = 0; i < length; i++ ) {
            c.data[i] = val - a.data[i];
        }
    }
313164
public static void addEquals(DMatrixD1 a , double beta, DMatrixD1 b )
    {
        if( a.numCols != b.numCols || a.numRows != b.numRows ) {
            throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions");
        }

        final int length = a.getNumElements();

        for( int i = 0; i < length; i++ ) {
            a.plus(i, beta * b.get(i));
        }
    }
152218
public static void addInPlace(double[] a, double b) {
    for (int i = 0; i < a.length; i++) {
      a[i] = a[i] + b;
    }
  }
1355359
public static double elementMin( DMatrix2 a ) {
        double min = a.a1;
        if( a.a2 < min ) min = a.a2;

        return min;
    }
192302
public static void changeSign( DMatrix2 a )
    {
        a.a1 = -a.a1;
        a.a2 = -a.a2;
    }
490574
public static void changeSign(DMatrixSparseCSC A , DMatrixSparseCSC B ) {
        if( A != B ) {
            B.copyStructure(A);
        }

        for (int i = 0; i < A.nz_length; i++) {
            B.nz_values[i] = -A.nz_values[i];
        }
    }
887365
public void set(int i, int j, Matrix<T> B)
    {
        int m = B.rows();
        int n = B.columns();
        for (int ii = 0; ii < m; ii++)
        {
            for (int jj = 0; jj < n; jj++)
            {
                set(i+ii, j+jj, B.get(ii, jj));
            }
        }
    }
1000736
public static void divide( DMatrix4 a , double alpha ) {
        a.a1 /= alpha;
        a.a2 /= alpha;
        a.a3 /= alpha;
        a.a4 /= alpha;
    }
225751
public static final DoubleMatrix2D add(DoubleMatrix2D A, DoubleMatrix2D B){
		if(A.rows()!=B.rows() || A.columns()!=B.columns()){
			throw new IllegalArgumentException("wrong matrices dimensions");
		}
		DoubleMatrix2D ret = DoubleFactory2D.dense.make(A.rows(), A.columns());
		for(int i=0; i<ret.rows(); i++){
			for(int j=0; j<ret.columns(); j++){
				ret.setQuick(i, j, A.getQuick(i, j) + B.getQuick(i, j));
			}
		}

		return ret;
	}
1253729
public boolean eq(Matrix B) {
        Matrix A = this;
        if (B.M != A.M || B.N != A.N) {
            throw new RuntimeException("Illegal matrix dimensions.");
        }
        for (int i = 0; i < M; i++) {
            for (int j = 0; j < N; j++) {
                if (A.data[i][j] != B.data[i][j]) {
                    return false;
                }
            }
        }
        return true;
    }
1220736
public static void fill( DMatrix4 a , double v  ) {
        a.a1 = v;
        a.a2 = v;
        a.a3 = v;
        a.a4 = v;
    }
480553
public static void addEquals( DMatrix3 a , DMatrix3 b ) {
        a.a1 += b.a1;
        a.a2 += b.a2;
        a.a3 += b.a3;
    }
1112233
public static IsNullValue merge(IsNullValue a, IsNullValue b) {
        if (a == b) {
            return a;
        }
        if (a.equals(b)) {
            return a;
        }
        int aKind = a.kind & 0xff;
        int bKind = b.kind & 0xff;
        int aFlags = a.getFlags();
        int bFlags = b.getFlags();

        int combinedFlags = aFlags & bFlags;

        if (!(a.isNullOnSomePath() || a.isDefinitelyNull()) && b.isException()) {
            combinedFlags |= EXCEPTION;
        } else if (!(b.isNullOnSomePath() || b.isDefinitelyNull()) && a.isException()) {
            combinedFlags |= EXCEPTION;
        }

        // Left hand value should be >=, since it is used
        // as the first dimension of the matrix to index.
        if (aKind < bKind) {
            int tmp = aKind;
            aKind = bKind;
            bKind = tmp;
        }
        assert aKind >= bKind;
        int result = mergeMatrix[aKind][bKind];

        IsNullValue resultValue = (result == NO_KABOOM_NN) ? noKaboomNonNullValue(a.locationOfKaBoom)
                : instanceByFlagsList[combinedFlags >> FLAG_SHIFT][result];

        return resultValue;
    }
1369305
protected void init(DMatrixRMaj A ) {
        UBV = A;

        m = UBV.numRows;
        n = UBV.numCols;

        min = Math.min(m,n);
        int max = Math.max(m,n);

        if( b.length < max+1 ) {
            b = new double[ max+1 ];
            u = new double[ max+1 ];
        }
        if( gammasU.length < m ) {
            gammasU = new double[ m ];
        }
        if( gammasV.length < n ) {
            gammasV = new double[ n ];
        }
    }
438947
@Override
  public GallicWeight divide(GallicWeight a, GallicWeight b) {
    if (isZero(a)) return zero;
    Preconditions.checkArgument(isNotZero(b), "cant divide by zero");
    IntArrayList newOutputLabels = new IntArrayList();
    for (int i = b.getLabels().size(); i < a.getLabels().size(); i++) {
      newOutputLabels.add(a.getLabels().get(i));
    }
    double newWeight = this.weightSemiring.divide(a.getWeight(), b.getWeight());
    return GallicWeight.create(newOutputLabels, newWeight);
  }
423314
public static double elementMinAbs( DMatrix2x2 a ) {
        double min = Math.abs(a.a11);
        double tmp = Math.abs(a.a12); if( tmp < min ) min = tmp;
        tmp = Math.abs(a.a21); if( tmp < min ) min = tmp;
        tmp = Math.abs(a.a22); if( tmp < min ) min = tmp;

        return min;
    }