Skip to content

Commit

Permalink
Simplify implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Apr 23, 2020
1 parent de7b264 commit eeff9f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ rdiv!(A::AbstractMatrix{T}, adjD::Adjoint{<:Any,<:Diagonal{T}}) where {T} =
rdiv!(A::AbstractMatrix{T}, transD::Transpose{<:Any,<:Diagonal{T}}) where {T} =
(D = transD.parent; rdiv!(A, D))

(/)(A::Union{StridedMatrix, AbstractTriangular}, D::Diagonal) =
(/)(A::AbstractMatrix, D::Diagonal) =
rdiv!((typeof(oneunit(eltype(D))/oneunit(eltype(A)))).(A), D)

(\)(F::Factorization, D::Diagonal) =
Expand Down
8 changes: 0 additions & 8 deletions stdlib/SparseArrays/src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ function (*)(A::AbstractSparseMatrixCSC, D::Diagonal)
T = Base.promote_op(*, eltype(D), eltype(A))
mul!(LinearAlgebra.copy_oftype(A, T), A, D)
end
function (\)(D::Diagonal, A::AbstractSparseMatrixCSC)
T = Base.promote_op(\, eltype(D), eltype(A))
ldiv!(D, LinearAlgebra.copy_oftype(A, T))
end
function (/)(A::AbstractSparseMatrixCSC, D::Diagonal)
T = Base.promote_op(/, eltype(A), eltype(D))
rdiv!(LinearAlgebra.copy_oftype(A, T), D)
end

# Sparse matrix multiplication as described in [Gustavson, 1978]:
# http://dl.acm.org/citation.cfm?id=355796
Expand Down

0 comments on commit eeff9f2

Please sign in to comment.