changeset 22601:a2ee7fe43834

maint: merge stable to default
author John W. Eaton <jwe@octave.org>
date Thu, 06 Oct 2016 12:29:06 -0400
parents f812283c4367 (current diff) dd80fb1ef949 (diff)
children 66ac9dd3e675
files
diffstat 18 files changed, 121 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h	Thu Oct 06 07:56:59 2016 +0200
+++ b/libgui/src/m-editor/file-editor.h	Thu Oct 06 12:29:06 2016 -0400
@@ -71,7 +71,8 @@
     QString index;
     QString file_name;
     QString encoding;
-    bool operator<(const session_data &other) const
+
+    bool operator < (const session_data &other) const
     {
       return index < other.index;
     }
--- a/libgui/src/main-window.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libgui/src/main-window.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -1014,7 +1014,7 @@
 main_window::handle_update_breakpoint_marker_request (bool insert,
                                                       const QString& file,
                                                       int line,
-						      const QString& cond)
+                                                      const QString& cond)
 {
   bool cmd_focus = command_window_has_focus ();
 
@@ -1446,12 +1446,12 @@
 
       connect (this,
                SIGNAL (update_breakpoint_marker_signal (bool, const QString&,
-	                                                int, const QString&)),
+                                                        int, const QString&)),
                editor_window,
                SLOT (handle_update_breakpoint_marker_request (bool,
                                                               const QString&,
                                                               int,
-							                                                const QString&)));
+                                                                                                        const QString&)));
 #endif
 
       octave_link::post_event (this,
@@ -1595,12 +1595,12 @@
 
       connect (_octave_qt_link,
                SIGNAL (update_breakpoint_marker_signal (bool, const QString&,
-	                                                      int, const QString&)),
+                                                              int, const QString&)),
                this,
                SLOT (handle_update_breakpoint_marker_request (bool,
-	                                                            const QString&,
+                                                                    const QString&,
                                                               int,
-							                                                const QString&)));
+                                                                                                        const QString&)));
 
       connect (_octave_qt_link,
                SIGNAL (show_doc_signal (const QString &)),
--- a/libgui/src/main-window.h	Thu Oct 06 07:56:59 2016 +0200
+++ b/libgui/src/main-window.h	Thu Oct 06 12:29:06 2016 -0400
@@ -168,7 +168,7 @@
   void handle_delete_debugger_pointer_request (const QString& file, int line);
   void handle_update_breakpoint_marker_request (bool insert,
                                                 const QString& file, int line,
-                                    						const QString& cond);
+                                                const QString& cond);
 
   void read_settings (void);
   void init_terminal_size (void);
--- a/libgui/src/octave-dock-widget.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libgui/src/octave-dock-widget.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -211,7 +211,7 @@
 
   // remove parent and adjust the (un)dock icon
   setParent (0, Qt::Window);
-  _dock_action->setIcon (QIcon (":/actions/icons/widget-dock" 
+  _dock_action->setIcon (QIcon (":/actions/icons/widget-dock"
                                 + _icon_color + ".png"));
   _dock_action->setToolTip (tr ("Dock widget"));
 
--- a/libinterp/corefcn/call-stack.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/call-stack.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -65,7 +65,7 @@
 }
 
 bool
-octave_call_stack::stack_frame::operator== (const octave_call_stack::stack_frame &rhs) const
+octave_call_stack::stack_frame::operator == (const octave_call_stack::stack_frame &rhs) const
 {
   if (this->line () != rhs.line ())
     return false;
--- a/libinterp/corefcn/call-stack.h	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/call-stack.h	Thu Oct 06 12:29:06 2016 -0400
@@ -71,7 +71,7 @@
 
     std::string fcn_name (bool print_subfn = true) const;
 
-    bool operator== (const stack_frame &rhs) const;
+    bool operator == (const stack_frame &rhs) const;
 
   private:
 
--- a/libinterp/corefcn/jit-typeinfo.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/jit-typeinfo.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -885,8 +885,8 @@
 }
 
 bool
-jit_operation::signature_cmp
-::operator() (const signature_vec *lhs, const signature_vec *rhs) const
+jit_operation::signature_cmp::operator () (const signature_vec *lhs,
+                                           const signature_vec *rhs) const
 {
   const signature_vec& l = *lhs;
   const signature_vec& r = *rhs;
--- a/libinterp/corefcn/jit-typeinfo.h	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/jit-typeinfo.h	Thu Oct 06 12:29:06 2016 -0400
@@ -372,7 +372,7 @@
 
   struct signature_cmp
   {
-    bool operator() (const signature_vec *lhs, const signature_vec *rhs) const;
+    bool operator () (const signature_vec *lhs, const signature_vec *rhs) const;
   };
 
   typedef std::map<const signature_vec *, jit_function *, signature_cmp>
--- a/libinterp/corefcn/mex.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/mex.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -300,7 +300,7 @@
   {
     request_mutation ();
 
-    return 0; 
+    return 0;
   }
 
   mwSize get_number_of_elements (void) const { return val.numel (); }
@@ -313,7 +313,7 @@
     get_dimensions ();
 
     return ndims == 2 && dims[0] == 1 && dims[1] == 1;
-  }  
+  }
 
   mxClassID get_class_id (void) const
   {
@@ -382,8 +382,8 @@
   {
     if (val.is_sparse_type ())
       {
-        // For sparse arrays, return the first non-zero value. 
-        void * data = val.mex_get_data (); 
+        // For sparse arrays, return the first non-zero value.
+        void * data = val.mex_get_data ();
         if (data == NULL)
           return 0.0;
 
@@ -775,7 +775,7 @@
       {
         dims
           = static_cast<mwSize *> (mxArray::malloc (ndims * sizeof (mwSize)));
-        
+
         if (dims == NULL)
           return 1;
 
--- a/libinterp/corefcn/regexp.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/corefcn/regexp.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -1124,7 +1124,7 @@
 %!assert (regexp ("\n", "\n"), 1)
 
 # Test escape sequences are silently converted
-%!test <45407> 
+%!test <45407>
 %! assert (regexprep ('s', 's', 'x\.y'), 'x.y');
 %! assert (regexprep ('s', '(s)', 'x\$1y'), 'x$1y');
 %! assert (regexprep ('s', '(s)', 'x\\$1y'), 'x\sy');
--- a/libinterp/octave-value/ov-classdef.h	Thu Oct 06 07:56:59 2016 +0200
+++ b/libinterp/octave-value/ov-classdef.h	Thu Oct 06 12:29:06 2016 -0400
@@ -784,7 +784,7 @@
 
   cdef_class& operator = (const cdef_class& cls)
   {
-    cdef_object::operator= (cls);
+    cdef_object::operator = (cls);
 
     return *this;
   }
@@ -983,7 +983,7 @@
 
   cdef_property& operator = (const cdef_property& prop)
   {
-    cdef_object::operator= (prop);
+    cdef_object::operator = (prop);
 
     return *this;
   }
@@ -1116,7 +1116,7 @@
 
   cdef_method& operator = (const cdef_method& meth)
   {
-    cdef_object::operator= (meth);
+    cdef_object::operator = (meth);
 
     return *this;
   }
@@ -1351,7 +1351,7 @@
 
   cdef_package& operator = (const cdef_package& pack)
   {
-    cdef_object::operator= (pack);
+    cdef_object::operator = (pack);
 
     return *this;
   }
--- a/liboctave/array/CMatrix.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/liboctave/array/CMatrix.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -2364,7 +2364,7 @@
     (*current_liboctave_error_handler)
       ("matrix dimension mismatch solution of linear equations");
 
-  if (m== 0 || n == 0 || b.cols () == 0)
+  if (m == 0 || n == 0 || b.cols () == 0)
     retval = ComplexMatrix (n, b.cols (), Complex (0.0, 0.0));
   else
     {
@@ -2415,6 +2415,7 @@
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
       double tmp = octave::math::log2 (dminmn / dsmlsizp1);
+      double anorm = 0.0;
 
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
@@ -2473,18 +2474,29 @@
       lwork = static_cast<octave_idx_type> (octave::math::real (work(0)));
       work.resize (dim_vector (lwork, 1));
 
-      F77_XFCN (zgelsd, ZGELSD, (m, n, nrhs, F77_DBLE_CMPLX_ARG (tmp_data), m,
-                                 F77_DBLE_CMPLX_ARG (pretval),
-                                 maxmn, ps, rcon, rank,
-                                 F77_DBLE_CMPLX_ARG (work.fortran_vec ()), lwork,
-                                 prwork, piwork, info));
-
-      if (s.elem (0) == 0.0)
-        rcon = 0.0;
+      anorm = xnorm (*this, 1);
+
+      if (octave::math::isinf (anorm) || octave::math::isnan (anorm))
+        {
+          rcon = 0.0;
+          octave::warn_singular_matrix ();
+          retval = Matrix (n, m, 0.0);
+        }
       else
-        rcon = s.elem (minmn - 1) / s.elem (0);
-
-      retval.resize (n, nrhs);
+        {
+          F77_XFCN (zgelsd, ZGELSD, (m, n, nrhs, F77_DBLE_CMPLX_ARG (tmp_data),
+                                     m, F77_DBLE_CMPLX_ARG (pretval),
+                                     maxmn, ps, rcon, rank,
+                                     F77_DBLE_CMPLX_ARG (work.fortran_vec ()),
+                                     lwork, prwork, piwork, info));
+
+          if (s.elem (0) == 0.0)
+            rcon = 0.0;
+          else
+            rcon = s.elem (minmn - 1) / s.elem (0);
+
+          retval.resize (n, nrhs);
+        }
     }
 
   return retval;
--- a/liboctave/array/Sparse.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/liboctave/array/Sparse.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -2201,7 +2201,8 @@
       else
         assign (idx_i, idx_j, Sparse<T> (n, m));
     }
-  else if (idx_i.length (nr) == m && idx_j.length (nc) == n && (n==1 || m==1))
+  else if (idx_i.length (nr) == m && idx_j.length (nc) == n
+           && (n == 1 || m == 1))
     {
       assign (idx_i, idx_j, rhs.transpose ());
     }
--- a/liboctave/array/dMatrix.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/liboctave/array/dMatrix.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -2076,6 +2076,7 @@
       double dminmn = static_cast<double> (minmn);
       double dsmlsizp1 = static_cast<double> (smlsiz+1);
       double tmp = octave::math::log2 (dminmn / dsmlsizp1);
+      double anorm = 0.0;
 
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
@@ -2131,17 +2132,28 @@
       lwork = static_cast<octave_idx_type> (work(0));
       work.resize (dim_vector (lwork, 1));
 
-      F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval,
-                                 maxmn, ps, rcon, rank,
-                                 work.fortran_vec (), lwork,
-                                 piwork, info));
-
-      if (s.elem (0) == 0.0)
-        rcon = 0.0;
+      anorm = xnorm (*this, 1);
+
+      if (octave::math::isinf (anorm) || octave::math::isnan (anorm))
+        {
+          rcon = 0.0;
+          octave::warn_singular_matrix ();
+          retval = Matrix (n, m, 0.0);
+        }
       else
-        rcon = s.elem (minmn - 1) / s.elem (0);
-
-      retval.resize (n, nrhs);
+        {
+          F77_XFCN (dgelsd, DGELSD, (m, n, nrhs, tmp_data, m, pretval,
+                                     maxmn, ps, rcon, rank,
+                                     work.fortran_vec (), lwork,
+                                     piwork, info));
+
+          if (s.elem (0) == 0.0)
+            rcon = 0.0;
+          else
+            rcon = s.elem (minmn - 1) / s.elem (0);
+
+          retval.resize (n, nrhs);
+        }
     }
 
   return retval;
--- a/liboctave/array/fCMatrix.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/liboctave/array/fCMatrix.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -2381,7 +2381,7 @@
     (*current_liboctave_error_handler)
       ("matrix dimension mismatch solution of linear equations");
 
-  if (m== 0 || n == 0 || b.cols () == 0)
+  if (m == 0 || n == 0 || b.cols () == 0)
     retval = FloatComplexMatrix (n, b.cols (), FloatComplex (0.0, 0.0));
   else
     {
@@ -2432,6 +2432,7 @@
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
       float tmp = octave::math::log2 (dminmn / dsmlsizp1);
+      float anorm = 0.0;
 
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
@@ -2490,18 +2491,29 @@
       lwork = static_cast<octave_idx_type> (octave::math::real (work(0)));
       work.resize (dim_vector (lwork, 1));
 
-      F77_XFCN (cgelsd, CGELSD, (m, n, nrhs, F77_CMPLX_ARG (tmp_data), m,
-                                 F77_CMPLX_ARG (pretval),
-                                 maxmn, ps, rcon, rank,
-                                 F77_CMPLX_ARG (work.fortran_vec ()), lwork,
-                                 prwork, piwork, info));
-
-      if (s.elem (0) == 0.0)
-        rcon = 0.0;
+      anorm = xnorm (*this, 1);
+
+      if (octave::math::isinf (anorm) || octave::math::isnan (anorm))
+        {
+          rcon = 0.0;
+          octave::warn_singular_matrix ();
+          retval = Matrix (n, m, 0.0);
+        }
       else
-        rcon = s.elem (minmn - 1) / s.elem (0);
-
-      retval.resize (n, nrhs);
+        {
+          F77_XFCN (cgelsd, CGELSD, (m, n, nrhs, F77_CMPLX_ARG (tmp_data),
+                                     m, F77_CMPLX_ARG (pretval),
+                                     maxmn, ps, rcon, rank,
+                                     F77_CMPLX_ARG (work.fortran_vec ()),
+                                     lwork, prwork, piwork, info));
+
+          if (s.elem (0) == 0.0)
+            rcon = 0.0;
+          else
+            rcon = s.elem (minmn - 1) / s.elem (0);
+
+          retval.resize (n, nrhs);
+        }
     }
 
   return retval;
--- a/liboctave/array/fMatrix.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/liboctave/array/fMatrix.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -2103,6 +2103,7 @@
       float dminmn = static_cast<float> (minmn);
       float dsmlsizp1 = static_cast<float> (smlsiz+1);
       float tmp = octave::math::log2 (dminmn / dsmlsizp1);
+      float anorm = 0.0;
 
       octave_idx_type nlvl = static_cast<octave_idx_type> (tmp) + 1;
       if (nlvl < 0)
@@ -2158,17 +2159,28 @@
       lwork = static_cast<octave_idx_type> (work(0));
       work.resize (dim_vector (lwork, 1));
 
-      F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval,
-                                 maxmn, ps, rcon, rank,
-                                 work.fortran_vec (), lwork,
-                                 piwork, info));
-
-      if (s.elem (0) == 0.0)
-        rcon = 0.0;
+      anorm = xnorm (*this, 1);
+
+      if (octave::math::isinf (anorm) || octave::math::isnan (anorm))
+        {
+          rcon = 0.0;
+          octave::warn_singular_matrix ();
+          retval = Matrix (n, m, 0.0);
+        }
       else
-        rcon = s.elem (minmn - 1) / s.elem (0);
-
-      retval.resize (n, nrhs);
+        {
+          F77_XFCN (sgelsd, SGELSD, (m, n, nrhs, tmp_data, m, pretval,
+                                     maxmn, ps, rcon, rank,
+                                     work.fortran_vec (), lwork,
+                                     piwork, info));
+
+          if (s.elem (0) == 0.0)
+            rcon = 0.0;
+          else
+            rcon = s.elem (minmn - 1) / s.elem (0);
+
+          retval.resize (n, nrhs);
+        }
     }
 
   return retval;
--- a/src/mkoctfile.in.cc	Thu Oct 06 07:56:59 2016 +0200
+++ b/src/mkoctfile.in.cc	Thu Oct 06 12:29:06 2016 -0400
@@ -602,7 +602,7 @@
     }
 
   if (output_ext ==  ".mex"
-      && vars["ALL_CFLAGS"].find ("-g") != std::string::npos) 
+      && vars["ALL_CFLAGS"].find ("-g") != std::string::npos)
     {
       defs += " -DMEX_DEBUG";
     }
--- a/test/bug-46330.tst	Thu Oct 06 07:56:59 2016 +0200
+++ b/test/bug-46330.tst	Thu Oct 06 12:29:06 2016 -0400
@@ -17,9 +17,4 @@
 %! ## This statement caused an error in LAPACK and eventually caused
 %! ## a segmentation fault.
 %! ## Triggers "warning: matrix singular to machine precision"
-%! ## FIXME: LAPACK errors become fatal crashes on Windows, don't test this
-%! if (ispc ())
-%!   warning ("unable to test for bug #46330 on Windows");
-%! else
-%!   assert (c / (i * Inf * eye (4) - a) * b, zeros (2, 2))
-%! endif
+%! assert (c / (i * Inf * eye (4) - a) * b, zeros (2, 2))