Class CsrProperties

java.lang.Object
org.flag4j.linalg.ops.sparse.csr.CsrProperties

public final class CsrProperties extends Object
Utility class containing methods useful for determining certain properties of general CSR matrices.
  • Method Details

    • isSymmetric

      public static <T> boolean isSymmetric(Shape shape, T[] values, int[] rowPointers, int[] colIndices, T zeroValue)
      Checks if a sparse CSR matrix is symmetric.
      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.
      zeroValue - Any value in values equal to zeroValue will be considered zero and will not be considered when determining the symmetry. Equality is determined according to Objects.equals(Object, Object) where if one of the parameters is null then the result will always be false. This means passing zeroValue = null will result in all items in values being considered. This is useful if there is no definable zero value for the values of the CSR matrix.
      Returns:
      true if the CSR matrix is symmetric; false otherwise.