changeset 18882:b314efd58072 gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Thu, 19 Jun 2014 15:51:05 -0400
parents e7b5be5a7f80 (current diff) ff4da3c8ed16 (diff)
children 479d1d3cb5c3 0a66861d8069
files doc/interpreter/plot.txi libgui/src/files-dock-widget.cc libinterp/corefcn/graphics.in.h liboctave/array/CMatrix.cc liboctave/array/dMatrix.cc liboctave/array/fCMatrix.cc liboctave/array/fMatrix.cc
diffstat 16 files changed, 97 insertions(+), 131 deletions(-) [+]
line wrap: on
line diff
--- a/bootstrap.conf	Tue Jun 17 20:53:18 2014 +0200
+++ b/bootstrap.conf	Thu Jun 19 15:51:05 2014 -0400
@@ -50,6 +50,10 @@
   isatty
   largefile
   link
+  log2
+  log2-ieee
+  log2f
+  log2f-ieee
   lstat
   malloc-gnu
   mbrtowc
--- a/doc/interpreter/expr.txi	Tue Jun 17 20:53:18 2014 +0200
+++ b/doc/interpreter/expr.txi	Thu Jun 19 15:51:05 2014 -0400
@@ -1237,8 +1237,19 @@
 @end example
 
 @noindent
-where @var{op} can be either @code{+}, @code{-}, @code{*}, or @code{/}.
-So, the expression
+where @var{op} can be either @code{+}, @code{-}, @code{*}, or @code{/},
+as long as @var{expr2} is a simple expression with no side effects.  If
+@var{expr2} also contains an assignment operator, then this expression
+is evaluated as
+
+@example
+@var{temp} = @var{expr2}
+@var{expr1} = (@var{expr1}) @var{op} @var{temp}
+@end example
+
+@noindent
+where @var{temp} is a placeholder temporary value storing the computed
+result of evaluating @var{expr2}.  So, the expression
 
 @example
 a *= b+1
--- a/doc/interpreter/plot.txi	Tue Jun 17 20:53:18 2014 +0200
+++ b/doc/interpreter/plot.txi	Thu Jun 19 15:51:05 2014 -0400
@@ -593,21 +593,21 @@
 @node Use of the @code{interpreter} Property
 @subsection Use of the @code{interpreter} Property
 
-All text objects, including titles, labels, legends, and text, include
-the property @qcode{"interpreter"}, this property determines the manner in which
-special control sequences in the text are rendered.  If the interpreter
-is set to @qcode{"none"}, then no rendering occurs.  At this point the
-@qcode{"latex"} option is not implemented and so the @qcode{"latex"}
-interpreter also does not interpret the text.
-
-The @qcode{"tex"} option implements a subset of @TeX{} functionality in the
-rendering of the text.  This allows the insertion of special characters
-such as Greek or mathematical symbols within the text.  The special
-characters are also inserted with a code starting with the backslash
-(\) character, as in the table @ref{tab:extended}.
+All text objects---such as titles, labels, legends, and text---include
+the property @qcode{"interpreter"}, this property determines the manner in
+which special control sequences in the text are rendered.  If the interpreter
+is set to @qcode{"none"}, then no rendering occurs.  Currently the
+@qcode{"latex"} interpreter is not implemented and is equivalent to
+@qcode{"none"}.
+
+The @qcode{"tex"} option implements a subset of @TeX{} functionality when
+rendering text.  This allows the insertion of special glyphs such as Greek
+characters or mathematical symbols.  The special characters are inserted with
+a code following a backslash (\) character, as in the table
+@ref{tab:extended}.
 
 In addition, the formatting of the text can be changed within the string
-with the codes
+by using the codes
 
 @multitable @columnfractions .2 .2 .6 .2
 @item @tab \bf @tab Bold font @tab
@@ -616,7 +616,7 @@
 @item @tab \rm @tab Normal font @tab
 @end multitable
 
-These are be used in conjunction with the @{ and @} characters to limit
+These may be used in conjunction with the @{ and @} characters to limit
 the change in the font to part of the string.  For example,
 
 @example
@@ -636,7 +636,7 @@
 use @tab
 @end multitable
 
-Finally, the superscript and subscripting can be controlled with the @qcode{'^'}
+Finally, superscripting and subscripting can be controlled with the @qcode{'^'}
 and @qcode{'_'} characters.  If the @qcode{'^'} or @qcode{'_'} is followed by a
 @{ character, then all of the block surrounded by the @{ @} pair is super- or
 sub-scripted.  Without the @{ @} pair, only the character immediately following
--- a/libgui/qterminal-module.mk	Tue Jun 17 20:53:18 2014 +0200
+++ b/libgui/qterminal-module.mk	Thu Jun 19 15:51:05 2014 -0400
@@ -10,6 +10,7 @@
   qterminal/libqterminal/unix/CharacterColor.h \
   qterminal/libqterminal/unix/Emulation.h \
   qterminal/libqterminal/unix/ExtendedDefaultTranslator.h \
+  qterminal/libqterminal/unix/ExtendedDefaultTranslatorMac.h \
   qterminal/libqterminal/unix/Filter.h \
   qterminal/libqterminal/unix/History.h \
   qterminal/libqterminal/unix/KeyboardTranslator.h \
--- a/libgui/src/files-dock-widget.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/libgui/src/files-dock-widget.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -828,7 +828,7 @@
   QString dir = QFileDialog::getExistingDirectory
                   (this, tr ("Set directory of file browser"),
                    _file_system_model->rootPath (),
-                   QFileDialog::DontUseNativeDialog);
+                   QFileDialog::ShowDirsOnly | QFileDialog::DontUseNativeDialog);
   set_current_directory (dir);
 }
 
--- a/libinterp/corefcn/graphics.in.h	Tue Jun 17 20:53:18 2014 +0200
+++ b/libinterp/corefcn/graphics.in.h	Thu Jun 19 15:51:05 2014 -0400
@@ -3729,7 +3729,7 @@
       array_property plotboxaspectratio mu , Matrix (1, 3, 1.0)
       radio_property plotboxaspectratiomode u , "{auto}|manual"
       array_property position u , default_axes_position ()
-      radio_property projection , "{orthographic}|perpective"
+      radio_property projection , "{orthographic}|perspective"
       radio_property tickdir mu , "{in}|out"
       radio_property tickdirmode u , "{auto}|manual"
       array_property ticklength u , default_axes_ticklength ()
--- a/libinterp/corefcn/ls-mat5.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/libinterp/corefcn/ls-mat5.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -666,7 +666,15 @@
         }
 
       int ndims = dim_len / 4;
-      dims.resize (ndims);
+      if (ndims == 1)
+        {
+          // R and Python can create a 1-D object which is really an Nx1 object
+          dims.resize (2);
+          dims(1) = 1;
+        }
+      else
+        dims.resize (ndims);
+
       for (int i = 0; i < ndims; i++)
         {
           int32_t n;
--- a/libinterp/corefcn/xnorm.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/libinterp/corefcn/xnorm.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -48,7 +48,9 @@
 
   if (isfloat || x.is_double_type ())
     {
-      if (isvector)
+      if (x.is_empty ())
+        retval = octave_value (0);
+      else if (isvector)
         {
           if (isfloat & iscomplex)
             retval = xnorm (x.float_complex_column_vector_value (),
--- a/libinterp/dldfcn/chol.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/libinterp/dldfcn/chol.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -212,7 +212,7 @@
 
                   if (nargout > 1 || info == 0)
                     {
-                      retval(1) = fact.P ();
+                      retval(1) = info;
                       if (LLt)
                         retval(0) = fact.L ();
                       else
@@ -240,7 +240,7 @@
 
                   if (nargout > 1 || info == 0)
                     {
-                      retval(1) = fact.P ();
+                      retval(1) = info;
                       if (LLt)
                         retval(0) = fact.L ();
                       else
@@ -375,6 +375,11 @@
 /*
 %!assert (chol ([2, 1; 1, 1]), [sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)], sqrt (eps))
 %!assert (chol (single ([2, 1; 1, 1])), single ([sqrt(2), 1/sqrt(2); 0, 1/sqrt(2)]), sqrt (eps ("single")))
+%!test   
+%! ## Bug #42587
+%! A = sparse ([1 0 8;0 1 8;8 8 1]);
+%! [Q, p] = chol (A);
+%! assert (p != 0);
 
 %!error chol ()
 %!error <matrix must be positive definite> chol ([1, 2; 3, 4])
--- a/liboctave/array/CMatrix.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/liboctave/array/CMatrix.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -2683,11 +2683,8 @@
       // call.
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      double tmp = log2 (dminmn / dsmlsizp1);
-#else
-      double tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      double tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
@@ -2875,11 +2872,8 @@
       // call.
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      double tmp = log2 (dminmn / dsmlsizp1);
-#else
-      double tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      double tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
--- a/liboctave/array/dMatrix.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/liboctave/array/dMatrix.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -2324,11 +2324,8 @@
       // of LAPACK does not return it on a query call.
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      double tmp = log2 (dminmn / dsmlsizp1);
-#else
-      double tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      double tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
@@ -2515,11 +2512,8 @@
       // of LAPACK does not return it on a query call.
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      double tmp = log2 (dminmn / dsmlsizp1);
-#else
-      double tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      double tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
--- a/liboctave/array/fCMatrix.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/liboctave/array/fCMatrix.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -2699,11 +2699,8 @@
       // call.
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      float tmp = log2 (dminmn / dsmlsizp1);
-#else
-      float tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      float tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
@@ -2894,11 +2891,8 @@
       // call.
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      float tmp = log2 (dminmn / dsmlsizp1);
-#else
-      float tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      float tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
--- a/liboctave/array/fMatrix.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/liboctave/array/fMatrix.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -2344,11 +2344,8 @@
       // of LAPACK does not return it on a query call.
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      float tmp = log2 (dminmn / dsmlsizp1);
-#else
-      float tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      float tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
@@ -2535,11 +2532,8 @@
       // of LAPACK does not return it on a query call.
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
-#if defined (HAVE_LOG2)
-      float tmp = log2 (dminmn / dsmlsizp1);
-#else
-      float tmp = log (dminmn / dsmlsizp1) / log (2.0);
-#endif
+      float tmp = xlog2 (dminmn / dsmlsizp1);
+
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
         nlvl = 0;
--- a/liboctave/numeric/lo-mappers.cc	Tue Jun 17 20:53:18 2014 +0200
+++ b/liboctave/numeric/lo-mappers.cc	Thu Jun 19 15:51:05 2014 -0400
@@ -92,17 +92,7 @@
 double
 xlog2 (double x)
 {
-#if defined (HAVE_LOG2)
-  return log2 (x);
-#else
-#if defined (M_LN2)
-  static double ln2 = M_LN2;
-#else
-  static double ln2 = log (2);
-#endif
-
-  return log (x) / ln2;
-#endif
+  return gnulib::log2 (x);
 }
 
 Complex
@@ -317,19 +307,7 @@
 float
 xlog2 (float x)
 {
-#if defined (HAVE_LOG2F)
-  return log2f (x);
-#elif defined (HAVE_LOG2)
-  return log2 (x);
-#else
-#if defined (M_LN2)
-  static float ln2 = M_LN2;
-#else
-  static float ln2 = log2 (2);
-#endif
-
-  return log (x) / ln2;
-#endif
+  return gnulib::log2f (x);
 }
 
 FloatComplex
--- a/scripts/plot/util/private/__gnuplot_ginput__.m	Tue Jun 17 20:53:18 2014 +0200
+++ b/scripts/plot/util/private/__gnuplot_ginput__.m	Thu Jun 19 15:51:05 2014 -0400
@@ -101,7 +101,7 @@
         fputs (ostream, "set print \"-\";\n");
         fflush (ostream);
         fputs (ostream, "pause mouse any;\n\n");
-        fputs (ostream, "\nif (exists(\"MOUSE_KEY\") && exists(\"MOUSE_X\")) print \"OCTAVE: \", MOUSE_X, MOUSE_Y, MOUSE_KEY; else print \"0 0 -1\"\n");
+        fputs (ostream, "\nif (exists(\"MOUSE_KEY\") && exists(\"MOUSE_X\")) key = (MOUSE_KEY==1063 ? 1 : MOUSE_KEY); print \"OCTAVE: \", MOUSE_X, MOUSE_Y, key; else print \"0 0 -1\"\n");
 
         ## Close output file, to force it to be flushed
         fputs (ostream, "set print;\n");
--- a/scripts/plot/util/private/__go_draw_axes__.m	Tue Jun 17 20:53:18 2014 +0200
+++ b/scripts/plot/util/private/__go_draw_axes__.m	Thu Jun 19 15:51:05 2014 -0400
@@ -2115,6 +2115,11 @@
                     plot_stream, mirror, mono, axispos, tickdir, ticklength,
                     fontname, fontspec, interpreter, scale, sgn, gnuplot_term)
   persistent warned_latex = false;
+  if (mirror)
+    mirror = "mirror";
+  else
+    mirror = "nomirror";
+  endif
   if (strcmpi (interpreter, "tex"))
     for n = 1 : numel (labels)
       labels{n} = __tex2enhanced__ (labels{n}, fontname, false, false);
@@ -2143,7 +2148,16 @@
   if (strcmpi (ticmode, "manual") || strcmpi (labelmode, "manual"))
     if (isempty (tics))
       fprintf (plot_stream, "unset %stics;\nunset m%stics;\n", ax, ax);
-    elseif (strcmpi (labelmode, "manual"))
+      return
+    endif
+    if (strcmpi (ticmode, "manual"))
+      fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt);
+      fprintf (plot_stream, "set %stics %s %s %s %s (", ax, tickdir,
+               ticklength, axispos, mirror);
+      fprintf (plot_stream, " %.15g,", tics(1:end-1));
+      fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec);
+    endif
+    if (strcmpi (labelmode, "manual"))
       if (ischar (labels))
         labels = cellstr (labels);
       endif
@@ -2157,15 +2171,8 @@
         k = 1;
         ntics = numel (tics);
         nlabels = numel (labels);
-        fprintf (plot_stream, "set format %s \"%%g\";\n", ax);
-        if (mirror)
-          fprintf (plot_stream, "set %stics %s %s %s mirror (", ax,
-                   tickdir, ticklength, axispos);
-        else
-          fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax,
-                   tickdir, ticklength, axispos);
-        endif
-
+        fprintf (plot_stream, "set %stics add %s %s %s %s (", ax,
+                 tickdir, ticklength, axispos, mirror);
         labels = strrep (labels, "%", "%%");
         for i = 1:ntics
           fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i));
@@ -2177,45 +2184,19 @@
           endif
         endfor
         fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec);
-        if (strcmp (mtics, "on"))
-          fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics);
-        else
-          fprintf (plot_stream, "unset m%stics;\n", ax);
-        endif
       else
         error ("__go_draw_axes__: unsupported type of ticklabel");
       endif
-    else
-      fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt);
-      if (mirror)
-        fprintf (plot_stream, "set %stics %s %s %s mirror (", ax, tickdir,
-                 ticklength, axispos);
-      else
-        fprintf (plot_stream, "set %stics %s %s %s nomirror (", ax, tickdir,
-                 ticklength, axispos);
-      endif
-      fprintf (plot_stream, " %.15g,", tics(1:end-1));
-      fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec);
-      if (strcmp (mtics, "on"))
-        fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics);
-      else
-        fprintf (plot_stream, "unset m%stics;\n", ax);
-      endif
     endif
   else
     fprintf (plot_stream, "set format %s \"%s\";\n", ax, fmt);
-    if (mirror)
-      fprintf (plot_stream, "set %stics %s %s %s mirror %s %s;\n", ax,
-               axispos, tickdir, ticklength, colorspec, fontspec);
-    else
-      fprintf (plot_stream, "set %stics %s %s %s nomirror %s %s;\n", ax,
-               tickdir, ticklength, axispos, colorspec, fontspec);
-    endif
-    if (strcmp (mtics, "on"))
-      fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics);
-    else
-      fprintf (plot_stream, "unset m%stics;\n", ax);
-    endif
+    fprintf (plot_stream, "set %stics %s %s %s %s %s %s;\n", ax,
+             tickdir, ticklength, axispos, mirror, colorspec, fontspec);
+  endif
+  if (strcmp (mtics, "on"))
+    fprintf (plot_stream, "set m%stics %d;\n", ax, num_mtics);
+  else
+    fprintf (plot_stream, "unset m%stics;\n", ax);
   endif
 endfunction