The representation of sparse matrices allow for duplicates. This seems prone to errors, for instance computing the number of non-zeros entries would be incorrect.
Since this is not allowed in full matrices, does it make any sense to have this be the behavior for sparse matrices?
julia> a = spzeros(2, 3)
2脳3 SparseMatrixCSC{Float64,Int64} with 0 stored entries
julia> a[[1,1,1,1,1,1],2]=1
1
julia> a
2脳3 SparseMatrixCSC{Float64,Int64} with 6 stored entries:
[1, 2] = 1.0
[1, 2] = 1.0
[1, 2] = 1.0
[1, 2] = 1.0
[1, 2] = 1.0
[1, 2] = 1.0
Looks like a bug in setindex!
?
Most helpful comment
Looks like a bug in
setindex!
?