Skip to content

Commit 00b1961

Browse files
committed
Merge branch 'main' into gd/structured
2 parents f55c09a + b5d70bd commit 00b1961

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

src/graph.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ end
2424
SparsityPatternCSC(A::SparseMatrixCSC) = SparsityPatternCSC(A.m, A.n, A.colptr, A.rowval)
2525

2626
Base.size(S::SparsityPatternCSC) = (S.m, S.n)
27-
28-
function Base.size(S::SparsityPatternCSC, d::Integer)
29-
if d == 1
30-
return S.m
31-
elseif d == 2
32-
return S.n
33-
else
34-
return 1
35-
end
36-
end
37-
27+
Base.size(S::SparsityPatternCSC, d) = d::Integer <= 2 ? size(S)[d] : 1
3828
Base.axes(S::SparsityPatternCSC, d::Integer) = Base.OneTo(size(S, d))
3929

4030
SparseArrays.nnz(S::SparsityPatternCSC) = length(S.rowval)

test/graph.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using Test
2727
A = spzeros(10, 20)
2828
S = SparsityPatternCSC(A)
2929
@test size(A) == size(S)
30+
@test_throws BoundsError size(A, 0)
3031
@test size(A, 1) == size(S, 1)
3132
@test size(A, 2) == size(S, 2)
3233
@test size(A, 3) == size(S, 3)

test/utils.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ using BlockBandedMatrices: BlockBandedMatrix
44
using LinearAlgebra
55
using SparseMatrixColorings
66
using SparseMatrixColorings:
7-
AdjacencyGraph,
8-
LinearSystemColoringResult,
9-
matrix_versions,
10-
respectful_similar,
11-
structurally_orthogonal_columns
7+
AdjacencyGraph, LinearSystemColoringResult, matrix_versions, respectful_similar
128
using Test
139

1410
function test_coloring_decompression(

0 commit comments

Comments
 (0)