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

boolean org::jblas::la::DoubleMatrix::equals ( Object  o  )  [inline]

Compare two matrices. Returns true if and only if other is also a DoubleMatrix which has the same size and the maximal absolute difference in matrix elements is smaller thatn 1e-6.

Definition at line 927 of file DoubleMatrix.java.

References columns, max(), rows, sameSize(), and sub().

                                    {
        if (!(o instanceof DoubleMatrix)) {
            return false;
        }

        DoubleMatrix other = (DoubleMatrix) o;

        if (!sameSize(other)) {
            return false;
        }

        DoubleMatrix diff = MatrixFunctions.absi(sub(other));

        return diff.max() / (rows * columns) < 1e-6;
    }


Generated by  Doxygen 1.6.0   Back to index