Skip to content

Commit

Permalink
remove rmul diagonal specialization (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Feb 19, 2023
1 parent 8238bf7 commit d0e7a16
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/generic/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -827,29 +827,6 @@ function copy(bc::Broadcasted{BandedStyle, <:Any, <:Any, <:NTuple{2,AbstractMatr
_banded_broadcast(bc.f, bc.args, MemoryLayout.(typeof.(bc.args)))
end

###
# Special cases
###

#=
B::BandedMatrix * D::Diagonal for DenseColumnMajor storage may be evaluated as
B.data .* D.diag', instead of B .* D.diag'
=#
function copy(M::Rmul{BandedColumns{DenseColumnMajor}, DiagonalLayout{DenseColumnMajor}})
B, D = M.A, M.B
d = diagonaldata(D)
Bd = bandeddata(B)
Bdata = if size(Bd, 1) == 1
# performance optimization
# may not be necessary in the future if the other branch
# is equally fast
reshape(vec(Bd) .* d, 1, :)
else
Bd .* d'
end
_BandedMatrix(Bdata, size(B,1), bandwidths(B)...)
end

###
# broadcast bandwidths
###
Expand Down

0 comments on commit d0e7a16

Please sign in to comment.