Skip to content

Commit

Permalink
Remove some unnecessary type conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed May 1, 2024
1 parent b3b2111 commit ae7fc6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stdlib/LinearAlgebra/src/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ Base.@constprop :aggressive function gemv!(y::StridedVector{T}, tA::AbstractChar
if _in(tA_uc, ('S', 'H'))
# re-wrap again and use plain ('N') matvec mul algorithm,
# because _generic_matvecmul! can't handle the HermOrSym cases specifically
return _generic_matvecmul!(y, oftype(tA, 'N'), wrap(A, tA), x, MulAddMul(α, β))
return _generic_matvecmul!(y, 'N', wrap(A, tA), x, MulAddMul(α, β))
else
return _generic_matvecmul!(y, tA, A, x, MulAddMul(α, β))
end
Expand Down Expand Up @@ -516,7 +516,7 @@ Base.@constprop :aggressive function gemv!(y::StridedVector{Complex{T}}, tA::Abs
elseif _in(tA_uc, ('S', 'H'))
# re-wrap again and use plain ('N') matvec mul algorithm,
# because _generic_matvecmul! can't handle the HermOrSym cases specifically
return _generic_matvecmul!(y, oftype(tA, 'N'), wrap(A, tA), x, MulAddMul(α, β))
return _generic_matvecmul!(y, 'N', wrap(A, tA), x, MulAddMul(α, β))
else
return _generic_matvecmul!(y, tA, A, x, MulAddMul(α, β))
end
Expand All @@ -530,10 +530,10 @@ Base.@constprop :aggressive function syrk_wrapper!(C::StridedMatrix{T}, tA::Abst
tA_uc = uppercase(tA) # potentially convert a WrapperChar to a Char
if tA_uc == 'T'
(nA, mA) = size(A,1), size(A,2)
tAt = oftype(tA, 'N')
tAt = 'N'
else
(mA, nA) = size(A,1), size(A,2)
tAt = oftype(tA, 'T')
tAt = 'T'
end
if nC != mA
throw(DimensionMismatch(lazy"output matrix has size: $(nC), but should have size $(mA)"))
Expand Down Expand Up @@ -571,10 +571,10 @@ Base.@constprop :aggressive function herk_wrapper!(C::Union{StridedMatrix{T}, St
tA_uc = uppercase(tA) # potentially convert a WrapperChar to a Char
if tA_uc == 'C'
(nA, mA) = size(A,1), size(A,2)
tAt = oftype(tA, 'N')
tAt = 'N'
else
(mA, nA) = size(A,1), size(A,2)
tAt = oftype(tA, 'C')
tAt = 'C'
end
if nC != mA
throw(DimensionMismatch(lazy"output matrix has size: $(nC), but should have size $(mA)"))
Expand Down

0 comments on commit ae7fc6c

Please sign in to comment.