Reference

DiagonalArrays.diagonal — Method
diagonal(m::AbstractMatrix) -> AbstractMatrix

Return a diagonal matrix from a matrix m where the diagonal values are copied from the diagonal of m. This is an extension of LinearAlgebra.Diagonal, designed to avoid the implication of the output type. Defaults to diagonal(copy(diagview(m))), which in general is equivalent to Diagonal(m).

source
DiagonalArrays.diagonal — Method
diagonal(v::AbstractVector) -> AbstractMatrix

Return a diagonal matrix from a vector v. This is an extension of LinearAlgebra.Diagonal, designed to avoid the implication of the output type. Defaults to Diagonal(v).

source
DiagonalArrays.diagonaltype — Function
diagonaltype(::AbstractVector) -> Type{<:AbstractMatrix}
diagonaltype(::Type{<:AbstractVector}) -> Type{<:AbstractMatrix}
diagonaltype(::AbstractMatrix) -> Type{<:AbstractMatrix}
diagonaltype(::Type{<:AbstractMatrix}) -> Type{<:AbstractMatrix}

Return the type of diagonal matrix that would be created from a vector or matrix using the diagonal function.

source