Mercurial > hg > octave-nkf
changeset 11435:20f53b3a558f
Add tests for sparse forms of logical matrices to islogical, isnumeric.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 03 Jan 2011 18:36:49 -0800 |
parents | 1f54ee6760b5 |
children | e151e23f73bc |
files | src/ChangeLog src/data.cc |
diffstat | 2 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-03 Rik <octave@nomad.inbox5.com> + + * data.cc (islogical, isnumeric): Add tests to check sparse forms of + logical matrices. + 2011-01-02 Jaroslav Hajek <highegg@gmail.com> * ov-bool-sparse.h (octave_sparse_bool_matrix::is_numeric_type): New
--- a/src/data.cc +++ b/src/data.cc @@ -2523,6 +2523,8 @@ %!assert (islogical(single(1)), false) %!assert (islogical(single(1i)), false) %!assert (islogical(single([1,1])), false) +%!assert (islogical(sparse ([true, false])), true) +%!assert (islogical(sparse ([1, 0])), false) */ @@ -2929,6 +2931,24 @@ return retval; } +/* + +%!assert (isnumeric(1), true) +%!assert (isnumeric(1i), true) +%!assert (isnumeric([1,1]), true) +%!assert (isnumeric(single(1)), true) +%!assert (isnumeric(single(1i)), true) +%!assert (isnumeric(single([1,1])), true) +%!assert (isnumeric(int8(1)), true) +%!assert (isnumeric(uint8([1,1])), true) +%!assert (isnumeric("Hello World"), false) +%!assert (isnumeric(true), false) +%!assert (isnumeric(false), false) +%!assert (isnumeric([true, false]), false) +%!assert (isnumeric(sparse ([true, false])), false) + +*/ + DEFUN (ismatrix, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ismatrix (@var{a})\n\