GraphBLAS / LAGraph

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
225 stars 59 forks source link

bug fix for MMWrite (invalid output on array format) #253

Closed tweska closed 1 month ago

tweska commented 2 months ago

I ran into this bug yesterday when you write a dense matrix to a file using the LAGraph_MMWrite, the python scipy.io.mminfo function starts complaining when you read the file. This is because the array format is used when you write a dense matrix, but the MMWrite function still outputs the number of entries. This behavior should be different for the array format than for the coordinate format.

I consulted both the MatrixMarket format documentation, as well as your documentation (https://lagraph.readthedocs.io/en/latest/utils.html#array-format). It seems to agree that this is not correct behavior and Scipy has the right to scream. A quote from your documentation: For array format, the first non-comment line must appear, and it must contain just two integers

I hope I formatted everything correctly, let me know if I need to change anything.

DrTimothyAldenDavis commented 1 month ago

Yes, that's a bug. Thanks for catching that.

I changed the PR to make it for the v1.1_branch since stable branch is protected against PRs. The most recent development version is on the v1.2 branch, but the CI is currently failing there. The v1.2 branch is very different than v1.1; I tried to rebase to that but there were too many unrelated changes.