changeset 5388:7099eb9841b4

[project @ 2005-06-14 20:04:31 by jwe]
author jwe
date Tue, 14 Jun 2005 20:04:31 +0000
parents 5b00a8beb504
children 25c8956d2204
files liboctave/lo-ieee.h scripts/ChangeLog scripts/general/isvector.m src/ChangeLog src/input.cc src/ls-mat5.cc src/pr-output.cc src/pt-arg-list.cc src/pt.cc src/pt.h
diffstat 10 files changed, 37 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/lo-ieee.h
+++ b/liboctave/lo-ieee.h
@@ -37,6 +37,9 @@
 /* Octave's idea of not a number.  */
 extern double octave_NaN;
 
+/* XXX FIXME XXX -- this code assumes that a double has twice the
+   number of bits as an int */
+
 extern int lo_ieee_hw;
 extern int lo_ieee_lw;
 
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-14  John W. Eaton  <jwe@octave.org>
+
+	* general/isvector.m: Handle N-d arrays.
+	From Bill Denney <denney@seas.upenn.edu>.
+
 2005-06-02  Ben Barrowes  <barrowes@alum.mit.edu>
 
 	* plot/meshgrid.m: Handle 3 input arguments.
--- a/scripts/general/isvector.m
+++ b/scripts/general/isvector.m
@@ -31,10 +31,7 @@
   retval = 0;
 
   if (nargin == 1)
-    if (ismatrix (x))
-      [nr, nc] = size (x);
-      retval = ((nr == 1 && nc >= 1) || (nc == 1 && nr >= 1));
-    endif
+    retval = (ismatrix (x) && ! isempty (x) && prod (size (x)) == length (x));
   else
     usage ("isvector (x)");
   endif
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,9 +1,25 @@
-2005-06-09  David Bateman <dbateman@free.fr>
+2005-06-14  Keith Goodman  <kwgoodman@gmail.com>
+
+	* input.cc (get_user_input): Renamed debug commands to dbnext, dbstep,
+	and dbcont.
+	* pt.cc: Renamed dbg_next to dbnext in comment string.
+	* pt.h: Renamed dbg_next to dbnext in comment string.
+
+2005-06-14  David Bateman  <dbateman@free.fr>
+
+	* pt-arg-list.cc (F__end__): Return 1 for dimensions larger than ndim.
+
+2005-06-14  John W. Eaton  <jwe@octave.org>
+
+	* ls-mat5.cc (save_mat5_array_length): Special case for NaN, NA,
+	and Inf values.  Only check if abs value is greater than FLT_MAX.
+
+2005-06-09  David Bateman  <dbateman@free.fr>
 
 	* ls-mat5.cc (save_mat5_element_length): 1 element strings will be
 	saved in a compressed format, so calculate the length accordingly.
 
-2005-05-30  David Bateman <dbateman@free.fr>
+2005-05-30  David Bateman  <dbateman@free.fr>
 
 	* ls-mat5.cc (read_mat5_binary_element): Don't convert to string
 	if matrix is not of type mxCHAR_CLASS.
--- a/src/input.cc
+++ b/src/input.cc
@@ -624,11 +624,11 @@
 	  if (match_sans_spaces_semi ("exit", input_buf)
 	      || match_sans_spaces_semi ("quit", input_buf)
 	      || match_sans_spaces_semi ("return", input_buf)
-	      || match_sans_spaces_semi ("dbg_cont", input_buf))
+	      || match_sans_spaces_semi ("dbcont", input_buf))
 	    {
 	      return retval;
 	    }
-	  else if (match_sans_spaces_semi ("dbg_step", input_buf))
+	  else if (match_sans_spaces_semi ("dbstep", input_buf))
 	    {
 	      tree::break_next = true;
 
@@ -638,7 +638,7 @@
 
 	      return retval;
 	    }
-	  else if (match_sans_spaces_semi ("dbg_next", input_buf))
+	  else if (match_sans_spaces_semi ("dbnext", input_buf))
 	    {
 	      tree::break_next = true;
 
--- a/src/ls-mat5.cc
+++ b/src/ls-mat5.cc
@@ -1243,7 +1243,8 @@
 	    {
 	      double tmp = val [i];
 
-	      if (tmp > FLT_MAX || tmp < FLT_MIN)
+	      if (! (octave_is_NaN_or_NA (tmp) || xisinf (tmp))
+		  && fabs (tmp) > FLT_MAX)
 		{
 		  too_large_for_float = true;
 		  break;
--- a/src/pr-output.cc
+++ b/src/pr-output.cc
@@ -237,7 +237,7 @@
     for (octave_idx_type i = 0; i < nr; i++)
       {
 	double val = m(i,j);
-	if (xisinf (val) || octave_is_NaN_or_NA (val))
+	if (xisinf (val) || xisnan (val))
 	  continue;
 
 	if (val > result)
@@ -370,7 +370,7 @@
 
   bool sign = (d < 0.0);
 
-  bool inf_or_nan = (xisinf (d) || xisnan (d));
+  bool inf_or_nan = (xisinf (d) || octave_is_NaN_or_NA (d));
 
   bool int_only = (! inf_or_nan && D_NINT (d) == d);
 
--- a/src/pt-arg-list.cc
+++ b/src/pt-arg-list.cc
@@ -145,11 +145,7 @@
 	    if (index_position < dv.length ())
 	      retval = dv(index_position);
 	    else
-	      {
-		std::string dv_str = dv.str ();
-		::error ("invalid use of end: (index %d, dims %s)",
-			 index_position+1, dv_str.c_str ());
-	      }
+	      retval = 1;
 	  }
 	  break;
 	}
--- a/src/pt.cc
+++ b/src/pt.cc
@@ -37,7 +37,7 @@
 // If true, stop executing at the next possible point.
 bool tree::break_next = false;
 
-// The line where dbg_next was executed.
+// The line where dbnext was executed.
 int tree::last_line = 0;
 
 // The function where the last breakpoint occurred.
--- a/src/pt.h
+++ b/src/pt.h
@@ -68,7 +68,7 @@
   // If true, stop executing at the next possible point.
   static bool break_next;
   
-  // The line where dbg_next was executed.
+  // The line where dbnext was executed.
   static int last_line; 
 
   // The function where the last breakpoint occurred.