Skip to content

Commit bb7dec9

Browse files
committed
Deprecate flipud() and fliplr() in favor of flipdim()
We do not provide other convenience functions for any other operation, like size(), and these names are obscure for non-MATLAB users.
1 parent b80f7db commit bb7dec9

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

base/abstractarray.jl

-3
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,6 @@ function flipdim(A::AbstractArray, d::Integer)
518518
return B
519519
end
520520

521-
flipud(A::AbstractArray) = flipdim(A, 1)
522-
fliplr(A::AbstractArray) = flipdim(A, 2)
523-
524521
circshift(a::AbstractArray, shiftamt::Real) = circshift(a, [integer(shiftamt)])
525522
function circshift{T,N}(a::AbstractArray{T,N}, shiftamts)
526523
I = ()

base/deprecated.jl

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ const base64 = base64encode
294294
# 10314
295295
@deprecate filter!(r::Regex, d::Dict) filter!((k,v)->ismatch(r,k), d)
296296

297+
@deprecate flipud(A::AbstractArray) flipdim(A, 1)
298+
@deprecate fliplr(A::AbstractArray) flipdim(A, 2)
299+
297300
# 0.4 discontinued functions
298301

299302
@noinline function subtypetree(x::DataType, level=-1)

base/dsp.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function xcorr(u, v)
163163
elseif sv < su
164164
v = [v;zeros(eltype(v),su-sv)]
165165
end
166-
flipud(conv(flipud(u), v))
166+
flipdim(conv(flipdim(u, 1), v), 1)
167167
end
168168

169169
fftshift(x) = circshift(x, div([size(x)...],2))

doc/stdlib/arrays.rst

-8
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,6 @@ Indexing, Assignment, and Concatenation
267267

268268
Reverse ``A`` in dimension ``d``.
269269

270-
.. function:: flipud(A)
271-
272-
Equivalent to ``flipdim(A,1)``.
273-
274-
.. function:: fliplr(A)
275-
276-
Equivalent to ``flipdim(A,2)``.
277-
278270
.. function:: circshift(A,shifts)
279271

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

0 commit comments

Comments
 (0)