Skip to content

Commit

Permalink
Merge pull request #10446 from JuliaLang/nalimilan/flip
Browse files Browse the repository at this point in the history
Deprecate flipud() and fliplr() in favor of flipdim()
  • Loading branch information
JeffBezanson committed Mar 9, 2015
2 parents 5bacb18 + 6b423ce commit 7306091
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
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

0 comments on commit 7306091

Please sign in to comment.