From: <hi...@us...> - 2009-02-18 14:01:49
|
Revision: 5559 http://octave.svn.sourceforge.net/octave/?rev=5559&view=rev Author: highegg Date: 2009-02-18 14:01:44 +0000 (Wed, 18 Feb 2009) Log Message: ----------- remove issorted - now built-in Removed Paths: ------------- trunk/octave-forge/main/general/inst/issorted.m Deleted: trunk/octave-forge/main/general/inst/issorted.m =================================================================== --- trunk/octave-forge/main/general/inst/issorted.m 2009-02-18 13:50:41 UTC (rev 5558) +++ trunk/octave-forge/main/general/inst/issorted.m 2009-02-18 14:01:44 UTC (rev 5559) @@ -1,43 +0,0 @@ -## Copyright (C) 2006 Sylvain Pelissier -## Copyright (C) 2006 Paul Kienzle -## -## This program 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 2 of the License, or -## (at your option) any later version. -## -## This program 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 this program; If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {@var{y}} issorted (@var{x},@var{str}) -## issorted return 1 if @var{x} is sorted and 0 also. If @var{str} is equal to 'rows' issorted return 1 if @var{x} is -##equal to sortrows(@var{x}) and 0 also. -## @seealso{sort, sortrows} -## @end deftypefn - -## Author: Sylvain Pelissier <syl...@gm...> -## Author: Paul Kienzle <pki...@us...> - -function y = issorted(x,str) - if(nargin == 0) - usage(" \n issorted(x) \n issorted(A,'rows')"); - else - if(nargin == 1) - y = all((diff(x)>=0)(:)); - else - if(nargin == 2 && str == 'rows') - t = sign(diff(x)); # t contains -1, 0, or 1 - t(t==1) = columns(x); # t contains -1, 0, or n - y = all (cumsum(t,2) >= 0)(:); - else - error("The second argument must be equal to 'rows'\n"); - endif; - endif; - endif; -endfunction; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |