Skip to content

Commit

Permalink
Add diagm for vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
eulerkochy authored Feb 27, 2019
1 parent 2bbb599 commit 68d0edf
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 68d0edf

Please sign in to comment.