Logo Search packages:      
Sourcecode: jblas version File versions  Download package

DoubleMatrix org::jblas::la::DoubleMatrix::maxi ( DoubleMatrix  other,
DoubleMatrix  result 
) [inline]

Computes the maximum between two matrices. Returns the larger of the corresponding elements in the matrix (in-place).

Definition at line 1726 of file DoubleMatrix.java.

References get(), and put().

Referenced by max(), and maxi().

                                                                      {
        if (result == this) {
            for (int i = 0; i < length; i++) {
                if (get(i) < other.get(i)) {
                    put(i, other.get(i));
                }
            }
        } else {
            for (int i = 0; i < length; i++) {
                if (get(i) < other.get(i)) {
                    result.put(i, other.get(i));
                } else {
                    result.put(i, get(i));
                }
            }
        }
        return this;
    }


Generated by  Doxygen 1.6.0   Back to index