Skip to content

Commit

Permalink
Add method diagm for vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
eulerkochy authored Feb 21, 2019
1 parent 07fcdcc commit 1d1722a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stdlib/LinearAlgebra/src/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ function diagm_container(kv::Pair{<:Integer,<:BitVector}...)
return falses(n, n)
end

diagm(v::AbstractVector) = diagm( 0 => v)

function tr(A::Matrix{T}) where T
n = checksquare(A)
Expand Down

0 comments on commit 1d1722a

Please sign in to comment.