Skip to content

Commit

Permalink
Added a method to broaden schur for adjoint and transpose. (JuliaLang…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArunS-tack committed Jun 9, 2021
1 parent 9bb992c commit 9ee414d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stdlib/LinearAlgebra/src/schur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ function schur(A::StridedMatrix{TA}, B::StridedMatrix{TB}) where {TA,TB}
S = promote_type(eigtype(TA), TB)
return schur!(copy_oftype(A, S), copy_oftype(B, S))
end
function schur(A::AbstractMatrix{TA}, B::AbstractMatrix{TB}) where {TA,TB}
S = promote_type(eigtype(TA), TB)
return schur!(copy_oftype(A, S), copy_oftype(B, S))
end

"""
ordschur!(F::GeneralizedSchur, select::Union{Vector{Bool},BitVector}) -> F::GeneralizedSchur
Expand Down
9 changes: 9 additions & 0 deletions stdlib/LinearAlgebra/test/schur.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,13 @@ end
end
end

@testset "adjoint and transpose for schur (#40941)" begin
A = rand(3, 3)
B = schur(A', A)
C = B.left*B.S*B.right'
D = schur(transpose(A), A)
E = D.left*D.S*D.right'
@test A' C E
end

end # module TestSchur

0 comments on commit 9ee414d

Please sign in to comment.