You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Iterating over nonzero elements of a GBMatrix sparse matrix #70
Is there any convenient accessor through Julia to iterate over the nonzero elements of a GBMatrix, with the full triplet information (i,j,v) instead of v alone? Similar to the SparseArrayspackage, i.e.,
rows = rowvals(A)
vals = nonzeros(A)
m, n = size(A)
for j = 1:n
for i in nzrange(A, j)
row = rows[i]
val = vals[i]
# ...
end
end
This shall be useful when the (i,j) information is needed with the mapor apply functionality.
Thank you for integrating the GraphBLAS into the Julia ecosystem!
There will be in the next release, likely Monday next week. It won't be an exported part of the interface yet, though, since the interface may change between releases.
Next week you'll be able to iterate by nz values by row (if GBMatrix is by-row), and by column (if GBMatrix is by-col).
A fuller interface will likely come with the revival of ArrayIteration.jl in the next month or so.
findnz(A) returns (I, J, V). For per-column or per-row iteration there are SuiteSparseGraphBLAS.iteratecols/iteraterows (not exported). Their sparse/hypersparse bugs were fixed in #158.
Activity
rayegun commentedon Apr 20, 2022
There will be in the next release, likely Monday next week. It won't be an exported part of the interface yet, though, since the interface may change between releases.
Next week you'll be able to iterate by nz values by row (if GBMatrix is by-row), and by column (if GBMatrix is by-col).
A fuller interface will likely come with the revival of ArrayIteration.jl in the next month or so.
rayegun commentedon Apr 20, 2022
For
mapthe missing functionality is user defined SelectOps. That will also be in the next release, I just overlooked them.fcdimitr commentedon Jun 13, 2022
@Wimmerer Thank you! Was the functionality you mentioned included in
v0.7.2? I could not find it in the docs.rayegun commentedon Jun 14, 2022
Sorry this is not ready yet, I'll try to get it out this week. It slipped my mind.
ViralBShah commentedon Oct 27, 2026
findnz(A)returns(I, J, V). For per-column or per-row iteration there areSuiteSparseGraphBLAS.iteratecols/iteraterows(not exported). Their sparse/hypersparse bugs were fixed in #158.