Class CsrRingProperties

java.lang.Object
org.flag4j.linalg.ops.sparse.csr.ring_ops.CsrRingProperties

public final class CsrRingProperties extends Object
This class contains methods to check properties of sparse CSR Ring matrices.
  • Method Details

    • allClose

      public static <T extends Ring<T>> boolean allClose(AbstractCsrRingMatrix<?,?,?,T> src1, AbstractCsrRingMatrix<?,?,?,T> src2, double relTol, double absTol)
      Checks if all data of this tensor are close to the data of the argument tensor.
      Parameters:
      src1 - First matrix in the comparison.
      src2 - Second matrix in the comparison.
      relTol - Relative tolerance.
      absTol - Absolute tolerance.
      Returns:
      True if the src1 matrix is the same shape as the src2 matrix and all data are 'close', i.e. elements a and b at the same positions in the two matrices respectively satisfy |a-b| <= (absTol + relTol*|b|). Otherwise, returns false.
    • isCloseToIdentity

      public static <T extends Ring<T>> boolean isCloseToIdentity(AbstractCsrRingMatrix<?,?,?,T> src)
      Checks if the src matrix is close to the identity matrix.
      Parameters:
      src - The matrix to check.
      Returns:
      True if the src matrix is close to identity matrix. False otherwise.
    • isHermitian

      public static <T extends Ring<T>> boolean isHermitian(Shape shape, T[] values, int[] rowPointers, int[] colIndices)
      Checks if a sparse CSR matrix is Hermitian.
      Parameters:
      shape - Shape of the CSR matrix.
      values - Non-zero values of a CSR matrix.
      rowPointers - Non-zero row pointers of the CSR matrix.
      colIndices - Non-zero column indices of the CSR matrix.
      Returns:
      true if the CSR matrix is Hermitian (i.e. equal to its conjugate transpose); false otherwise.