Skip to content

Commit 1b69850

Browse files
committed
Specialize for adjoint/transpose
1 parent 2052ef8 commit 1b69850

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/adjtrans.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,3 +576,8 @@ diagview(A::Adjoint, k::Integer = 0) = _vecadjoint(diagview(parent(A), -k))
576576
# triu and tril
577577
triu!(A::AdjOrTransAbsMat, k::Integer = 0) = wrapperop(A)(tril!(parent(A), -k))
578578
tril!(A::AdjOrTransAbsMat, k::Integer = 0) = wrapperop(A)(triu!(parent(A), -k))
579+
580+
function fillband!(A::AdjOrTrans, v, k1, k2)
581+
fillband!(parent(A), wrapperop(A)(v), -k2, -k1)
582+
return A
583+
end

test/adjtrans.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,4 +809,16 @@ end
809809
end
810810
end
811811

812+
@testset "fillband!" begin
813+
for A in (rand(4, 4), rand(ComplexF64,4,4))
814+
B = similar(A)
815+
for op in (adjoint, transpose), k in -3:3
816+
B .= op(A)
817+
LinearAlgebra.fillband!(op(A), 1, k, k)
818+
LinearAlgebra.fillband!(B, 1, k, k)
819+
@test op(A) == B
820+
end
821+
end
822+
end
823+
812824
end # module TestAdjointTranspose

0 commit comments

Comments
 (0)