Skip to content

Commit c2a3c9e

Browse files
committed
Fix getcolptr for sparse matrix views
1 parent 8308232 commit c2a3c9e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/linalg.jl

+8-4
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ begin
158158
MAW = tr(wr(MA))
159159
@test AW * B MAW * B
160160
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
161-
vAW = tr(wr(view(A, :, 1:n)))
162-
vMAW = tr(wr(view(MA, :, 1:n)))
161+
vAW = tr(wr(view([A A], :, (n+1):2n)))
162+
vMAW = tr(wr(view([MA MA], :, (n+1):2n)))
163163
@test vAW * B vMAW * B
164164
end
165165
a = sprand(rng, ComplexF64, n, n, 0.01)
@@ -170,8 +170,8 @@ begin
170170
MAW = tr(wr(ma))
171171
@test AW * B MAW * B
172172
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
173-
vAW = tr(wr(view(a, :, 1:n)))
174-
vMAW = tr(wr(view(ma, :, 1:n)))
173+
vAW = tr(wr(view([a a], :, (n+1):2n)))
174+
vMAW = tr(wr(view(ma, :, (n+1):2n)))
175175
@test vAW * B vMAW * B
176176
end
177177
A = A - Diagonal(diag(A)) + 2I # avoid rounding errors by division
@@ -181,6 +181,10 @@ begin
181181
AW = tr(wr(A))
182182
MAW = tr(wr(MA))
183183
@test AW \ B MAW \ B
184+
# and for SparseMatrixCSCView - a view of all rows and unit range of cols
185+
vAW = tr(wr(view([a a], :, (n+1):2n)))
186+
vMAW = tr(wr(view(ma, :, (n+1):2n)))
187+
@test vAW \ B vMAW \ B
184188
end
185189
@testset "triangular singular exceptions" begin
186190
A = LowerTriangular(sparse([0 2.0;0 1]))

0 commit comments

Comments
 (0)