Closed cdelv closed 1 year ago
No, this violates one of the core concepts of GraphBLAS: the pattern determines the sparsity not the operator/value. You can do dropzeros!
of course at any time.
GraphBLAS collections are not compressed over 0
, technically the implicit value is GrB_NO_VALUE
. To make things more interoperable with the rest of the Julia ecosystem the default fill is A.fill = 0
, but A.fill = missing
or A.fill = nothing
are perhaps closer to what is actually going on.
The original intent of GraphBLAS is to represent graphs, where it is perfectly reasonable for an edge to both exist and have a weight of 0
in the adjacency matrix.
@Wimmerer tnahk you for your answer. That's a shame, it makes a bit complicated what I'm trying to do. Although, I want to ask, it it possible to assign a GrB_NO_VALUE? For instance
A[1,2] = GrB_NO_VALUE
Thanks.
You mean to delete that entry by assignment (or no-op if it doesn't exist)? Not in the current wrapper, I'll add that as soon as I get a chance.
It will either be A[...] = GBScalar()
or A[...] = novalue
(novalue
will be a new constant in the next version).
Note also this is the direction that many sparse libraries (potentially including SparseArrays.jl) are going in. The sparsity structure shouldn't necessarily be coupled to the fill.
Hey @Wimmerer,
I come back to ask you if you had a chance to implement the assignment deletion of a matrix entry.
Best regards.
Hi, given a sparse matrix
Note that it is stored in memory element [2,2] although it's 0. Is it possible to do
A[2,2] = 0.0
and make the matrix not store it?However, if A[2,2] were to be different from 0 and then I set it to zero, it will be important to store it as 0 so I can drop it later (or it should drop it automatically). After all, it's a space matrix, zeros should not be stored.
Thanks.