Commit 85a6c84
Fix
The `issymmetric` check tracks an `offset` that it uses to go from (row,
col) to (col, row). However, currently this doesn't account for the fact
that if a column is empty, entries in `colptr` will be identical. E.g.,
in #605, we have
```julia
julia> S = sparse([2, 3, 1], [1, 1, 3], [1, 1, 1], 3, 3)
3×3 SparseMatrixCSC{Int64, Int64} with 3 stored entries:
⋅ ⋅ 1
1 ⋅ ⋅
1 ⋅ ⋅
julia> SparseArrays.getcolptr(S)
4-element Vector{Int64}:
1
3
3
4
```
The offset `3` corresponds to rows in the third column, as the second
column is empty. This PR checks for empty columns, in which case we may
exit the call immediately.
Fixes #605issymmetric for matrices with empty columns (#606)1 parent 08b8168 commit 85a6c84
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3971 | 3971 | | |
3972 | 3972 | | |
3973 | 3973 | | |
3974 | | - | |
| 3974 | + | |
3975 | 3975 | | |
3976 | | - | |
| 3976 | + | |
3977 | 3977 | | |
3978 | 3978 | | |
3979 | 3979 | | |
| |||
4009 | 4009 | | |
4010 | 4010 | | |
4011 | 4011 | | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
4012 | 4018 | | |
4013 | 4019 | | |
4014 | 4020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
398 | 419 | | |
399 | 420 | | |
400 | 421 | | |
| |||
0 commit comments