changeset 5435:66ad03c58880

[project @ 2005-08-31 20:41:47 by jwe]
author jwe
date Wed, 31 Aug 2005 20:41:48 +0000
parents c2428a4b7d56
children 2ed5009be503
files scripts/ChangeLog scripts/control/system/is_controllable.m scripts/set/ismember.m scripts/special-matrix/invhilb.m scripts/statistics/base/iqr.m scripts/statistics/base/var.m scripts/strings/strcat.m src/ChangeLog src/oct-map.cc src/oct-map.h src/ov-str-mat.cc
diffstat 11 files changed, 45 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/ChangeLog	Wed Aug 31 20:41:48 2005 +0000
@@ -1,3 +1,9 @@
+2005-08-31  Daniel  <durbano@shbano.com>
+
+	* special-matrix/invhilb.m, statistics/base/iqr.m,
+	control/system/is_controllable.m, set/ismember.m: Doc fixes.
+	From Jorge Barros de Abreu <ficmatin01@solar.com.br>.
+
 2005-08-29  Bill Denney <denney@seas.upenn.edu>
 
 	* image/saveimage.m: Open output file in binary mode.
--- a/scripts/control/system/is_controllable.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/control/system/is_controllable.m	Wed Aug 31 20:41:48 2005 +0000
@@ -30,7 +30,7 @@
 ## @itemx b
 ## @var{n} by @var{n}, @var{n} by @var{m} matrices, respectively
 ## @item tol
-## optional roundoff paramter.  default value: @code{10*eps}
+## optional roundoff parameter.  Default value: @code{10*eps}
 ## @end table
 ##
 ## @strong{Outputs}
--- a/scripts/set/ismember.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/set/ismember.m	Wed Aug 31 20:41:48 2005 +0000
@@ -22,7 +22,7 @@
 ## Return a matrix the same shape as @var{A} which has 1 if
 ## @code{A(i,j)} is in @var{S} or 0 if it isn't.
 ## @end deftypefn
-## @seealso{unique, union, intersect, setxor, setdiff}
+## @seealso{unique, union, intersection, setxor, setdiff}
 
 ## Author: Paul Kienzle
 ## Adapted-by: jwe
@@ -109,4 +109,4 @@
   endif
 
 endfunction
-  
\ No newline at end of file
+  
--- a/scripts/special-matrix/invhilb.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/special-matrix/invhilb.m	Wed Aug 31 20:41:48 2005 +0000
@@ -20,7 +20,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} invhilb (@var{n})
 ## Return the inverse of a Hilbert matrix of order @var{n}.  This can be 
-## computed computed exactly using
+## computed exactly using
 ## @tex
 ## $$\eqalign{
 ##   A_{ij} &= -1^{i+j} (i+j-1)
--- a/scripts/statistics/base/iqr.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/statistics/base/iqr.m	Wed Aug 31 20:41:48 2005 +0000
@@ -23,7 +23,7 @@
 ## difference between the upper and lower quartile, of the input data.
 ##
 ## If @var{x} is a matrix, do the above for first non singleton
-## dimension of @var{x}.. If the option @var{dim} argument is given,
+## dimension of @var{x}. If the option @var{dim} argument is given,
 ## then operate along this dimension.
 ## @end deftypefn
 
--- a/scripts/statistics/base/var.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/statistics/base/var.m	Wed Aug 31 20:41:48 2005 +0000
@@ -23,16 +23,15 @@
 ## For matrix arguments, return a row vector contaning the variance for
 ## each column.
 ##
-## The argument @var{opt} determines the type of normalization to use. Valid 
-## values are
+## The argument @var{opt} determines the type of normalization to use.
+## Valid values are
 ##
 ## @table @asis 
 ## @item 0:
-##   normalizes with N-1, provides the square root of best unbiased estimator
-##   of the variance [default]
+## Normalizes with N-1, provides the best unbiased estimator of the
+## variance [default].
 ## @item 1:
-##   normalizes with N, this provides the square root of the second moment
-##   around the mean
+## Normalizes with N, this provides the second moment around the mean.
 ## @end table
 ##
 ## The third argument @var{dim} determines the dimension along which the 
--- a/scripts/strings/strcat.m	Tue Aug 30 19:29:50 2005 +0000
+++ b/scripts/strings/strcat.m	Wed Aug 31 20:41:48 2005 +0000
@@ -33,18 +33,18 @@
 
 ## Author: jwe
 
-function st = strcat (s, t, varargin)
+function st = strcat (s, varargin)
 
   if (nargin > 0)
     save_warn_empty_list_elements = warn_empty_list_elements;
     unwind_protect
       warn_empty_list_elements = 0;
-      if (isstr (s) && isstr (t))
-        tmpst = [s, t];
+      if (isstr (s))
+        tmpst = s;
       else
         error ("strcat: all arguments must be strings");
       endif
-      n = nargin - 2;
+      n = nargin - 1;
       k = 1;
       while (n--)
         tmp = varargin{k++};
--- a/src/ChangeLog	Tue Aug 30 19:29:50 2005 +0000
+++ b/src/ChangeLog	Wed Aug 31 20:41:48 2005 +0000
@@ -1,3 +1,11 @@
+2005-08-31  John W. Eaton  <jwe@octave.org>
+
+	* oct-map.cc (Octave_map::index): Don't crash if index list is empty.
+	* ov-str-mat.cc (octave_char_matrix_str::do_index_op_internal):
+	Likewise. 
+
+	* oct-map.h (Octave_map::ndims): New function.
+
 2005-08-30  John W. Eaton  <jwe@octave.org>
 
 	* ov-range.h (octave_range::permute): New function.
--- a/src/oct-map.cc	Tue Aug 30 19:29:50 2005 +0000
+++ b/src/oct-map.cc	Wed Aug 31 20:41:48 2005 +0000
@@ -336,15 +336,21 @@
 {
   Octave_map retval;
 
-  for (iterator p = begin (); p != end (); p++)
+  if (idx.length () > 0)
     {
-      Cell tmp = contents(p).index (idx);
+      for (iterator p = begin (); p != end (); p++)
+	{
+	  Cell tmp = contents(p).index (idx);
 
-      if (error_state)
-	break;
+	  if (error_state)
+	    break;
 
-      retval.assign (key(p), tmp);
+	  retval.assign (key(p), tmp);
+	}
     }
+  else
+    error ("invalid number of indices (= 0) for %d-dimensional struct array",
+	   ndims ());
 
   return error_state ? Octave_map () : retval;
 }
--- a/src/oct-map.h	Tue Aug 30 19:29:50 2005 +0000
+++ b/src/oct-map.h	Wed Aug 31 20:41:48 2005 +0000
@@ -121,6 +121,8 @@
 
   dim_vector dims (void) const { return dimensions; }
 
+  int ndims (void) const { return dimensions.length (); }
+
   Octave_map reshape (const dim_vector& new_dims) const;
 
   Octave_map resize (const dim_vector& dv) const;
--- a/src/ov-str-mat.cc	Tue Aug 30 19:29:50 2005 +0000
+++ b/src/ov-str-mat.cc	Wed Aug 31 20:41:48 2005 +0000
@@ -111,6 +111,10 @@
       }
       break;
 
+    case 0:
+      error ("invalid number of indices (= 0) for %d-dimensional character array", matrix.ndims ());
+      break;
+
     default:
       {
 	Array<idx_vector> idx_vec (len);