changeset 25109:68039183fac4

maint: merge stable to default.
author Rik <rik@octave.org>
date Tue, 03 Apr 2018 22:21:09 -0700
parents 1fdd1b211ed4 (current diff) 7561fb4ab972 (diff)
children 623388e8f8fd
files
diffstat 18 files changed, 134 insertions(+), 62 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/module.mk	Tue Apr 03 13:52:40 2018 -0700
+++ b/doc/interpreter/module.mk	Tue Apr 03 22:21:09 2018 -0700
@@ -204,7 +204,7 @@
 octdoc_DATA += \
   $(OCTAVE_QTHELP_FILES)
 
-$(OCTAVE_QTHELP_FILES): $(OCTAVE_HTML_STAMP) %reldir%/mk-qthelp.pl
+$(OCTAVE_QTHELP_FILES): $(OCTAVE_HTML_STAMP) $(HTMLDIR_CSS) %reldir%/mk-qthelp.pl
 	$(AM_V_GEN)rm -f $(OCTAVE_QTHELP_FILES) && \
 	$(PERL) $(srcdir)/%reldir%/mk-qthelp.pl octave.html %reldir%/octave_interpreter && \
 	$(QCOLLECTIONGENERATOR) $(QCOLLECTIONGENERATORFLAGS) %reldir%/octave_interpreter.qhcp -o %reldir%/octave_interpreter.qhc >/dev/null && \
--- a/doc/interpreter/octave.css	Tue Apr 03 13:52:40 2018 -0700
+++ b/doc/interpreter/octave.css	Tue Apr 03 22:21:09 2018 -0700
@@ -62,7 +62,7 @@
 /* Import web font Fantasque Sans Mono, Font Library Version 2016-04-05 */
 @font-face
 {
-  font-family: 'Fantasque Sans Mono';
+  font-family: 'Fantasque Sans Mono', 'Courier New', Cousine, Courier, monospace;
   src: local('Fantasque Sans Mono Bold'),
        local('FantasqueSansMono-Bold'),
        url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/a46033d3a07d9385620dc83b7655203f/FantasqueSansMonoBold.ttf') format('truetype');
@@ -72,7 +72,7 @@
 
 @font-face
 {
-  font-family: 'Fantasque Sans Mono';
+  font-family: 'Fantasque Sans Mono', 'Courier New', Cousine, Courier,  'monospace';
   src: local('Fantasque Sans Mono Bold Italic'),
        local('FantasqueSansMono-BoldItalic'),
        url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/b0683ef4c834908aa372ec78dea42349/FantasqueSansMonoBoldItalic.ttf') format('truetype');
@@ -82,7 +82,7 @@
 
 @font-face
 {
-  font-family: 'Fantasque Sans Mono';
+  font-family: 'Fantasque Sans Mono', 'Courier New', Cousine, Courier, monospace;
   src: local('Fantasque Sans Mono Italic'),
        local('FantasqueSansMono-Italic'),
        url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/b78d0a48e4443f797e8d45dcf97594f7/FantasqueSansMonoItalic.ttf') format('truetype');
@@ -92,7 +92,7 @@
 
 @font-face
 {
-  font-family: 'Fantasque Sans Mono';
+  font-family: 'Fantasque Sans Mono', 'Courier New', Cousine, Courier, monospace;
   src: local('Fantasque Sans Mono Regular'),
        local('FantasqueSansMono-Regular'),
        url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/f3fdc4f0f26e4431f54e8b552d55480c/FantasqueSansMonoRegular.ttf') format('truetype');
@@ -101,7 +101,7 @@
 }
 
 /* Use custom fonts */
-code, kbd, samp, tt, pre { font-family: 'Fantasque Sans Mono', monospace; }
+code, kbd, samp, tt, pre { font-family: 'Fantasque Sans Mono', 'Courier New', Cousine, Courier, monospace; }
 
 code, kbd, samp, tt {
   font-style: italic;
--- a/libinterp/corefcn/bsxfun.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/bsxfun.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -321,19 +321,18 @@
 DEFMETHOD (bsxfun, interp,args, ,
            doc: /* -*- texinfo -*-
 @deftypefn {} {} bsxfun (@var{f}, @var{A}, @var{B})
-The binary singleton expansion function performs broadcasting,
-that is, it applies a binary function @var{f} element-by-element to two
-array arguments @var{A} and @var{B}, and expands as necessary
-singleton dimensions in either input argument.
+Apply a binary function @var{f} element-by-element to two array arguments
+@var{A} and @var{B}, expanding singleton dimensions in either input argument as
+necessary.
 
 @var{f} is a function handle, inline function, or string containing the name
-of the function to evaluate.  The function @var{f} must be capable of
-accepting two column-vector arguments of equal length, or one column vector
-argument and a scalar.
+of the function to evaluate.  The function @var{f} must be capable of accepting
+two column-vector arguments of equal length, or one column vector argument and
+a scalar.
 
 The dimensions of @var{A} and @var{B} must be equal or singleton.  The
-singleton dimensions of the arrays will be expanded to the same
-dimensionality as the other array.
+singleton dimensions of the arrays will be expanded to the same dimensionality
+as the other array.
 @seealso{arrayfun, cellfun}
 @end deftypefn */)
 {
--- a/libinterp/corefcn/daspk.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/daspk.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -157,7 +157,9 @@
 DEFMETHOD (daspk, interp, args, nargout,
            doc: /* -*- texinfo -*-
 @deftypefn {} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} daspk (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
-Solve the set of differential-algebraic equations
+Solve a set of differential-algebraic equations.
+
+@code{daspk} solves the set of equations
 @tex
 $$ 0 = f (x, \dot{x}, t) $$
 with
--- a/libinterp/corefcn/dasrt.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/dasrt.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -196,7 +196,9 @@
 @deftypefnx {} {@dots{} =} dasrt (@var{fcn}, @var{g}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
 @deftypefnx {} {@dots{} =} dasrt (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t})
 @deftypefnx {} {@dots{} =} dasrt (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
-Solve the set of differential-algebraic equations
+Solve a set of differential-algebraic equations.
+
+@code{dasrt} solves the set of equations
 @tex
 $$ 0 = f (x, \dot{x}, t) $$
 with
--- a/libinterp/corefcn/dassl.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/dassl.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -157,7 +157,9 @@
 DEFMETHOD (dassl, interp, args, nargout,
            doc: /* -*- texinfo -*-
 @deftypefn {} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} dassl (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})
-Solve the set of differential-algebraic equations
+Solve a set of differential-algebraic equations.
+
+@code{dassl} solves the set of equations
 @tex
 $$ 0 = f (x, \dot{x}, t) $$
 with
--- a/libinterp/corefcn/gsvd.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/gsvd.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -99,7 +99,10 @@
 @deftypefn  {} {@var{S} =} gsvd (@var{A}, @var{B})
 @deftypefnx {} {[@var{U}, @var{V}, @var{X}, @var{C}, @var{S}] =} gsvd (@var{A}, @var{B})
 @deftypefnx {} {[@var{U}, @var{V}, @var{X}, @var{C}, @var{S}] =} gsvd (@var{A}, @var{B}, 0)
-Compute the generalized singular value decomposition of (@var{A}, @var{B}):
+Compute the generalized singular value decomposition of (@var{A}, @var{B}).
+
+The generalized singular value decomposition is defined by the following
+relations:
 
 @tex
 $$ A = U C X^\dagger $$
--- a/libinterp/corefcn/load-save.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/load-save.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -1789,15 +1789,17 @@
 @deftypefn  {} {@var{val} =} octave_core_file_limit ()
 @deftypefnx {} {@var{old_val} =} octave_core_file_limit (@var{new_val})
 @deftypefnx {} {} octave_core_file_limit (@var{new_val}, "local")
-Query or set the internal variable that specifies the maximum amount
-of memory (in kilobytes) of the top-level workspace that Octave will
-attempt to save when writing data to the crash dump file (the name of
-the file is specified by @var{octave_core_file_name}).
+Query or set the internal variable that specifies the maximum amount of memory
+that Octave will save when writing a crash dump file.
 
-If @var{octave_core_file_options} flags specify a binary format,
-then @var{octave_core_file_limit} will be approximately the maximum
-size of the file.  If a text file format is used, then the file could
-be much larger than the limit.  The default value is -1 (unlimited)
+The limit is measured in kilobytes and is applied to the top-level workspace.
+The name of the crash dump file is is specified by
+@var{octave_core_file_name}).
+
+If @var{octave_core_file_options} flags specify a binary format, then
+@var{octave_core_file_limit} will be approximately the maximum size of the
+file.  If a text file format is used, then the file could be much larger than
+the limit.  The default value is -1 (unlimited).
 
 When called from inside a function with the @qcode{"local"} option, the
 variable is changed locally for the function and any subroutines it calls.
--- a/libinterp/corefcn/pr-output.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/pr-output.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -3377,30 +3377,43 @@
 }
 
 /*
+## FIXME: This test writes values to a file, but then never checks them.
 %!test
-%! format short
-%! fd = tmpfile ();
-%! for r = [0, Inf -Inf, NaN]
-%!   for i = [0, Inf -Inf, NaN]
-%!     fdisp (fd, complex (r, i));
+%! [old_fmt, old_spacing] = format ();
+%! unwind_protect
+%!   format short
+%!   fd = tmpfile ();
+%!   for r = [0, Inf -Inf, NaN]
+%!     for i = [0, Inf -Inf, NaN]
+%!       fdisp (fd, complex (r, i));
+%!     endfor
 %!   endfor
-%! endfor
-%! fclose (fd);
+%!   fclose (fd);
+%! unwind_protect_cleanup
+%!   format (old_fmt);
+%!   format (old_spacing);
+%! end_unwind_protect
 
 %!test
-%! foo.real = pi * ones (3,20,3);
-%! foo.complex = pi * ones (3,20,3) + 1i;
-%! foo.char = repmat ("- Hello World -", [3, 20]);
-%! foo.cell = {foo.real, foo.complex, foo.char};
-%! fields = fieldnames (foo);
-%! for f = 1:numel (fields)
-%!   format loose;
-%!   loose = disp (foo.(fields{f}));
-%!   format compact;
-%!   compact = disp (foo.(fields{f}));
-%!   expected = strrep (loose, "\n\n", "\n");
-%!   assert (expected, compact);
-%! endfor
+%! [old_fmt, old_spacing] = format ();
+%! unwind_protect
+%!   foo.real = pi * ones (3,20,3);
+%!   foo.complex = pi * ones (3,20,3) + 1i;
+%!   foo.char = repmat ("- Hello World -", [3, 20]);
+%!   foo.cell = {foo.real, foo.complex, foo.char};
+%!   fields = fieldnames (foo);
+%!   for f = 1:numel (fields)
+%!     format loose;
+%!     loose = disp (foo.(fields{f}));
+%!     format compact;
+%!     compact = disp (foo.(fields{f}));
+%!     expected = strrep (loose, "\n\n", "\n");
+%!     assert (expected, compact);
+%!   endfor
+%! unwind_protect_cleanup
+%!   format (old_fmt);
+%!   format (old_spacing);
+%! end_unwind_protect
 */
 
 DEFUN (display, args, ,
@@ -3507,7 +3520,6 @@
   bank_format = false;
   hex_format = 0;
   bit_format = 0;
-  Vcompact_format = false;
   print_e = false;
   print_big_e = false;
   print_g = false;
@@ -3751,6 +3763,7 @@
       init_format_state ();
       set_output_prec (5);
       format = "short";
+      Vcompact_format = false;
     }
 
   format_string = format;
@@ -3938,6 +3951,9 @@
     }
   else
     {
+      if (args.length () > 0)
+        warning ("format: cannot query and set format at the same time, ignoring set operation");
+
       if (nargout >= 2)
         retval(1) = (Vcompact_format ? "compact" : "loose");
 
@@ -3971,6 +3987,25 @@
 %!   format (old_fmt);
 %!   format (old_spacing);
 %! end_unwind_protect
+
+%!test <*53427>
+%! [old_fmt, old_spacing] = format ();
+%! unwind_protect
+%!   format;          # reset format to short and loose
+%!   format compact;  # set compact format
+%!   format long;     # set long format
+%!   [fmt, spacing] = format ();
+%!   assert (fmt, "long");
+%!   assert (spacing, "compact");
+%! unwind_protect_cleanup
+%!   format (old_fmt);
+%!   format (old_spacing);
+%! end_unwind_protect
+
+## Test input validation
+%!test
+%! fail ("fmt = format ('long')", "warning", "cannot query and set format");
+
 */
 
 DEFUN (fixed_point_format, args, nargout,
--- a/libinterp/corefcn/qz.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/qz.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -134,7 +134,10 @@
 @deftypefnx {} {[@var{AA}, @var{BB}, @var{Q}, @var{Z}, @var{V}, @var{W}, @var{lambda}] =} qz (@var{A}, @var{B})
 @deftypefnx {} {[@var{AA}, @var{BB}, @var{Z}] =} qz (@var{A}, @var{B}, @var{opt})
 @deftypefnx {} {[@var{AA}, @var{BB}, @var{Z}, @var{lambda}] =} qz (@var{A}, @var{B}, @var{opt})
-QZ@tie{}decomposition of the generalized eigenvalue problem
+Compute the QZ@tie{}decomposition of a generalized eigenvalue problem.
+
+The generalized eigenvalue problem is defined as
+
 @tex
 $$A x = \lambda B x$$
 @end tex
--- a/libinterp/corefcn/svd.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/svd.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -72,7 +72,10 @@
 @deftypefnx {} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A}, "econ")
 @deftypefnx {} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A}, 0)
 @cindex singular value decomposition
-Compute the singular value decomposition of @var{A}
+Compute the singular value decomposition of @var{A}.
+
+The singular value decomposition is defined by the relation
+
 @tex
 $$
  A = U S V^{\dagger}
--- a/libinterp/corefcn/sylvester.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/sylvester.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -34,7 +34,9 @@
 DEFUN (sylvester, args, ,
        doc: /* -*- texinfo -*-
 @deftypefn {} {@var{X} =} sylvester (@var{A}, @var{B}, @var{C})
-Solve the Sylvester equation
+Solve the Sylvester equation.
+
+The Sylvester equation is defined as:
 @tex
 $$
  A X + X B = C
@@ -47,7 +49,7 @@
 @end example
 
 @end ifnottex
-using standard @sc{lapack} subroutines.
+The solution is computed using standard @sc{lapack} subroutines.
 
 For example:
 
--- a/libinterp/corefcn/utils.cc	Tue Apr 03 13:52:40 2018 -0700
+++ b/libinterp/corefcn/utils.cc	Tue Apr 03 22:21:09 2018 -0700
@@ -1047,10 +1047,17 @@
 @deftypefn  {} {@var{err} =} errno ()
 @deftypefnx {} {@var{err} =} errno (@var{val})
 @deftypefnx {} {@var{err} =} errno (@var{name})
-Return the current value of the system-dependent variable errno,
-set its value to @var{val} and return the previous value, or return
-the named error code given @var{name} as a character string, or -1
-if @var{name} is not found.
+Query or set the system-dependent variable errno.
+
+When called with no inputs, return the current value of errno.
+
+When called with a numeric input @var{val}, set the current value of errno
+to the specified value.  The previous value of errno is returned as @var{err}.
+
+When called with a character string @var{name}, return the numeric value of
+errno which corresponds to the specified error code.  If @var{name} is not
+a recognized error code then -1 is returned.
+
 @seealso{errno_list}
 @end deftypefn */)
 {
--- a/scripts/general/bincoeff.m	Tue Apr 03 13:52:40 2018 -0700
+++ b/scripts/general/bincoeff.m	Tue Apr 03 22:21:09 2018 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {} {} bincoeff (@var{n}, @var{k})
-## Return the binomial coefficient of @var{n} and @var{k}, defined as
+## Return the binomial coefficient of @var{n} and @var{k}.
+##
+## The binomial coefficient is defined as
 ## @tex
 ## $$
 ##  {n \choose k} = {n (n-1) (n-2) \cdots (n-k+1) \over k!}
--- a/scripts/help/bessel.m	Tue Apr 03 13:52:40 2018 -0700
+++ b/scripts/help/bessel.m	Tue Apr 03 22:21:09 2018 -0700
@@ -22,7 +22,10 @@
 ## @deftypefnx {} {[@var{I}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})
 ## @deftypefnx {} {[@var{K}, @var{ierr}] =} besselk (@var{alpha}, @var{x}, @var{opt})
 ## @deftypefnx {} {[@var{H}, @var{ierr}] =} besselh (@var{alpha}, @var{k}, @var{x}, @var{opt})
-## Compute Bessel or Hankel functions of various kinds:
+## Compute Bessel or Hankel functions of various kinds.
+##
+## All functions begin with the prefix @qcode{"bessel"}.  The list of
+## functions is:
 ##
 ## @table @code
 ## @item besselj
--- a/scripts/linear-algebra/krylov.m	Tue Apr 03 13:52:40 2018 -0700
+++ b/scripts/linear-algebra/krylov.m	Tue Apr 03 22:21:09 2018 -0700
@@ -18,14 +18,17 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {} {[@var{u}, @var{h}, @var{nu}] =} krylov (@var{A}, @var{V}, @var{k}, @var{eps1}, @var{pflg})
-## Construct an orthogonal basis @var{u} of block Krylov subspace
+## Construct an orthogonal basis @var{u} of a block Krylov subspace.
+##
+## The block Krylov subspace has the following form:
 ##
 ## @example
 ## [v a*v a^2*v @dots{} a^(k+1)*v]
 ## @end example
 ##
 ## @noindent
-## using Householder reflections to guard against loss of orthogonality.
+## The construction is made with Householder reflections to guard against loss
+## of orthogonality.
 ##
 ## If @var{V} is a vector, then @var{h} contains the Hessenberg matrix
 ## such that @nospell{@tcode{a*u == u*h+rk*ek'}}, in which
--- a/scripts/specfun/expint.m	Tue Apr 03 13:52:40 2018 -0700
+++ b/scripts/specfun/expint.m	Tue Apr 03 22:21:09 2018 -0700
@@ -18,7 +18,9 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {} {} expint (@var{x})
-## Compute the exponential integral:
+## Compute the exponential integral.
+##
+## The exponential integral is defined as:
 ##
 ## @tex
 ## $$
--- a/scripts/statistics/moment.m	Tue Apr 03 13:52:40 2018 -0700
+++ b/scripts/statistics/moment.m	Tue Apr 03 22:21:09 2018 -0700
@@ -22,7 +22,9 @@
 ## @deftypefnx {} {} moment (@var{x}, @var{p}, @var{dim})
 ## @deftypefnx {} {} moment (@var{x}, @var{p}, @var{type}, @var{dim})
 ## @deftypefnx {} {} moment (@var{x}, @var{p}, @var{dim}, @var{type})
-## Compute the @var{p}-th central moment of the vector @var{x}:
+## Compute the @var{p}-th central moment of the vector @var{x}.
+##
+## The @var{p}-th central moment of @var{x} is defined as:
 ##
 ## @tex
 ## $$