Mercurial > hg > octave-nkf
comparison scripts/sparse/nonzeros.m @ 7505:f5005d9510f4
Remove dispatched sparse functions and treat in the generic versions of the functions
author | David Bateman <dbateman@free.fr> |
---|---|
date | Wed, 20 Feb 2008 15:52:11 -0500 |
parents | f084ba47812b |
children | eb63fbe60fab |
comparison
equal
deleted
inserted
replaced
7504:ddcf233d765b | 7505:f5005d9510f4 |
---|---|
25 | 25 |
26 if (nargin != 1) | 26 if (nargin != 1) |
27 print_usage (); | 27 print_usage (); |
28 endif | 28 endif |
29 | 29 |
30 if (issparse (s)) | 30 [i, j, t] = find (s); |
31 [i, j, t] = spfind (s); | |
32 else | |
33 [i, j, t] = find (s); | |
34 endif | |
35 endfunction | 31 endfunction |
36 | 32 |
37 %!assert(nonzeros([1,2;3,0]),[1;3;2]) | 33 %!assert(nonzeros([1,2;3,0]),[1;3;2]) |
38 %!assert(nonzeros(sparse([1,2;3,0])),[1;3;2]) | 34 %!assert(nonzeros(sparse([1,2;3,0])),[1;3;2]) |