Class CooProperties

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.CooProperties

public final class CooProperties extends Object
Utility class for computing certain properties of COO matrices. The methods in this class are agnostic to the type of COO matrix.
  • Method Details

    • isSymmetric

      public static <T> boolean isSymmetric(Shape shape, T[] data, int[] rowIndices, int[] colIndices, T zeroValue)
      Checks if a sparse COO matrix is symmetric.
      Parameters:
      shape - The shape of the COO matrix.
      data - Non-zero entries of the COO matrix.
      rowIndices - Non-zero row indices of the COO matrix.
      colIndices - Non-zero column indices of the COO matrix.
      zeroValue - Any value in values equal to zeroValue will be considered zero and will not be considered when determining 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 COO matrix.
      Returns:
      true if the specified COO matrix is symmetric (i.e. equal to its transpose); false otherwise.