Mercurial > hg > octave-terminal
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 +++ b/liboctave/CMatrix.cc @@ -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 +++ b/scripts/ChangeLog @@ -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 +++ b/scripts/plot/loglog.m @@ -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 +++ b/scripts/plot/plot.m @@ -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 +++ b/scripts/plot/polar.m @@ -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 +++ b/scripts/plot/private/__plt__.m @@ -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 +++ b/scripts/plot/semilogx.m @@ -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 +++ b/scripts/plot/semilogy.m @@ -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 +++ b/src/ChangeLog @@ -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 +++ b/src/octave.cc @@ -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 +++ b/src/ov-str-mat.cc @@ -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 {