Skip to content

Commit 025f191

Browse files
committed
Test with Adjoint
1 parent 11192f6 commit 025f191

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/adjtrans.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,14 @@ end
760760
end
761761
end
762762
@testset "inference for structured matrices" begin
763-
v = @inferred ((A,i) -> Val(A'[LinearAlgebra.BandIndex(0,i)]))(A,1)
763+
function f(A, i, ::Val{band}) where {band}
764+
x = Adjoint(A)[LinearAlgebra.BandIndex(band,i)]
765+
Val(x)
766+
end
767+
v = @inferred f(A, 1, Val(0))
764768
@test v == Val(1)
769+
v = @inferred f(A, 1, Val(1))
770+
@test v == Val(0)
765771
end
766772
@testset "non-square matrix" begin
767773
r = reshape(1:6, 2, 3)

0 commit comments

Comments
 (0)