Mercurial > octave-nkf
diff scripts/set/unique.m @ 11097:ffb2f1ef2097
make issparse, sparse, and spalloc built-in functions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 14 Oct 2010 11:53:04 -0400 |
parents | 36a7163a5484 |
children | fd0a3ac60b0e |
line wrap: on
line diff
--- a/scripts/set/unique.m Thu Oct 14 06:48:02 2010 -0700 +++ b/scripts/set/unique.m Thu Oct 14 11:53:04 2010 -0400 @@ -82,20 +82,14 @@ ## fast as for full matrices, operate on the nonzero elements of the ## sparse array as long as we are not operating on rows. - ## FIXME -- unique is called when PKG_ADD files are parsed, but - ## issparse is not yet available because it is coming from a .oct - ## file?!? - - if (exist ("issparse")) - if (issparse (x) && ! optrows && nargout <= 1) - if (nnz (x) < numel (x)) - y = unique ([0; (full (nonzeros (x)))], varargin{:}); - else - ## Corner case where sparse matrix is actually full - y = unique (full (x), varargin{:}); - endif - return; + if (issparse (x) && ! optrows && nargout <= 1) + if (nnz (x) < numel (x)) + y = unique ([0; (full (nonzeros (x)))], varargin{:}); + else + ## Corner case where sparse matrix is actually full + y = unique (full (x), varargin{:}); endif + return; endif if (optrows)