Skip to content

Commit

Permalink
Add lmul!(::Diagonal, ::AbstractVector) (#36012)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored May 25, 2020
1 parent 10fd991 commit 4714a86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function rmul!(A::AbstractMatrix, D::Diagonal)
return A
end

function lmul!(D::Diagonal, B::AbstractMatrix)
function lmul!(D::Diagonal, B::AbstractVecOrMat)
require_one_based_indexing(B)
B .= D.diag .* B
return B
Expand Down
10 changes: 5 additions & 5 deletions stdlib/LinearAlgebra/test/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ Random.seed!(1)
@test Array(D*a) DM*a
@test Array(D/a) DM/a
if relty <: BlasFloat
b = rand(elty,n,n)
b = sparse(b)
@test lmul!(copy(D), copy(b)) Array(D)*Array(b)
@test lmul!(transpose(copy(D)), copy(b)) transpose(Array(D))*Array(b)
@test lmul!(adjoint(copy(D)), copy(b)) Array(D)'*Array(b)
for b in (rand(elty,n,n), sparse(rand(elty,n,n)), rand(elty,n), sparse(rand(elty,n)))
@test lmul!(copy(D), copy(b)) Array(D)*Array(b)
@test lmul!(transpose(copy(D)), copy(b)) transpose(Array(D))*Array(b)
@test lmul!(adjoint(copy(D)), copy(b)) Array(D)'*Array(b)
end
end
end

Expand Down

2 comments on commit 4714a86

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.