Class SemiringCsrOps
java.lang.Object
org.flag4j.linalg.ops.sparse.csr.semiring_ops.SemiringCsrOps
-
Method Summary
-
Method Details
-
trace
Computes the trace of a sparse CSR matrix. That is, the sum of values along the principle diagonal of the matrix.- Parameters:
entries- Non-zero data of the CSR matrix.rowPointers- Non-zero row pointers of the CSR matrix.colIndices- Non-zero column indices of the CSR matrix.- Returns:
- The trace of the CSR matrix. If there are no non-zero data in this matrix along the principle diagonal, this method
will attempt to return the zero element of the semiring. However, if
data.length == 0then this cannot be determined andnullwill be returned instead.
-