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> boolean
isSymmetric
(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 invalues
equal tozeroValue
will 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 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 CSR matrix.- Returns:
true
if the CSR matrix is symmetric;false
otherwise.
-