Skip to content

Commit

Permalink
Deprecate sparse(s::UniformScaling, m::Integer) in favor of the three…
Browse files Browse the repository at this point in the history
…-arg equivalent.
  • Loading branch information
Sacha0 committed Nov 4, 2017
1 parent 33763a0 commit 6bd3c79
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ Deprecated or removed
* `readcsv(io[, T::Type]; opts...)` has been deprecated in favor of
`readdlm(io, ','[, T]; opts...)` ([#23530]).

* `sparse(s::UniformScaling, m::Integer)` has been deprecated in favor of the
three-argument equivalent `sparse(s::UniformScaling, m, n)` ([#24472]).

* The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
in favor of using `Hermitian` (or `Symmetric`) views ([#22187], [#22188]).

Expand Down
2 changes: 2 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,8 @@ function toc()
return t
end

@deprecate sparse(s::UniformScaling, m::Integer) sparse(s, m, m)

# A[I...] .= with scalar indices should modify the element at A[I...]
function Broadcast.dotview(A::AbstractArray, args::Number...)
depwarn("the behavior of `A[I...] .= X` with scalar indices will change in the future. Use `A[I...] = X` instead.", :broadcast!)
Expand Down
2 changes: 1 addition & 1 deletion base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ if not specified.
multiple `α` of the identity matrix.
"""
speye(::Type{T}, m::Integer, n::Integer) where {T} = SparseMatrixCSC{T}(UniformScaling(one(T)), Dims((m, n)))
sparse(s::UniformScaling, m::Integer, n::Integer=m) = SparseMatrixCSC(s, Dims((m, n)))
sparse(s::UniformScaling, m::Integer, n::Integer) = SparseMatrixCSC(s, Dims((m, n)))

function one(S::SparseMatrixCSC{T}) where T
m,n = size(S)
Expand Down

0 comments on commit 6bd3c79

Please sign in to comment.