LuxurySparse.jl icon indicating copy to clipboard operation
LuxurySparse.jl copied to clipboard

SparseMatrixCOO with duplicated keys

Open GiggleLiu opened this issue 5 years ago • 0 comments

julia> coo1 = SparseMatrixCOO(
           [1, 4, 2, 3, 3, 3],
           [1, 1, 2, 4, 3, 4],
           [0.1, 0.2, 0.4im, 0.5, 0.3, 0.5im],
           4,
           4,
       )
4×4 SparseMatrixCOO{Complex{Float64},Int64}:
 0.1+0.0im  0.0+0.0im  0.0+0.0im  0.0+0.0im
 0.0+0.0im  0.0+0.4im  0.0+0.0im  0.0+0.0im
 0.0+0.0im  0.0+0.0im  0.3+0.0im  0.5+0.5im
 0.2+0.0im  0.0+0.0im  0.0+0.0im  0.0+0.0im

julia> coo1[3,3] = 3.0
3.0

julia> coo1
4×4 SparseMatrixCOO{Complex{Float64},Int64}:
 0.1+0.0im  0.0+0.0im  0.0+0.0im  0.0+0.0im
 0.0+0.0im  0.0+0.4im  0.0+0.0im  0.0+0.0im
 0.0+0.0im  0.0+0.0im  3.3+0.0im  0.5+0.5im
 0.2+0.0im  0.0+0.0im  0.0+0.0im  0.0+0.0im

GiggleLiu avatar Oct 08 '20 04:10 GiggleLiu