Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6f9f8fa

Browse files
committedNov 26, 2017
Deprecate RowVector{T}(shape...) constructors to RowVector{T}(uninitialized, shape...) equivalents.
1 parent 7e2a7d0 commit 6f9f8fa

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed
 

‎NEWS.md

+7
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,13 @@ Deprecated or removed
422422
* `whos` has been renamed `varinfo`, and now returns a markdown table instead of printing
423423
output ([#12131]).
424424

425+
* Uninitialized `RowVector` constructors of the form `RowVector{T}(shape...)` have been
426+
deprecated in favor of equivalents accepting `uninitialized` (an alias for
427+
`Uninitialized()`) as their first argument, as in
428+
`RowVector{T}(uninitialized, shape...)`. For example, `RowVector{Int}(3)` is now
429+
`RowVector{Int}(uninitialized, 3)`, and `RowVector{Float32}((1, 4))` is now
430+
`RowVector{Float32}(uninitialized, (1, 4))` ([#TEARSINRAIN]).
431+
425432
* `writecsv(io, a; opts...)` has been deprecated in favor of
426433
`writedlm(io, a, ','; opts...)` ([#23529]).
427434

‎base/deprecated.jl

+6
Original file line numberDiff line numberDiff line change
@@ -2105,6 +2105,12 @@ end
21052105
@deprecate chol!(x::Number, uplo) chol(x) false
21062106
end
21072107

2108+
# deprecate RowVector{T}(shape...) constructors to RowVector{T}(uninitialized, shape...) equivalents
2109+
@deprecate RowVector{T}(n::Int) where {T} RowVector{T}(uninitialized, n)
2110+
@deprecate RowVector{T}(n1::Int, n2::Int) where {T} RowVector{T}(uninitialized, n1, n2)
2111+
@deprecate RowVector{T}(n::Tuple{Int}) where {T} RowVector{T}(uninitializd, n)
2112+
@deprecate RowVector{T}(n::Tuple{Int,Int}) where {T} RowVector{T}(uninitialized, n)
2113+
21082114
@deprecate cumsum(A::AbstractArray) cumsum(A, 1)
21092115
@deprecate cumsum_kbn(A::AbstractArray) cumsum_kbn(A, 1)
21102116
@deprecate cumprod(A::AbstractArray) cumprod(A, 1)

‎base/linalg/rowvector.jl

-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ const ConjRowVector{T,CV<:ConjVector} = RowVector{T,CV}
4545
@inline RowVector{T}(::Uninitialized, n::Tuple{Int,Int}) where {T} =
4646
n[1] == 1 ? RowVector{T}(Vector{transpose_type(T)}(uninitialized, n[2])) :
4747
error("RowVector expects 1×N size, got $n")
48-
# to deprecate, RowVector{T}(shape...) constructors
49-
@inline RowVector{T}(n::Int) where {T} = RowVector{T}(uninitialized, n)
50-
@inline RowVector{T}(n1::Int, n2::Int) where {T} = RowVector{T}(uninitialized, n1, n2)
51-
@inline RowVector{T}(n::Tuple{Int}) where {T} = RowVector{T}(uninitializd, n)
52-
@inline RowVector{T}(n::Tuple{Int,Int}) where {T} = RowVector{T}(uninitialized, n)
5348

5449
# Conversion of underlying storage
5550
convert(::Type{RowVector{T,V}}, rowvec::RowVector) where {T,V<:AbstractVector} =

0 commit comments

Comments
 (0)
Please sign in to comment.