changeset 10752:d1b09c44d797

merge with main repo
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 25 Jun 2010 08:47:26 +0200
parents 717ba2c3eef1 (current diff) 9d95d8ab7c3a (diff)
children bee1b1a2e29a
files src/ChangeLog
diffstat 12 files changed, 83 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/CMatrix.cc	Fri Jun 25 08:45:22 2010 +0200
+++ b/liboctave/CMatrix.cc	Fri Jun 25 08:47:26 2010 +0200
@@ -2665,10 +2665,6 @@
                                  ps, rcon, rank, work.fortran_vec (),
                                  lwork, prwork, piwork, info));
 
-      std::cerr << "work(0): " << work(0) << std::endl;
-      std::cerr << "rwork(0): " << rwork(0) << std::endl;
-      std::cerr << "iwork(0): " << iwork(0) << std::endl;
-
       // The workspace query is broken in at least LAPACK 3.0.0
       // through 3.1.1 when n >= mnthr.  The obtuse formula below
       // should provide sufficient workspace for ZGELSD to operate
@@ -2702,10 +2698,6 @@
       lwork = static_cast<octave_idx_type> (std::real (work(0)));
       work.resize (lwork, 1);
 
-      std::cerr << "work numel: " << work.numel () << std::endl;
-      std::cerr << "rwork numel: " << rwork.numel () << std::endl;
-      std::cerr << "iwork numel: " << iwork.numel () << std::endl;
-
       F77_XFCN (zgelsd, ZGELSD, (m, n, nrhs, tmp_data, m, pretval,
                                  maxmn, ps, rcon, rank,
                                  work.fortran_vec (), lwork, 
--- a/scripts/ChangeLog	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/ChangeLog	Fri Jun 25 08:47:26 2010 +0200
@@ -1,3 +1,10 @@
+2010-06-24  John W. Eaton  <jwe@octave.org>
+
+	* plot/private/__plt__.m: Replace usage message with error.
+	* plot/loglog.m, plot/plot.m, plot/polar.m, plot/semilogx.m,
+	plot/semilogy.m: Call print_usage if no args are supplied.
+        Add additional calling forms to documentation.
+
 2010-06-24  Shai Ayal  <shaiay@users.sourceforge.net>
 
 	* plot/print.m: convert to wrapper for backend specific print functions
--- a/scripts/plot/loglog.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/loglog.m	Fri Jun 25 08:47:26 2010 +0200
@@ -18,9 +18,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} loglog (@var{args})
+## @deftypefn  {Function File} {} loglog (@var{y})
+## @deftypefnx {Function File} {} loglog (@var{x}, @var{y})
+## @deftypefnx {Function File} {} loglog (@var{x}, @var{y}, @var{property}, @var{value}, @dots{})
+## @deftypefnx {Function File} {} loglog (@var{x}, @var{y}, @var{fmt})
+## @deftypefnx {Function File} {} loglog (@var{h}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} loglog (@dots{})
 ## Produce a two-dimensional plot using log scales for both axes.  See
-## the description of @code{plot} for a description of the arguments
+## the documentation of @code{plot} for a description of the arguments
 ## that @code{loglog} will accept.
 ## @seealso{plot, semilogx, semilogy}
 ## @end deftypefn
@@ -29,7 +34,11 @@
 
 function retval = loglog (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("loglog", varargin{:});
+  [h, varargin, nargs] = __plt_get_axis_arg__ ("loglog", varargin{:});
+
+  if (nargs < 1)
+    print_usage(); 
+  endif
 
   oldh = gca ();
   unwind_protect
--- a/scripts/plot/plot.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/plot.m	Fri Jun 25 08:47:26 2010 +0200
@@ -179,7 +179,11 @@
 
 function retval = plot (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("plot", varargin{:});
+  [h, varargin, nargs] = __plt_get_axis_arg__ ("plot", varargin{:});
+
+  if (nargs < 1)
+    print_usage(); 
+  endif
 
   oldh = gca ();
   unwind_protect
--- a/scripts/plot/polar.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/polar.m	Fri Jun 25 08:47:26 2010 +0200
@@ -18,7 +18,10 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt})
+## @deftypefn  {Function File} {} polar (@var{theta}, @var{rho})
+## @deftypefnx {Function File} {} polar (@var{theta}, @var{rho}, @var{fmt})
+## @deftypefnx {Function File} {} polar (@var{h}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} polar (@dots{})
 ## Make a two-dimensional plot given the polar coordinates @var{theta} and
 ## @var{rho}.
 ##
@@ -32,6 +35,10 @@
 
   [h, varargin, nargs] = __plt_get_axis_arg__ ("polar", varargin{:});
 
+  if (nargs < 1)
+    print_usage(); 
+  endif
+
   oldh = gca ();
   unwind_protect
     axes (h);
--- a/scripts/plot/private/__plt__.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/private/__plt__.m	Fri Jun 25 08:47:26 2010 +0200
@@ -109,11 +109,7 @@
     endwhile
 
   else
-    msg = sprintf ("%s (y)\n", caller);
-    msg = sprintf ("%s       %s (x, y, ...)\n", msg, caller);
-    msg = sprintf ("%s       %s (x, y, fmt, ...)\n", msg, caller);
-    msg = sprintf ("%s       %s (x, y, property, value, ...)", msg, caller);
-    usage (msg);
+    error ("__plt__: invalid number of arguments");
   endif
 
 endfunction
--- a/scripts/plot/semilogx.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/semilogx.m	Fri Jun 25 08:47:26 2010 +0200
@@ -18,9 +18,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} semilogx (@var{args})
+## @deftypefn  {Function File} {} semilogx (@var{y})
+## @deftypefnx {Function File} {} semilogx (@var{x}, @var{y})
+## @deftypefnx {Function File} {} semilogx (@var{x}, @var{y}, @var{property}, @var{value}, @dots{})
+## @deftypefnx {Function File} {} semilogx (@var{x}, @var{y}, @var{fmt})
+## @deftypefnx {Function File} {} semilogx (@var{h}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} semilogx (@dots{})
 ## Produce a two-dimensional plot using a logarithmic scale for the @var{x}
-## axis.  See the description of @code{plot} for a description of the
+## axis.  See the documentation of @code{plot} for a description of the
 ## arguments that @code{semilogx} will accept.
 ## @seealso{plot, semilogy, loglog}
 ## @end deftypefn
@@ -29,7 +34,11 @@
 
 function retval = semilogx (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("semilogx", varargin{:});
+  [h, varargin, nargs] = __plt_get_axis_arg__ ("semilogx", varargin{:});
+
+  if (nargs < 1)
+    print_usage(); 
+  endif
 
   oldh = gca ();
   unwind_protect
--- a/scripts/plot/semilogy.m	Fri Jun 25 08:45:22 2010 +0200
+++ b/scripts/plot/semilogy.m	Fri Jun 25 08:47:26 2010 +0200
@@ -18,9 +18,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} semilogy (@var{args})
+## @deftypefn  {Function File} {} semilogy (@var{y})
+## @deftypefnx {Function File} {} semilogy (@var{x}, @var{y})
+## @deftypefnx {Function File} {} semilogy (@var{x}, @var{y}, @var{property}, @var{value}, @dots{})
+## @deftypefnx {Function File} {} semilogy (@var{x}, @var{y}, @var{fmt})
+## @deftypefnx {Function File} {} semilogy (@var{h}, @dots{})
+## @deftypefnx {Function File} {@var{h} =} semilogy (@dots{})
 ## Produce a two-dimensional plot using a logarithmic scale for the @var{y}
-## axis.  See the description of @code{plot} for a description of the
+## axis.  See the documentation of @code{plot} for a description of the
 ## arguments that @code{semilogy} will accept.
 ## @seealso{plot, semilogx, loglog}
 ## @end deftypefn
@@ -29,7 +34,11 @@
 
 function retval = semilogy (varargin)
 
-  [h, varargin] = __plt_get_axis_arg__ ("semilogy", varargin{:});
+  [h, varargin, nargs] = __plt_get_axis_arg__ ("semilogy", varargin{:});
+
+  if (nargs < 1)
+    print_usage(); 
+  endif
 
   oldh = gca ();
   unwind_protect
--- a/src/ChangeLog	Fri Jun 25 08:45:22 2010 +0200
+++ b/src/ChangeLog	Fri Jun 25 08:47:26 2010 +0200
@@ -2,6 +2,10 @@
 
 	* ov-struct.cc (Fcell2struct): Rewrite.
 
+2010-06-24  Rik <octave@nomad.inbox5.com>
+
+        * octave.cc: Add [FILE] to octave usage string (bug #30258).
+
 2010-06-24  Jaroslav Hajek  <highegg@gmail.com>
 
 	* oct-map.h (octave_map, octave_scalar_map): New classes.
--- a/src/octave.cc	Fri Jun 25 08:45:22 2010 +0200
+++ b/src/octave.cc	Fri Jun 25 08:47:26 2010 +0200
@@ -467,7 +467,7 @@
 {
   std::cout << OCTAVE_NAME_VERSION_COPYRIGHT_COPYING_AND_WARRANTY "\n\
 \n\
-Usage: octave [options]\n\
+Usage: octave [options] [FILE]\n\
 \n\
 Options:\n\
 \n\
--- a/src/ov-str-mat.cc	Fri Jun 25 08:45:22 2010 +0200
+++ b/src/ov-str-mat.cc	Fri Jun 25 08:47:26 2010 +0200
@@ -242,6 +242,25 @@
   return retval;
 }
 
+Array<std::string>
+octave_char_matrix_str::cellstr_value (void) const
+{
+  Array<std::string> retval;
+
+  if (matrix.ndims () == 2)
+    {
+      const charMatrix chm = matrix.matrix_value ();
+      octave_idx_type nr = chm.rows ();
+      retval.clear (nr, 1);
+      for (octave_idx_type i = 0; i < nr; i++)
+        retval.xelem(i) = chm.row_as_string (i);
+    }
+  else
+    error ("cellstr: cannot convert multidimensional arrays");
+
+  return retval;
+}
+
 void
 octave_char_matrix_str::print_raw (std::ostream& os, bool pr_as_read_syntax) const
 {
--- a/src/ov-str-mat.h	Fri Jun 25 08:45:22 2010 +0200
+++ b/src/ov-str-mat.h	Fri Jun 25 08:47:26 2010 +0200
@@ -129,6 +129,8 @@
 
   std::string string_value (bool force = false) const;
 
+  Array<std::string> cellstr_value (void) const;
+
   octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
     { return octave_value (matrix.sort (dim, mode)); }