Skip to content

Commit

Permalink
Fix getcolptr for sparse matrix views
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch committed Nov 23, 2023
1 parent 8308232 commit afa4be6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ begin
MAW = tr(wr(MA))
@test AW * B MAW * B
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
vAW = tr(wr(view(A, :, 1:n)))
vMAW = tr(wr(view(MA, :, 1:n)))
vAW = tr(wr(view([A A], :, (n+1):2n)))
vMAW = tr(wr(view([MA MA], :, (n+1):2n)))
@test vAW * B vMAW * B
end
a = sprand(rng, ComplexF64, n, n, 0.01)
Expand All @@ -170,8 +170,8 @@ begin
MAW = tr(wr(ma))
@test AW * B MAW * B
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
vAW = tr(wr(view(a, :, 1:n)))
vMAW = tr(wr(view(ma, :, 1:n)))
vAW = tr(wr(view([a a], :, (n+1):2n)))
vMAW = tr(wr(view([ma ma], :, (n+1):2n)))
@test vAW * B vMAW * B
end
A = A - Diagonal(diag(A)) + 2I # avoid rounding errors by division
Expand All @@ -181,6 +181,10 @@ begin
AW = tr(wr(A))
MAW = tr(wr(MA))
@test AW \ B MAW \ B
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
vAW = tr(wr(view([a a], :, (n+1):2n)))
vMAW = tr(wr(view([ma ma], :, (n+1):2n)))
@test vAW \ B vMAW \ B
end
@testset "triangular singular exceptions" begin
A = LowerTriangular(sparse([0 2.0;0 1]))
Expand Down

0 comments on commit afa4be6

Please sign in to comment.