Mercurial > hg > octave-nkf
changeset 19347:9220669832df
Undeprecate flipdim (prematurely deprecated in 995df67fc912).
* general/flipdim.m, deprecated/flipdim.m: restore flipdim() from deprecated,
and turn it into alias for flip().
* NEWS: remove flipdim from list of deprecated functions.
* deprecated/module.mk: remove flipdim.m
* general/module.mk: add flipdim.m
* help/__unimplemented__.m: remove flip.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Wed, 24 Sep 2014 00:06:59 +0100 |
parents | 76baa2d10abb |
children | 38b9849cd907 |
files | NEWS scripts/deprecated/flipdim.m scripts/deprecated/module.mk scripts/general/flipdim.m scripts/general/module.mk scripts/help/__unimplemented__.m |
diffstat | 5 files changed, 8 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS +++ b/NEWS @@ -103,7 +103,6 @@ bicubic | interp2 find_dir_in_path | dir_in_loadpath finite | isfinite - flipdim | flip fmod | rem fnmatch | glob or regexp luinc | ilu or ichol
--- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -4,7 +4,6 @@ deprecated/bicubic.m \ deprecated/find_dir_in_path.m \ deprecated/finite.m \ - deprecated/flipdim.m \ deprecated/fmod.m \ deprecated/fnmatch.m \ deprecated/isstr.m \
rename from scripts/deprecated/flipdim.m rename to scripts/general/flipdim.m --- a/scripts/deprecated/flipdim.m +++ b/scripts/general/flipdim.m @@ -20,42 +20,17 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} flipdim (@var{x}) ## @deftypefnx {Function File} {} flipdim (@var{x}, @var{dim}) -## Return a copy of @var{x} flipped about the dimension @var{dim}. -## @var{dim} defaults to the first non-singleton dimension. +## Flip array across specific dimension. ## -## @strong{Warning:} @code{flipdim} is scheduled for removal in version 4.6. -## Use @code{flip} which can be used as a drop-in replacement. +## This function is an alias for @code{flip} and exists for backwards +## and @sc{Matlab} compatibility. See further details about its usage +## on @code{flip} help text. ## -## @seealso{fliplr, flipud, rot90, rotdim} +## @seealso{flip, fliplr, flipud, rot90, rotdim} ## @end deftypefn ## Author: David Bateman, Jaroslav Hajek -function y = flipdim (x, dim) - - persistent warned = false; - if (! warned) - warned = true; - warning ("Octave:deprecated-function", - "flipdim is deprecated and will be removed from a future version of Octave; please use flip (x, dim) instead"); - endif - - if (nargin != 1 && nargin != 2) - print_usage (); - endif - - nd = ndims (x); - sz = size (x); - if (nargin == 1) - ## Find the first non-singleton dimension. - (dim = find (sz > 1, 1)) || (dim = 1); - elseif (! (isscalar (dim) && isindex (dim))) - error ("flipdim: DIM must be a positive integer"); - endif - - idx(1:max(nd, dim)) = {':'}; - idx{dim} = size (x, dim):-1:1; - y = x(idx{:}); - +function y = flipdim (varargin) + y = flip (varargin{:}); endfunction -