Skip to content

Iterating over nonzero elements of a GBMatrix sparse matrix #70

@fcdimitr

Description

@fcdimitr

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions