Skip to content

Commit

Permalink
Deprecate RowVector{T}(shape...) constructors to RowVector{T}(uniniti…
Browse files Browse the repository at this point in the history
…alized, shape...) equivalents.
  • Loading branch information
Sacha0 committed Nov 28, 2017
1 parent f2c9ccf commit 8e15aa4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ Deprecated or removed
* `whos` has been renamed `varinfo`, and now returns a markdown table instead of printing
output ([#12131]).

* Uninitialized `RowVector` constructors of the form `RowVector{T}(shape...)` have been
deprecated in favor of equivalents accepting `uninitialized` (an alias for
`Uninitialized()`) as their first argument, as in
`RowVector{T}(uninitialized, shape...)`. For example, `RowVector{Int}(3)` is now
`RowVector{Int}(uninitialized, 3)`, and `RowVector{Float32}((1, 4))` is now
`RowVector{Float32}(uninitialized, (1, 4))` ([#24786]).

* `writecsv(io, a; opts...)` has been deprecated in favor of
`writedlm(io, a, ','; opts...)` ([#23529]).

Expand Down
6 changes: 6 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,12 @@ end
@deprecate chol!(x::Number, uplo) chol(x) false
end

# deprecate RowVector{T}(shape...) constructors to RowVector{T}(uninitialized, shape...) equivalents
@deprecate RowVector{T}(n::Int) where {T} RowVector{T}(uninitialized, n)
@deprecate RowVector{T}(n1::Int, n2::Int) where {T} RowVector{T}(uninitialized, n1, n2)
@deprecate RowVector{T}(n::Tuple{Int}) where {T} RowVector{T}(uninitializd, n)
@deprecate RowVector{T}(n::Tuple{Int,Int}) where {T} RowVector{T}(uninitialized, n)

@deprecate cumsum(A::AbstractArray) cumsum(A, 1)
@deprecate cumsum_kbn(A::AbstractArray) cumsum_kbn(A, 1)
@deprecate cumprod(A::AbstractArray) cumprod(A, 1)
Expand Down
5 changes: 0 additions & 5 deletions base/linalg/rowvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ const ConjRowVector{T,CV<:ConjVector} = RowVector{T,CV}
@inline RowVector{T}(::Uninitialized, n::Tuple{Int,Int}) where {T} =
n[1] == 1 ? RowVector{T}(Vector{transpose_type(T)}(uninitialized, n[2])) :
error("RowVector expects 1×N size, got $n")
# to deprecate, RowVector{T}(shape...) constructors
@inline RowVector{T}(n::Int) where {T} = RowVector{T}(uninitialized, n)
@inline RowVector{T}(n1::Int, n2::Int) where {T} = RowVector{T}(uninitialized, n1, n2)
@inline RowVector{T}(n::Tuple{Int}) where {T} = RowVector{T}(uninitializd, n)
@inline RowVector{T}(n::Tuple{Int,Int}) where {T} = RowVector{T}(uninitialized, n)

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

0 comments on commit 8e15aa4

Please sign in to comment.