Skip to content

Commit

Permalink
add test, better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch committed Nov 23, 2023
1 parent 40927cc commit daa0364
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const SparseMatrixCSCUnion2{Tv,Ti} = Union{AbstractSparseMatrixCSC{Tv,Ti}, Spars

getcolptr(S::SorF) = getfield(S, :colptr)
getcolptr(S::SparseMatrixCSCView) = view(getcolptr(parent(S)), first(S.indices[2]):(last(S.indices[2]) + 1))
getcolptr(S::SparseMatrixCSCView2) = error("just to make sure")
getcolptr(S::SparseMatrixCSCView2) = error("getcolptr not well-defined for $(typeof(S))")

Check warning on line 194 in src/sparsematrix.jl

View check run for this annotation

Codecov / codecov/patch

src/sparsematrix.jl#L194

Added line #L194 was not covered by tests
getrowval(S::AbstractSparseMatrixCSC) = rowvals(S)
getrowval(S::SparseMatrixCSCView2) = rowvals(parent(S))
getnzval( S::AbstractSparseMatrixCSC) = nonzeros(S)
Expand Down
1 change: 1 addition & 0 deletions test/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ begin
A = sprand(rng, n, n, 0.01)
MA = Matrix(A)
lA = sprand(rng, n, n+10, 0.01)
@test nnz(lA[:, n+1:n+10]) == nnz(view(lA, :, n+1:n+10))
@testset "triangular multiply with $tr($wr)" for tr in (identity, adjoint, transpose),
wr in (UpperTriangular, LowerTriangular, UnitUpperTriangular, UnitLowerTriangular)
AW = tr(wr(A))
Expand Down

0 comments on commit daa0364

Please sign in to comment.