Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate diagm(A::BitMatrix) #23373

Merged
merged 1 commit into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ Deprecated or removed
* `diagm(A::SparseMatrixCSC)` has been deprecated in favor of
`spdiagm(sparsevec(A))` ([#23341]).

* `diagm(A::BitMatrix)` has been deprecated, use `diagm(vec(A))` instead ([#23373]).

Command-line option changes
---------------------------

Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,9 @@ export hex2num
# PR 23341
@deprecate diagm(A::SparseMatrixCSC) spdiagm(sparsevec(A))

# PR #23373
@deprecate diagm(A::BitMatrix) diagm(vec(A))

# END 0.7 deprecations

# BEGIN 1.0 deprecations
Expand Down
3 changes: 1 addition & 2 deletions base/linalg/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ function diag(B::BitMatrix)
v
end

function diagm(v::Union{BitVector,BitMatrix})
isa(v, BitMatrix) && size(v,1)==1 || size(v,2)==1 || throw(DimensionMismatch())
function diagm(v::BitVector)
n = length(v)
a = falses(n, n)
for i=1:n
Expand Down
3 changes: 0 additions & 3 deletions test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,6 @@ timesofar("cat")
b1 = bitrand(v1)
@check_bit_operation diagm(b1) BitMatrix

b1 = bitrand(n1, n2)
@test_throws DimensionMismatch diagm(b1)

b1 = bitrand(n1, n1)
@check_bit_operation diag(b1)
end
Expand Down