JuliaSparse / SuiteSparseGraphBLAS.jl

Sparse, General Linear Algebra for Graphs!
MIT License
102 stars 17 forks source link

AbstractGBMatrix Rewrite #64

Closed rayegun closed 2 years ago

rayegun commented 2 years ago

Pretty major rewrite, solves several issues:

  1. A GBMatrix now stores Ref{Ptr{GB_Matrix_opaque}} rather than Ptr{GB_Matrix_opaque}. This allows us to avoid complexity with managing multiple GBMatrices that "own" the same C level GrB_Matrix.

  2. Most functions accept an AbstractGBMatrix/Vector/Array. This makes it much easier to create a new subtype that overloads some subset of the functionality.

  3. A GBMatrix (and an AbstractGBArray) now has a fill field. This defaults to nothing to replicate the current behavior. But for true matrices (not graphs) zero makes more sense. For all current datatypes fill only interacts with indexing. It does not participate in map, mul, reduce, ewise, select etc by virtue of 1. being a Julia level construct, and 2. GraphBLAS attaches fill values to the operators, not to the storage.

All of the above should make it easier to implement GBMatrixCSC (although it unfortunately won't live under AbstractSparseMatrixCSC), alias things correctly, and interop far better with Julia AbstractArray interface.

codecov-commenter commented 2 years ago

Codecov Report

Merging #64 (78f6675) into master (c01ad3a) will decrease coverage by 0.70%. The diff coverage is 60.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   35.94%   35.23%   -0.71%     
==========================================
  Files          49       50       +1     
  Lines        3703     3675      -28     
==========================================
- Hits         1331     1295      -36     
- Misses       2372     2380       +8     
Impacted Files Coverage Δ
src/SuiteSparseGraphBLAS.jl 88.88% <ø> (ø)
src/operations/resize.jl 0.00% <0.00%> (ø)
src/operations/sort.jl 0.00% <0.00%> (ø)
src/random.jl 73.33% <ø> (ø)
src/operations/operationutils.jl 48.14% <14.28%> (-11.86%) :arrow_down:
src/operations/reduce.jl 44.44% <25.00%> (ø)
src/vector.jl 40.00% <45.16%> (-5.53%) :arrow_down:
src/operations/extract.jl 45.00% <50.00%> (ø)
src/print.jl 57.89% <50.00%> (ø)
src/matrix.jl 49.15% <54.83%> (-6.23%) :arrow_down:
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c01ad3a...78f6675. Read the comment docs.