This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
229
stars
61
forks
source link
Utility functions for diagonal and inverse diagonal #96
Related to #94, it would be useful to have functions for diag (for turning a vector into a diagonal matrix) and diag^{-1} (for extracting the diagonal elements of a matrix).
These could be called LAGraph_diag(GrB_Matrix* A, GrB_Vector d) and LAGraph_inv_diag(GrB_Vector &d, GrB_Matrix A, boolean diagonal_only) (diagonal_only denoting whether matrix A only has diagonal elements, which makes the extraction trivial).
One of these is now in the spec (GrB_Matrix_diag, to build a matrix from a diagonal). The opposite, GxB_Vector_diag, to extract a diagonal from a matrix, is in SuiteSparse as a GxB method, but is not in the spec.
Related to #94, it would be useful to have functions for
diag
(for turning a vector into a diagonal matrix) anddiag^{-1}
(for extracting the diagonal elements of a matrix). These could be calledLAGraph_diag(GrB_Matrix* A, GrB_Vector d)
andLAGraph_inv_diag(GrB_Vector &d, GrB_Matrix A, boolean diagonal_only)
(diagonal_only
denoting whether matrixA
only has diagonal elements, which makes the extraction trivial).