# HG changeset patch # User jwe # Date 1086355774 0 # Node ID 8fd9495f5054ce0d98505789755a8d81c076447a # Parent 89eee52fd4c798cebda9a5d0676bb467b16c9cce [project @ 2004-06-04 13:29:33 by jwe] diff --git a/liboctave/Array.cc b/liboctave/Array.cc --- 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; } } diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2004-06-03 David Bateman + + * Array.cc (assignN): Allow magic colon for dimensions lvalue + greater than the existing number of dimensions in lvalue. + 2004-04-30 David Bateman * dim_vector.h (dim_vector::dim_vector_rep::dim_vector_rep): diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,5 +1,18 @@ +2004-06-04 Paul Kienzle + + * plot/errorbar.m: Remove debugging output. + +2004-06-03 Stefan van der Walt + + * plot/__pltopt__.m: Properly escape @ symbols in doc string. + 2004-06-03 Paul Kienzle + * 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. diff --git a/scripts/deprecated/com2str.m b/scripts/deprecated/com2str.m --- 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 diff --git a/scripts/plot/__pltopt__.m b/scripts/plot/__pltopt__.m --- 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"}, diff --git a/scripts/plot/errorbar.m b/scripts/plot/errorbar.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 diff --git a/scripts/polynomial/polyout.m b/scripts/polynomial/polyout.m --- 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 + diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-06-03 John W. Eaton + + * 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 * DLD-FUNCTIONS/filter.cc: Fix for length(a)=1 && length(b)=2 case. diff --git a/src/ov-fcn-handle.h b/src/ov-fcn-handle.h --- 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; }