changeset 4898:8fd9495f5054

[project @ 2004-06-04 13:29:33 by jwe]
author jwe
date Fri, 04 Jun 2004 13:29:34 +0000
parents 89eee52fd4c7
children e227982af676
files liboctave/Array.cc liboctave/ChangeLog scripts/ChangeLog scripts/deprecated/com2str.m scripts/plot/__pltopt__.m scripts/plot/errorbar.m scripts/polynomial/polyout.m src/ChangeLog src/ov-fcn-handle.h
diffstat 9 files changed, 56 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array.cc
+++ b/liboctave/Array.cc
@@ -2944,8 +2944,8 @@
 	      // We didn't start out with all zero dimensions, so if
 	      // index is a colon, it refers to the current LHS
 	      // dimension.  Otherwise, it is OK to enlarge to a
-	      // dimension given by the largest index (but that index
-	      // needs to be a number, not a colon).
+	      // dimension given by the largest index, but if that 
+	      // index is a colon the new dimension is singleton.
 
 	      if (i < lhs_dims_len
 		  && (idx(i).is_colon () || idx(i).max () < lhs_dims(i)))
@@ -2953,17 +2953,7 @@
 	      else if (! idx(i).is_colon ())
 		new_dims(i) = idx(i).max () + 1;
 	      else
-		{
-		  // XXX FIXME XXX -- can we provide a more
-		  // informative message here?
-
-		  (*current_liboctave_error_handler)
-		    ("invalid array index for assignment");
-
-		  retval = 0;
-
-		  break;
-		}
+		new_dims(i) = 1;
 	    }
 	}
 
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-03  David Bateman  <dbateman@free.fr>
+
+	* Array.cc (assignN): Allow magic colon for dimensions lvalue
+	greater than the existing number of dimensions in lvalue.
+
 2004-04-30  David Bateman  <dbateman@free.fr>
 
         * dim_vector.h (dim_vector::dim_vector_rep::dim_vector_rep):
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,5 +1,18 @@
+2004-06-04  Paul Kienzle  <pkienzle@users.sf.net>
+
+	* plot/errorbar.m: Remove debugging output.
+
+2004-06-03  Stefan van der Walt  <stefan@sun.ac.za>
+
+	* plot/__pltopt__.m: Properly escape @ symbols in doc string.
+
 2004-06-03  Paul Kienzle  <pkienzle@users.sf.net>
 
+	* deprecated/com2str.m: Include 'i' suffix for pure imaginary numbers.
+
+	* polynomial/polyout.m: Use parenthesis if necessary around
+	complex polynomial coefficient.
+
 	* plot/__errcomm__.m, plot/__errplot__.m: Simplify code and fix
 	the bug which causes __errplot__ to ignore the last argument.
 
--- a/scripts/deprecated/com2str.m
+++ b/scripts/deprecated/com2str.m
@@ -65,7 +65,7 @@
     ## strictly an imaginary number
     switch (flg)
       case(0)
-	retval = num2str (iz);
+	retval = [num2str(iz), "i"];
       case(1)
 	retval = [sgns(1+(iz<0)), " ", num2str(abs(iz)), "i"];
     endswitch
--- a/scripts/plot/__pltopt__.m
+++ b/scripts/plot/__pltopt__.m
@@ -34,10 +34,10 @@
 ## @item "."
 ## For dots plot style.
 ##
-## @item "@"
+## @item "@@"
 ## For points plot style.
 ##
-## @item "-@"
+## @item "-@@"
 ## For linespoints plot style.
 ##
 ## @item "^"
@@ -68,8 +68,8 @@
 ## With @code{n} in 1-6 (wraps at 8), plot color
 ##
 ## @item "nm"
-## With @code{m} in 1-6 (wraps at 6), point style (only valid for @code{"@"} or
-## @code{"-@"})
+## With @code{m} in 1-6 (wraps at 6), point style (only valid for @code{"@@"} or
+## @code{"-@@"})
 ##
 ## @item @var{c}
 ## Where @var{c} is one of @code{"r"}, @code{"g"}, @code{"b"}, @code{"m"},
--- a/scripts/plot/errorbar.m
+++ b/scripts/plot/errorbar.m
@@ -120,8 +120,6 @@
   gset nologscale y;
   gset nopolar;
 
-  length (varargin)
-
   __errcomm__ ("errorbar", varargin{:});
 
 endfunction
--- a/scripts/polynomial/polyout.m
+++ b/scripts/polynomial/polyout.m
@@ -53,12 +53,8 @@
   if(n > 0)
     n1 = n+1;
 
-    if (imag (c(1)))
-      tmp = com2str(c(1))
-    else
-      tmp = num2str(c(1));
-    endif
 
+    tmp = coeff (c(1));
     for ii = 2:n
       if (real (c(ii)) < 0)
 	ns = " - ";
@@ -67,13 +63,7 @@
         ns = " + ";
       endif
 
-      if (imag (c(ii)))
-	nstr = sprintf ("(%s)", com2str (c(ii)));
-      else
-        nstr = num2str (c(ii));
-      endif
-
-      tmp = sprintf ("%s*%s^%d%s%s", tmp, x, n1-ii, ns, nstr);
+      tmp = sprintf ("%s*%s^%d%s%s", tmp, x, n1-ii, ns, coeff (c(ii)));
 
     endfor
   else
@@ -87,3 +77,15 @@
   endif
 
 endfunction
+
+function str = coeff(c)
+  if (imag (c))
+    if (real (c))
+      str = sprintf ("(%s)", com2str(c));
+    else
+      str = com2str(c);
+    endif
+  else
+    str = num2str(c);
+  endif
+
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2004-06-03  John W. Eaton  <jwe@octave.org>
+
+	* ov-fcn-handle.h (octave_function_handle::is_matrix_type,
+	octave_function_handle::is_numeric_type,
+	octave_function_handle::is_constant,
+	octave_function_handle::is_true): New functions.
+	(octave_function_handle::is_defined): Delete (inherited version is
+	OK).
+
 2004-06-03  David Bateman  <dbateman@free.fr>
 
 	* DLD-FUNCTIONS/filter.cc: Fix for length(a)=1 && length(b)=2 case.
--- a/src/ov-fcn-handle.h
+++ b/src/ov-fcn-handle.h
@@ -148,7 +148,13 @@
   octave_value *clone (void) const { return new octave_fcn_handle (*this); }
   octave_value *empty_clone (void) const { return new octave_fcn_handle (); }
 
-  bool is_defined (void) const { return true; }
+  bool is_matrix_type (void) const { return false; }
+
+  bool is_numeric_type (void) const { return false; }
+
+  bool is_constant (void) const { return false; }
+
+  bool is_true (void) { return false; }
 
   bool is_function_handle (void) const { return true; }