Package org.ejml.ops

Class MatrixFeatures_D


  • public class MatrixFeatures_D
    extends java.lang.Object
    Generic (slow) matrix features for real matrices
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isEquals​(DMatrix a, DMatrix b)
      Checks to see if each element in the two matrices are equal: aij == bij
      static boolean isIdentical​(DMatrix a, DMatrix b, double tol)
      Checks to see if each corresponding element in the two matrices are within tolerance of each other or have the some symbolic meaning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatrixFeatures_D

        public MatrixFeatures_D()
    • Method Detail

      • isEquals

        public static boolean isEquals​(DMatrix a,
                                       DMatrix b)

        Checks to see if each element in the two matrices are equal: aij == bij

        NOTE: If any of the elements are NaN then false is returned. If two corresponding elements are both positive or negative infinity then they are equal.

        Parameters:
        a - A matrix. Not modified.
        b - A matrix. Not modified.
        Returns:
        true if identical and false otherwise.
      • isIdentical

        public static boolean isIdentical​(DMatrix a,
                                          DMatrix b,
                                          double tol)

        Checks to see if each corresponding element in the two matrices are within tolerance of each other or have the some symbolic meaning. This can handle NaN and Infinite numbers.

        If both elements are countable then the following equality test is used:
        |aij - bij| ≤ tol.
        Otherwise both numbers must both be Double.NaN, Double.POSITIVE_INFINITY, or Double.NEGATIVE_INFINITY to be identical.

        Parameters:
        a - A matrix. Not modified.
        b - A matrix. Not modified.
        tol - Tolerance for equality.
        Returns:
        true if identical and false otherwise.