Class RealDenseProperties

java.lang.Object
org.flag4j.linalg.ops.dense.real.RealDenseProperties

public final class RealDenseProperties extends Object
This class contains low-level implementations for ops which check if a tensor satisfies some property.
  • Method Details

    • isSymmetric

      public static boolean isSymmetric(double[] src, Shape shape)
      Checks if a real dense matrix is symmetric. That is, if the matrix is equal to its transpose.
      Parameters:
      src - Entries of the matrix.
      shape - Shape of the matrix.
      Returns:
      True if this matrix is symmetric
    • isAntiSymmetric

      public static boolean isAntiSymmetric(double[] src, Shape shape)
      Checks if a real dense matrix is anti-symmetric. That is, if the matrix is equal to its negative transpose.
      Parameters:
      src - Entries of the matrix.
      shape - Shape of the matrix.
      Returns:
      True if this matrix is anti-symmetric
    • isIdentity

      public static boolean isIdentity(Matrix src)
      Checks if a matrix is the identity matrix exactly.
      Parameters:
      src - Matrix of interest to check if it is the identity matrix.
      Returns:
      True if the src matrix is exactly the identity matrix.
    • isCloseToIdentity

      public static boolean isCloseToIdentity(Matrix src)
      Checks if a matrix is the identity matrix approximately. Specifically, if the diagonal data are no farther than 1.001E-5 in absolute value from 1.0 and the non-diagonal data are no larger than 1e-08 in absolute value. These tolerances are derived from the
      invalid reference
      TensorBase#allClose(Object)
      method.
      Parameters:
      src - Matrix of interest to check if it is the identity matrix.
      Returns:
      True if the src matrix is exactly the identity matrix.