Mercurial > octave
diff src/DLD-FUNCTIONS/find.cc @ 7814:87865ed7405f
Second set of single precision test code and fix of resulting bugs
author | David Bateman <dbateman@free.fr> |
---|---|
date | Mon, 02 Jun 2008 16:57:45 +0200 |
parents | 82be108cc558 |
children | c9e1db15035b |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/find.cc Thu May 22 22:00:26 2008 +0200 +++ b/src/DLD-FUNCTIONS/find.cc Mon Jun 02 16:57:45 2008 +0200 @@ -520,6 +520,33 @@ } /* +%!assert(find ([1, 0, 1, 0, 1]), [1, 3, 5]); +%!assert(find ([1; 0; 3; 0; 1]), [1; 3; 5]); +%!assert(find ([0, 0, 2; 0, 3, 0; -1, 0, 0]), [3; 5; 7]); + +%!test +%! [i, j, v] = find ([0, 0, 2; 0, 3, 0; -1, 0, 0]); +%! +%! assert(i, [3; 2; 1]); +%! assert(j, [1; 2; 3]); +%! assert(v, [-1; 3; 2]); + +%!assert(find (single([1, 0, 1, 0, 1])), [1, 3, 5]); +%!assert(find (single([1; 0; 3; 0; 1])), [1; 3; 5]); +%!assert(find (single([0, 0, 2; 0, 3, 0; -1, 0, 0])), [3; 5; 7]); + +%!test +%! [i, j, v] = find (single([0, 0, 2; 0, 3, 0; -1, 0, 0])); +%! +%! assert(i, [3; 2; 1]); +%! assert(j, [1; 2; 3]); +%! assert(v, single([-1; 3; 2])); + +%!error <Invalid call to find.*> find (); + + */ + +/* ;;; Local Variables: *** ;;; mode: C++ *** ;;; End: ***