Class SemiringCsrProperties

java.lang.Object
org.flag4j.linalg.ops.sparse.csr.semiring_ops.SemiringCsrProperties

public final class SemiringCsrProperties extends Object
Utility class containing methods useful for determining certain properties of a sparse CSR Semiring matrix.
  • Method Details

    • isTriU

      public static <T extends Semiring<T>> boolean isTriU(Shape shape, T[] entries, int[] rowPointers, int[] colIndices)
      Checks if a sparse CSR matrix is upper-triangular.
      Parameters:
      shape - Shape of the CSR matrix.
      entries - Non-zero data of the 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 upper-triangular; false otherwise.
    • isTriL

      public static <T extends Semiring<T>> boolean isTriL(Shape shape, T[] entries, int[] rowPointers, int[] colIndices)
      Checks if a sparse CSR matrix is lower-triangular.
      Parameters:
      shape - Shape of the CSR matrix.
      entries - Non-zero data of the 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 lower-triangular; false otherwise.
    • isIdentity

      public static <T extends Semiring<T>> boolean isIdentity(Shape shape, T[] entries, int[] rowPointers, int[] colIndices)
      Checks if the src matrix is the identity matrix.
      Parameters:
      src - The matrix to check if it is the identity matrix.
      Returns:
      True if the src matrix is the identity matrix. False otherwise.
    • isIdentity

      public static <T extends Semiring<T>> boolean isIdentity(AbstractCsrSemiringMatrix<?,?,?,T> src)
      Checks if the src matrix is the identity matrix.
      Parameters:
      src - The matrix to check if it is the identity matrix.
      Returns:
      True if the src matrix is the identity matrix. False otherwise.