Skip to content

Commit

Permalink
Deprecate flipud() and fliplr() in favor of flipdim()
Browse files Browse the repository at this point in the history
We do not provide other convenience functions for any other
operation, like size(), and these names are obscure for
non-MATLAB users.
  • Loading branch information
nalimilan committed Mar 9, 2015
1 parent b80f7db commit bb7dec9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
3 changes: 0 additions & 3 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,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 @@ -294,6 +294,9 @@ const base64 = base64encode
# 10314
@deprecate filter!(r::Regex, d::Dict) filter!((k,v)->ismatch(r,k), d)

@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
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 bb7dec9

Please sign in to comment.