Skip to content

Commit

Permalink
fix singular for sparse vector
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Feb 7, 2017
1 parent 5526b5f commit 97258a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ julia> A = sparse([1 2; 0 0])
[1, 2] = 2
julia> Base.SparseArrays.dropstored!(A, 1, 2); A
2×2 SparseMatrixCSC{Int64,Int64} with 1 stored entries:
2×2 SparseMatrixCSC{Int64,Int64} with 1 stored entry:
[1, 2] = 1
```
"""
Expand Down
6 changes: 3 additions & 3 deletions base/sparse/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ julia> x = sparsevec([1, 3], [1.0, 2.0])
[3] = 2.0
julia> Base.SparseArrays.dropstored!(x, 3)
3-element SparseVector{Float64,Int64} with 1 stored entries:
3-element SparseVector{Float64,Int64} with 1 stored entry:
[1] = 1.0
julia> Base.SparseArrays.dropstored!(x, 2)
3-element SparseVector{Float64,Int64} with 1 stored entries:
3-element SparseVector{Float64,Int64} with 1 stored entry:
[1] = 1.0
```
"""
Expand Down Expand Up @@ -732,7 +732,7 @@ getindex(x::AbstractSparseVector, ::Colon) = copy(x)
function show(io::IO, ::MIME"text/plain", x::AbstractSparseVector)
xnnz = length(nonzeros(x))
print(io, length(x), "-element ", typeof(x), " with ", xnnz,
" stored ", nnz == 1 ? "entry" : "entries")
" stored ", xnnz == 1 ? "entry" : "entries")
if xnnz != 0
println(io, ":")
show(io, x)
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ values. `sparse(I,J,V)` constructs a sparse matrix such that `S[I[k], J[k]] = V[
julia> I = [1, 4, 3, 5]; J = [4, 7, 18, 9]; V = [1, 2, -5, 3];
julia> S = sparse(I,J,V)
5×18 sparse matrix with 4 Int64 stored entries:
5×18 SparseMatrixCSC{Int64,Int64} with 4 stored entries:
[1 , 4] = 1
[4 , 7] = 2
[5 , 9] = 3
Expand Down

0 comments on commit 97258a3

Please sign in to comment.