Skip to content

Commit

Permalink
Change example for sparse arrays (#33189)
Browse files Browse the repository at this point in the history
  • Loading branch information
szarnyasg authored and ViralBShah committed Sep 7, 2019
1 parent cb76f2a commit a3ccac0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stdlib/SparseArrays/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ matrix. [`dropzeros`](@ref), and the in-place [`dropzeros!`](@ref), can be used
remove stored zeros from the sparse matrix.

```jldoctest
julia> A = sparse([1, 2, 3], [1, 2, 3], [0, 2, 0])
3×3 SparseMatrixCSC{Int64,Int64} with 3 stored entries:
julia> A = sparse([1, 1, 2, 3], [1, 3, 2, 3], [0, 1, 2, 0])
3×3 SparseMatrixCSC{Int64,Int64} with 4 stored entries:
[1, 1] = 0
[2, 2] = 2
[1, 3] = 1
[3, 3] = 0
julia> dropzeros(A)
3×3 SparseMatrixCSC{Int64,Int64} with 1 stored entry:
3×3 SparseMatrixCSC{Int64,Int64} with 2 stored entries:
[2, 2] = 2
[1, 3] = 1
```

## Sparse Vector Storage
Expand Down

0 comments on commit a3ccac0

Please sign in to comment.