Class MatrixFeatures_ZDRM

java.lang.Object
org.ejml.dense.row.MatrixFeatures_ZDRM

public class MatrixFeatures_ZDRM
extends Object

Functions for computing the features of complex matrices

  • Constructor Summary

    Constructors
    Constructor Description
    MatrixFeatures_ZDRM()  
  • Method Summary

    Modifier and Type Method Description
    static boolean hasNaN​(ZMatrixD1 m)
    Checks to see if any element in the matrix is NaN.
    static boolean hasUncountable​(ZMatrixD1 m)
    Checks to see if any element in the matrix is NaN of Infinite.
    static boolean isEquals​(ZMatrixD1 a, ZMatrixD1 b)
    Checks to see if each element in the two matrices are equal: aij == bij
    static boolean isEquals​(ZMatrixD1 a, ZMatrixD1 b, double tol)
    Checks to see if each element in the two matrices are within tolerance of each other: tol ≥ |aij - bij|.
    static boolean isHermitian​(ZMatrixRMaj Q, double tol)
    Hermitian matrix is a square matrix with complex entries that are equal to its own conjugate transpose.
    static boolean isIdentical​(ZMatrixD1 a, ZMatrixD1 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.
    static boolean isIdentity​(ZMatrix mat, double tol)
    Checks to see if the provided matrix is within tolerance to an identity matrix.
    static boolean isLowerTriangle​(ZMatrixRMaj A, int hessenberg, double tol)
    Checks to see if a matrix is lower triangular or Hessenberg.
    static boolean isNegative​(ZMatrixD1 a, ZMatrixD1 b, double tol)
    Checks to see if the two matrices are the negative of each other:

    aij = -bij
    static boolean isPositiveDefinite​(ZMatrixRMaj A)
    Checks to see if the matrix is positive definite.
    static boolean isUnitary​(ZMatrixRMaj Q, double tol)
    Unitary matrices have the following properties:

    Q*QH = I
    static boolean isUpperTriangle​(ZMatrixRMaj A, int hessenberg, double tol)
    Checks to see if a matrix is upper triangular or Hessenberg.
    static boolean isVector​(Matrix mat)
    Checks to see if the matrix is a vector or not.
    static boolean isZeros​(ZMatrixD1 m, double tol)
    Checks to see all the elements in the matrix are zeros

    Methods inherited from class java.lang.Object

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

    • MatrixFeatures_ZDRM

      public MatrixFeatures_ZDRM()
  • Method Details

    • isVector

      public static boolean isVector​(Matrix mat)
      Checks to see if the matrix is a vector or not.
      Parameters:
      mat - A matrix. Not modified.
      Returns:
      True if it is a vector and false if it is not.
    • isNegative

      public static boolean isNegative​(ZMatrixD1 a, ZMatrixD1 b, double tol)

      Checks to see if the two matrices are the negative of each other:

      aij = -bij

      Parameters:
      a - First matrix. Not modified.
      b - Second matrix. Not modified.
      tol - Numerical tolerance.
      Returns:
      True if they are the negative of each other within tolerance.
    • hasNaN

      public static boolean hasNaN​(ZMatrixD1 m)
      Checks to see if any element in the matrix is NaN.
      Parameters:
      m - A matrix. Not modified.
      Returns:
      True if any element in the matrix is NaN.
    • hasUncountable

      public static boolean hasUncountable​(ZMatrixD1 m)
      Checks to see if any element in the matrix is NaN of Infinite.
      Parameters:
      m - A matrix. Not modified.
      Returns:
      True if any element in the matrix is NaN of Infinite.
    • isEquals

      public static boolean isEquals​(ZMatrixD1 a, ZMatrixD1 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.
    • isEquals

      public static boolean isEquals​(ZMatrixD1 a, ZMatrixD1 b, double tol)

      Checks to see if each element in the two matrices are within tolerance of each other: tol ≥ |aij - bij|.

      NOTE: If any of the elements are not countable then false is returned.
      NOTE: If a tolerance of zero is passed in this is equivalent to calling isEquals(ZMatrixD1, ZMatrixD1)

      Parameters:
      a - A matrix. Not modified.
      b - A matrix. Not modified.
      tol - How close to being identical each element needs to be.
      Returns:
      true if equals and false otherwise.
    • isIdentical

      public static boolean isIdentical​(ZMatrixD1 a, ZMatrixD1 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.
    • isIdentity

      public static boolean isIdentity​(ZMatrix mat, double tol)
      Checks to see if the provided matrix is within tolerance to an identity matrix.
      Parameters:
      mat - Matrix being examined. Not modified.
      tol - Tolerance.
      Returns:
      True if it is within tolerance to an identify matrix.
    • isHermitian

      public static boolean isHermitian​(ZMatrixRMaj Q, double tol)

      Hermitian matrix is a square matrix with complex entries that are equal to its own conjugate transpose.

      a[i,j] = conj(a[j,i])

      Parameters:
      Q - The matrix being tested. Not modified.
      tol - Tolerance.
      Returns:
      True if it passes the test.
    • isUnitary

      public static boolean isUnitary​(ZMatrixRMaj Q, double tol)

      Unitary matrices have the following properties:

      Q*QH = I

      This is the complex equivalent of orthogonal matrix.

      Parameters:
      Q - The matrix being tested. Not modified.
      tol - Tolerance.
      Returns:
      True if it passes the test.
    • isPositiveDefinite

      public static boolean isPositiveDefinite​(ZMatrixRMaj A)

      Checks to see if the matrix is positive definite.

      xT A x > 0
      for all x where x is a non-zero vector and A is a hermitian matrix.

      Parameters:
      A - square hermitian matrix. Not modified.
      Returns:
      True if it is positive definite and false if it is not.
    • isUpperTriangle

      public static boolean isUpperTriangle​(ZMatrixRMaj A, int hessenberg, double tol)

      Checks to see if a matrix is upper triangular or Hessenberg. A Hessenberg matrix of degree N has the following property:

      aij ≤ 0 for all i < j+N

      A triangular matrix is a Hessenberg matrix of degree 0.

      Parameters:
      A - Matrix being tested. Not modified.
      hessenberg - The degree of being hessenberg.
      tol - How close to zero the lower left elements need to be.
      Returns:
      If it is an upper triangular/hessenberg matrix or not.
    • isLowerTriangle

      public static boolean isLowerTriangle​(ZMatrixRMaj A, int hessenberg, double tol)

      Checks to see if a matrix is lower triangular or Hessenberg. A Hessenberg matrix of degree N has the following property:

      aij ≤ 0 for all i < j+N

      A triangular matrix is a Hessenberg matrix of degree 0.

      Parameters:
      A - Matrix being tested. Not modified.
      hessenberg - The degree of being hessenberg.
      tol - How close to zero the lower left elements need to be.
      Returns:
      If it is an upper triangular/hessenberg matrix or not.
    • isZeros

      public static boolean isZeros​(ZMatrixD1 m, double tol)
      Checks to see all the elements in the matrix are zeros
      Parameters:
      m - A matrix. Not modified.
      Returns:
      True if all elements are zeros or false if not