Class CooProperties
java.lang.Object
org.flag4j.linalg.ops.sparse.coo.CooProperties
Utility class for computing certain properties of COO matrices. The methods in this class are agnostic to the type of COO matrix.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
isSymmetric
(Shape shape, T[] data, int[] rowIndices, int[] colIndices, T zeroValue) Checks if a sparse COO matrix is symmetric.
-
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 invalues
equal tozeroValue
will be considered zero and will not be considered when determining symmetry. Equality is determined according toObjects.equals(Object, Object)
where if one of the parameters isnull
then the result will always befalse
. This means passingzeroValue = null
will result in all items invalues
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.
-