Mercurial > octave-antonio
changeset 12498:294c0927c762
Deprecate is_duplicate_entry.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 03 Mar 2011 09:46:00 -0800 |
parents | 1536ed546219 |
children | a3019189ac51 |
files | ChangeLog NEWS doc/ChangeLog doc/interpreter/matrix.txi scripts/ChangeLog scripts/deprecated/is_duplicate_entry.m scripts/deprecated/module.mk scripts/general/is_duplicate_entry.m scripts/general/module.mk |
diffstat | 9 files changed, 74 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Mar 03 09:29:04 2011 -0800 +++ b/ChangeLog Thu Mar 03 09:46:00 2011 -0800 @@ -1,3 +1,7 @@ +2011-03-03 Rik <octave@nomad.inbox5.com> + + * NEWS: Deprecate is_duplicate_entry. + 2011-03-01 Ben Abbott <bpabbott@mac.com> * README.MacOS: Add Fink packages needed to support print output.
--- a/NEWS Thu Mar 03 09:29:04 2011 -0800 +++ b/NEWS Thu Mar 03 09:46:00 2011 -0800 @@ -4,6 +4,7 @@ ** The PCRE library is now required to build Octave. ** New functions added. + iscolumn issrow @@ -24,6 +25,13 @@ spchol splchol unmark_command spchol2inv split unmark_rawcommand + The following functions have been deprecated in Octave 3.6 and will + be removed from Octave 3.10 (or whatever version is the second major + release after 3.6): + + is_duplicate_entry + + Summary of important user-visible changes for version 3.4: ---------------------------------------------------------
--- a/doc/ChangeLog Thu Mar 03 09:29:04 2011 -0800 +++ b/doc/ChangeLog Thu Mar 03 09:46:00 2011 -0800 @@ -1,3 +1,7 @@ +2010-03-03 Rik <octave@nomad.inbox5.com> + + * interpreter/matrix.txi: Deprecate is_duplicate_entry. + 2010-03-02 Rik <octave@nomad.inbox5.com> * interpreter/stats.txi: Correctly refer to discrete uniform
--- a/doc/interpreter/matrix.txi Thu Mar 03 09:29:04 2011 -0800 +++ b/doc/interpreter/matrix.txi Thu Mar 03 09:46:00 2011 -0800 @@ -67,8 +67,6 @@ @DOCSTRING(xor) -@DOCSTRING(is_duplicate_entry) - @DOCSTRING(diff) @DOCSTRING(isinf)
--- a/scripts/ChangeLog Thu Mar 03 09:29:04 2011 -0800 +++ b/scripts/ChangeLog Thu Mar 03 09:46:00 2011 -0800 @@ -1,3 +1,7 @@ +2010-03-03 Rik <octave@nomad.inbox5.com> + + * deprecated/module.mk, general/module.mk: Deprecate is_duplicate_entry. + 2010-03-03 Rik <octave@nomad.inbox5.com> * miscellaneous/movefile.m: Fix copy&paste bug affecting Windows
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/is_duplicate_entry.m Thu Mar 03 09:46:00 2011 -0800 @@ -0,0 +1,53 @@ +## Copyright (C) 1996-2011 A. S. Hodel +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {} is_duplicate_entry (@var{x}) +## Return non-zero if any entries in @var{x} are duplicates of one +## another. +## @seealso{unique} +## @end deftypefn + +## Author: A. S. Hodel <scotte@eng.auburn.edu> + +function retval = is_duplicate_entry (x) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "is_duplicate_entry is obsolete and will be removed from a future version of Octave; see the function unique for equivalent functionality"); + endif + + + if (nargin == 1) + if (ismatrix (x)) + lx = numel (x); + lx1 = lx-1; + x = sort (reshape (x, 1, lx)); + dx = x(1:lx1) - x(2:lx); + retval = sum (dx == 0); + else + error ("is_duplicate_entry: expecting matrix argument"); + endif + else + print_usage (); + endif + +endfunction +
--- a/scripts/deprecated/module.mk Thu Mar 03 09:29:04 2011 -0800 +++ b/scripts/deprecated/module.mk Thu Mar 03 09:46:00 2011 -0800 @@ -11,6 +11,7 @@ deprecated/gammai.m \ deprecated/glpkmex.m \ deprecated/intwarning.m \ + deprecated/is_duplicate_entry.m \ deprecated/is_global.m \ deprecated/isstr.m \ deprecated/krylovb.m \
--- a/scripts/general/is_duplicate_entry.m Thu Mar 03 09:29:04 2011 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -## Copyright (C) 1996-2011 A. S. Hodel -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} is_duplicate_entry (@var{x}) -## Return non-zero if any entries in @var{x} are duplicates of one -## another. -## @seealso{unique} -## @end deftypefn - -## Author: A. S. Hodel <scotte@eng.auburn.edu> - -function retval = is_duplicate_entry (x) - - if (nargin == 1) - if (ismatrix (x)) - lx = numel (x); - lx1 = lx-1; - x = sort (reshape (x, 1, lx)); - dx = x(1:lx1) - x(2:lx); - retval = sum (dx == 0); - else - error ("is_duplicate_entry: expecting matrix argument"); - endif - else - print_usage (); - endif - -endfunction -