Skip to content

Commit

Permalink
Remove unused matrix type params in diag methods (#56048)
Browse files Browse the repository at this point in the history
These parameters are not used in the method, and are unnecessary for
dispatch.
  • Loading branch information
jishnub authored Oct 9, 2024
1 parent 38dbd11 commit 9c55783
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function triu!(M::Bidiagonal{T}, k::Integer=0) where T
return M
end

function diag(M::Bidiagonal{T}, n::Integer=0) where T
function diag(M::Bidiagonal, n::Integer=0)
# every branch call similar(..., ::Int) to make sure the
# same vector type is returned independent of n
if n == 0
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ adjoint(D::Diagonal) = Diagonal(adjoint.(D.diag))
permutedims(D::Diagonal) = D
permutedims(D::Diagonal, perm) = (Base.checkdims_perm(axes(D), axes(D), perm); D)

function diag(D::Diagonal{T}, k::Integer=0) where T
function diag(D::Diagonal, k::Integer=0)
# every branch call similar(..., ::Int) to make sure the
# same vector type is returned independent of k
if k == 0
Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ issymmetric(S::Tridiagonal) = all(issymmetric, S.d) && all(Iterators.map((x, y)

\(A::Adjoint{<:Any,<:Tridiagonal}, B::Adjoint{<:Any,<:AbstractVecOrMat}) = copy(A) \ B

function diag(M::Tridiagonal{T}, n::Integer=0) where T
function diag(M::Tridiagonal, n::Integer=0)
# every branch call similar(..., ::Int) to make sure the
# same vector type is returned independent of n
if n == 0
Expand Down

0 comments on commit 9c55783

Please sign in to comment.