Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display sparse matrices by showing their structure with braille patterns #33821

Merged
merged 31 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3918e34
Display sparse matrices by showing their structure with braille patterns
goggle Nov 12, 2019
e45c6ab
Adopt test which involves showing of sparse matrix
goggle Nov 12, 2019
e871927
Adopt docstrings
goggle Nov 12, 2019
4223e4a
Call `rowvals(S)` only once
goggle Nov 13, 2019
ff9bc5a
Extend code documentation
goggle Nov 13, 2019
64b111e
Simplify calculation of `scaleHeight` and `scaleWidth`
goggle Nov 17, 2019
4c0f3d2
Make `brailleBlocks` a `const`
goggle Nov 17, 2019
78e1ade
Initialize `brailleGrid` with `UInt16(10240)`
goggle Nov 17, 2019
0bcb47a
Let the compiler do the conversion of `\n`
goggle Nov 17, 2019
7a7b32a
Improve printing to `io`
goggle Nov 17, 2019
c324db5
Unwrap the helper functions directly into the loop
goggle Nov 17, 2019
b96ee2a
Show small sparse matrix in traditional manner
goggle Nov 18, 2019
d919d85
Add tests for `isstored`
goggle Nov 18, 2019
6c79e6b
Adapt tests for `show`
goggle Nov 18, 2019
49e8fc2
Adapt doctests
goggle Nov 18, 2019
246d9d1
Use `m` and `n` instead of `size` calls
goggle Nov 18, 2019
6ceae94
Initialize `scaleHeight` and `scaleWidth` in `else` clause
goggle Nov 18, 2019
e93dafc
Reenable commented test
goggle Nov 18, 2019
0ea6ee9
Declare type of `maxHeight` and `maxWidth`
goggle Nov 19, 2019
748c108
Do not print leading newline in `_show_with_braille_patterns`
goggle Nov 19, 2019
c8aa9de
Reenable test for issue 30589
goggle Nov 20, 2019
1e1af8e
Shorten type declarations of `maxHeight` and `maxWidth`
goggle Nov 26, 2019
c50bb66
Add `isstored` to Base
goggle Nov 26, 2019
7c772d9
Add `isstored` for sparse vectors
goggle Nov 26, 2019
0de07c2
Make use of Base function `isstored`
goggle Nov 26, 2019
bd7431c
Add `boundscheck` macro
goggle Nov 26, 2019
c998d75
Clarify news
goggle Nov 26, 2019
25f211d
Call `issorted` by `Base.issored`
goggle Nov 26, 2019
2fdfc20
Use `Base.isstored` in tests
goggle Nov 26, 2019
3f095bb
Set cutoff value to print sparse matrices with braille to 16
goggle Nov 28, 2019
f8495b1
Merge branch 'master' into 30587-spy-printing-sparse-matrices
stevengj May 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Base.isstored in tests
  • Loading branch information
goggle committed Nov 26, 2019
commit 2fdfc205dbc04b4d3bb812052f2af069a8ed38e3
6 changes: 3 additions & 3 deletions stdlib/SparseArrays/test/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SparseTests

using Test
using SparseArrays
using SparseArrays: getcolptr, nonzeroinds, isstored, _show_with_braille_patterns
using SparseArrays: getcolptr, nonzeroinds, _show_with_braille_patterns
using LinearAlgebra
using Printf: @printf # for debug
using Random
Expand Down Expand Up @@ -2212,10 +2212,10 @@ end
stored_indices = [CartesianIndex(i, j) for (i, j) in zip(I, J)]
unstored_indices = [c for c in CartesianIndices((m, n)) if !(c in stored_indices)]
for c in stored_indices
@test isstored(A, c[1], c[2]) == true
@test Base.isstored(A, c[1], c[2]) == true
end
for c in unstored_indices
@test isstored(A, c[1], c[2]) == false
@test Base.isstored(A, c[1], c[2]) == false
end
end

Expand Down
6 changes: 3 additions & 3 deletions stdlib/SparseArrays/test/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SparseVectorTests

using Test
using SparseArrays
using SparseArrays: nonzeroinds, getcolptr, isstored
using SparseArrays: nonzeroinds, getcolptr
using LinearAlgebra
using Random
include("forbidproperties.jl")
Expand Down Expand Up @@ -40,10 +40,10 @@ end
stored_inds = [2, 5, 6]
nonstored_inds = [1, 3, 4, 7, 8]
for i in stored_inds
@test isstored(x, i) == true
@test Base.isstored(x, i) == true
end
for i in nonstored_inds
@test isstored(x, i) == false
@test Base.isstored(x, i) == false
end
end

Expand Down