Mercurial > hg > octave-lyh
changeset 9841:6f1ea8241c99
make isnumeric yield false on logicals
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 20 Nov 2009 08:18:41 +0100 |
parents | c0b54271904b |
children | 10519b4d6507 |
files | scripts/ChangeLog scripts/general/__isequal__.m scripts/testfun/assert.m src/ChangeLog src/ov-bool-mat.h src/ov-bool.h |
diffstat | 6 files changed, 17 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2009-11-20 Jaroslav Hajek <highegg@gmail.com> + + * general/__isequal__.m: Check for isnumeric|islogical. + * testfun/assert.m: Ditto. + 2009-11-19 Jaroslav Hajek <highegg@gmail.com> * specfun/perms.m: Avoid recursion. Simplify assignments. Allow empty
--- a/scripts/general/__isequal__.m +++ b/scripts/general/__isequal__.m @@ -66,8 +66,8 @@ ## numeric values. t = (all (strcmp (class(x), cellfun (@class, varargin, "UniformOutput", false))) - || (isnumeric (x) - && all (cellfun (@isnumeric, varargin, "UniformOutput", true)))); + || ((isnumeric (x) || islogical (x)) + && all ((cellfun (@isnumeric, varargin) | cellfun (@islogical, varargin))))); if (t) ## Test that everything has the same number of dimensions.
--- a/scripts/testfun/assert.m +++ b/scripts/testfun/assert.m @@ -65,7 +65,7 @@ in = cstrcat ("(", in, ")"); if (nargin == 1 || (nargin > 1 && islogical (cond) && ischar (varargin{1}))) - if (! isnumeric (cond) || ! all (cond(:))) + if ((! isnumeric (cond) && ! islogical (cond)) || ! all (cond(:))) if (nargin == 1) ## Say which elements failed? error ("assert %s failed", in);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-11-20 Jaroslav Hajek <highegg@gmail.com> + + * ov-bool.h (octave_bool::is_numeric_type): New overload. + * ov-bool-mat.h (octave_bool-matrix::is_numeric_type): New overload. + 2009-11-19 Jaroslav Hajek <highegg@gmail.com> * ov-base.h (unary_mapper_t): New member: umap_erfinv.