Class CsrProperties
java.lang.Object
org.flag4j.linalg.ops.sparse.csr.CsrProperties
Utility class containing methods useful for determining certain properties of general CSR matrices.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleanisSymmetric(Shape shape, T[] values, int[] rowPointers, int[] colIndices, T zeroValue) Checks if a sparse CSR matrix is symmetric.
-
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 invaluesequal tozeroValuewill be considered zero and will not be considered when determining the 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 CSR matrix.- Returns:
trueif the CSR matrix is symmetric;falseotherwise.
-