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> booleanisSymmetric(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 invaluesequal tozeroValuewill 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 isnullthen the result will always befalse. This means passingzeroValue = nullwill result in all items invaluesbeing considered. This is useful if there is no definable zero value for the values of the COO matrix.- Returns:
trueif the specified COO matrix is symmetric (i.e. equal to its transpose);falseotherwise.
-