From aedaef0b2cc502dcf19dc7a0755a7772bd68443b Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Sat, 16 May 2020 20:36:07 -0400 Subject: [PATCH 1/2] rm doc reference to non-existent diagm keyword arg --- stdlib/SparseArrays/src/sparsematrix.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index 90e8b6c7476e1..411f3fddc0a2a 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -3469,7 +3469,7 @@ end Construct a sparse diagonal matrix from `Pair`s of vectors and diagonals. Each vector `kv.second` will be placed on the `kv.first` diagonal. By -default (if `size=nothing`), the matrix is square and its size is inferred +default, the matrix is square and its size is inferred from `kv`, but a non-square size `m`×`n` (padded with zeros as needed) can be specified by passing `m,n` as the first arguments. From f45fec2fdb105b8df0e42f8469fa7a3bef837b37 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Sat, 16 May 2020 20:39:26 -0400 Subject: [PATCH 2/2] fix diagm too --- stdlib/LinearAlgebra/src/dense.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/dense.jl b/stdlib/LinearAlgebra/src/dense.jl index 26d6915aad0cf..d33cd809f5339 100644 --- a/stdlib/LinearAlgebra/src/dense.jl +++ b/stdlib/LinearAlgebra/src/dense.jl @@ -311,7 +311,7 @@ diagm_container(size, kv::Pair{<:Integer,<:BitVector}...) = diagm(m::Integer, n::Integer, v::AbstractVector) Construct a matrix with elements of the vector as diagonal elements. -By default (if `size=nothing`), the matrix is square and its size is given by +By default, the matrix is square and its size is given by `length(v)`, but a non-square size `m`×`n` can be specified by passing `m,n` as the first arguments.