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 flipud() and fliplr() in favor of flipdim() #10446

Merged
merged 1 commit into from
Mar 9, 2015
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ Deprecated or removed
* The operators `|>`, `.>`, `>>`, and `.>>` as used for process I/O redirection
are replaced with the `pipe` function ([#5349]).

* `flipud(A)` and `fliplr(A)` have been deprecated in favor of `flipdim(A, 1)` and
`flipdim(A, 2)`, respectively ([#10446]).

Julia v0.3.0 Release Notes
==========================

Expand Down
3 changes: 0 additions & 3 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,6 @@ function flipdim(A::AbstractArray, d::Integer)
return B
end

flipud(A::AbstractArray) = flipdim(A, 1)
fliplr(A::AbstractArray) = flipdim(A, 2)

circshift(a::AbstractArray, shiftamt::Real) = circshift(a, [Integer(shiftamt)])
function circshift{T,N}(a::AbstractArray{T,N}, shiftamts)
I = ()
Expand Down
3 changes: 3 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ for (f,t) in ((:float32, Float32), (:float64, Float64))
end
end

@deprecate flipud(A::AbstractArray) flipdim(A, 1)
@deprecate fliplr(A::AbstractArray) flipdim(A, 2)

# 0.4 discontinued functions

@noinline function subtypetree(x::DataType, level=-1)
Expand Down
2 changes: 1 addition & 1 deletion base/dsp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function xcorr(u, v)
elseif sv < su
v = [v;zeros(eltype(v),su-sv)]
end
flipud(conv(flipud(u), v))
flipdim(conv(flipdim(u, 1), v), 1)
end

fftshift(x) = circshift(x, div([size(x)...],2))
Expand Down
2 changes: 0 additions & 2 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ export
findnz,
first,
flipdim,
fliplr,
flipud,
gradient,
hcat,
hvcat,
Expand Down
8 changes: 0 additions & 8 deletions doc/stdlib/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,6 @@ Indexing, Assignment, and Concatenation

Reverse ``A`` in dimension ``d``.

.. function:: flipud(A)

Equivalent to ``flipdim(A,1)``.

.. function:: fliplr(A)

Equivalent to ``flipdim(A,2)``.

.. function:: circshift(A,shifts)

Circularly shift the data in an array. The second argument is a vector giving the amount to shift in each dimension.
Expand Down