changeset 10291:fc879f361bda

make isreal matlab compatible
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 10 Feb 2010 07:29:53 +0100
parents 1756b3035282
children c1246f17119e
files src/ChangeLog src/DLD-FUNCTIONS/cellfun.cc src/data.cc src/ov-str-mat.h
diffstat 4 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Feb 10 07:07:00 2010 +0100
+++ b/src/ChangeLog	Wed Feb 10 07:29:53 2010 +0100
@@ -1,3 +1,9 @@
+2010-02-10  Jaroslav Hajek  <highegg@gmail.com>
+
+	* ov-str-mat.h (octave_char_matrix_str::is_real_type): Delete
+	overload.
+	* data.cc (Fisreal): Improve docs.
+
 2010-02-10  Jaroslav Hajek  <highegg@gmail.com>
 
 	* data.cc (Fisnumeric): Improve documentation.
--- a/src/DLD-FUNCTIONS/cellfun.cc	Wed Feb 10 07:07:00 2010 +0100
+++ b/src/DLD-FUNCTIONS/cellfun.cc	Wed Feb 10 07:29:53 2010 +0100
@@ -777,8 +777,8 @@
 %% First input argument can be the special string "isreal",
 %% "isempty", "islogical", "length", "ndims" or "prodofsize"
 %!test
-%!  A = cellfun ("isreal", {true, 0.1, false, i*2, [], "abc"});
-%!  assert (A, [true, true, true, false, true, false]);
+%!  A = cellfun ("isreal", {true, 0.1, {}, i*2, [], "abc"});
+%!  assert (A, [true, true, false, false, true, true]);
 %!test
 %!  A = cellfun ("isempty", {true, 0.1, false, i*2, [], "abc"});
 %!  assert (A, [false, false, false, false, true, false]);
--- a/src/data.cc	Wed Feb 10 07:07:00 2010 +0100
+++ b/src/data.cc	Wed Feb 10 07:29:53 2010 +0100
@@ -3277,7 +3277,9 @@
 DEFUN (isreal, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} isreal (@var{x})\n\
-Return true if @var{x} is a real-valued numeric object.\n\
+Return true if @var{x} is a non-complex matrix or scalar.\n\
+For compatibility with Matlab, this includes logical and character\n\
+matrices.\n\
 @end deftypefn")
 {
   octave_value retval;
--- a/src/ov-str-mat.h	Wed Feb 10 07:07:00 2010 +0100
+++ b/src/ov-str-mat.h	Wed Feb 10 07:29:53 2010 +0100
@@ -107,8 +107,6 @@
 
   bool is_string (void) const { return true; }
 
-  bool is_real_type (void) const { return false; }
-
   bool is_numeric_type (void) const { return false; }
 
   double double_value (bool = false) const;