changeset 23475:d691ed308237

maint: Clean up #includes in liboctave/numeric directory. * build-aux/mk-opts.pl: Change Perl to generate "" around local include libraries rather than <>. Include "lo-math.h" rather than <cmath>. * CollocWt.cc, DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h, DASSL.cc, DASSL.h, DET.h, EIG.cc, EIG.h, LSODE.cc, LSODE.h, ODE.h, ODES.cc, ODESFunc.h, Quad.cc, aepbalance.cc, base-de.h, base-min.h, bsxfun-decl.h, bsxfun-defs.cc, bsxfun.h, chol.cc, eigs-base.cc, fEIG.cc, fEIG.h, gepbalance.cc, gsvd.cc, hess.cc, lo-blas-proto.h, lo-lapack-proto.h, lo-mappers.cc, lo-mappers.h, lo-qrupdate-proto.h, lo-slatec-proto.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, randgamma.cc, randpoisson.cc, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-dmsolve.cc, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc: Rationalize #includes. Use forward declarations of just classes where possible. Reformat some long lines < 80 characters. Reformat some comments for readabliity. * mx-inlines.cc: Rationalize #includes for this file in liboctave/operators used by many in liboctave/numeric.
author Rik <rik@octave.org>
date Tue, 09 May 2017 08:46:07 -0700
parents 70edb5512c6e
children 1a4b4c074800
files build-aux/mk-opts.pl liboctave/numeric/CollocWt.cc liboctave/numeric/DAERTFunc.h liboctave/numeric/DASPK.cc liboctave/numeric/DASPK.h liboctave/numeric/DASRT.cc liboctave/numeric/DASRT.h liboctave/numeric/DASSL.cc liboctave/numeric/DASSL.h liboctave/numeric/DET.h liboctave/numeric/EIG.cc liboctave/numeric/EIG.h liboctave/numeric/LSODE.cc liboctave/numeric/LSODE.h liboctave/numeric/ODE.h liboctave/numeric/ODES.cc liboctave/numeric/ODESFunc.h liboctave/numeric/Quad.cc liboctave/numeric/aepbalance.cc liboctave/numeric/base-de.h liboctave/numeric/base-min.h liboctave/numeric/bsxfun-decl.h liboctave/numeric/bsxfun-defs.cc liboctave/numeric/bsxfun.h liboctave/numeric/chol.cc liboctave/numeric/eigs-base.cc liboctave/numeric/fEIG.cc liboctave/numeric/fEIG.h liboctave/numeric/gepbalance.cc liboctave/numeric/gsvd.cc liboctave/numeric/hess.cc liboctave/numeric/lo-blas-proto.h liboctave/numeric/lo-lapack-proto.h liboctave/numeric/lo-mappers.cc liboctave/numeric/lo-mappers.h liboctave/numeric/lo-qrupdate-proto.h liboctave/numeric/lo-slatec-proto.h liboctave/numeric/lo-specfun.cc liboctave/numeric/lo-specfun.h liboctave/numeric/lu.cc liboctave/numeric/lu.h liboctave/numeric/oct-convn.cc liboctave/numeric/oct-convn.h liboctave/numeric/oct-fftw.cc liboctave/numeric/oct-fftw.h liboctave/numeric/oct-norm.cc liboctave/numeric/oct-rand.cc liboctave/numeric/oct-rand.h liboctave/numeric/oct-spparms.cc liboctave/numeric/oct-spparms.h liboctave/numeric/qr.cc liboctave/numeric/qr.h liboctave/numeric/qrp.cc liboctave/numeric/randgamma.cc liboctave/numeric/randpoisson.cc liboctave/numeric/schur.cc liboctave/numeric/schur.h liboctave/numeric/sparse-chol.cc liboctave/numeric/sparse-chol.h liboctave/numeric/sparse-dmsolve.cc liboctave/numeric/sparse-lu.cc liboctave/numeric/sparse-lu.h liboctave/numeric/sparse-qr.cc liboctave/numeric/sparse-qr.h liboctave/numeric/svd.cc liboctave/operators/mx-inlines.cc
diffstat 66 files changed, 458 insertions(+), 317 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/mk-opts.pl	Mon May 08 20:58:14 2017 -0700
+++ b/build-aux/mk-opts.pl	Tue May 09 08:46:07 2017 -0700
@@ -110,7 +110,7 @@
         }
       elsif (/^\s*INCLUDE\s*=\s*"(\S+)"\s*$/)
         {
-          $INCLUDE .= "#include <$1>\n";
+          $INCLUDE .= qq (#include "$1"\n);
         }
       elsif (/^\s*DOC_STRING\s*$/)
         {
@@ -374,10 +374,9 @@
 #if ! defined (octave_${CLASS_NAME}_h)
 #define octave_${CLASS_NAME}_h 1
 
-#include <cmath>
-
 #include <limits>
 
+#include "lo-math.h"
 $INCLUDE
 
 class
--- a/liboctave/numeric/CollocWt.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/CollocWt.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,12 +24,16 @@
 #  include "config.h"
 #endif
 
+#include <cassert>
+#include <cmath>
+
 #include <iostream>
 #include <limits>
 
+#include "Array.h"
 #include "CollocWt.h"
-#include "f77-fcn.h"
 #include "lo-error.h"
+#include "lo-mappers.h"
 
 // The following routines jcobi, dif, and dfopr are based on the code
 // found in Villadsen, J. and M. L. Michelsen, Solution of Differential
--- a/liboctave/numeric/DAERTFunc.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DAERTFunc.h	Tue May 09 08:46:07 2017 -0700
@@ -26,7 +26,6 @@
 #include "octave-config.h"
 
 #include "DAEFunc.h"
-#include "dMatrix.h"
 
 class
 DAERTFunc : public DAEFunc
--- a/liboctave/numeric/DASPK.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASPK.cc	Tue May 09 08:46:07 2017 -0700
@@ -27,9 +27,9 @@
 #include <sstream>
 
 #include "DASPK.h"
+#include "dMatrix.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
-#include "lo-math.h"
 #include "quit.h"
 
 typedef F77_INT (*daspk_fcn_ptr) (const double&, const double*, const double*,
@@ -148,8 +148,7 @@
 ColumnVector
 DASPK::do_integrate (double tout)
 {
-  // FIXME: should handle all this option stuff just once
-  // for each new problem.
+  // FIXME: should handle all this option stuff just once for each new problem.
 
   ColumnVector retval;
 
@@ -248,7 +247,6 @@
         }
       else
         {
-
           // FIXME: Should this be a warning?
           (*current_liboctave_error_handler)
             ("daspk: inconsistent sizes for tolerance arrays");
--- a/liboctave/numeric/DASPK.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASPK.h	Tue May 09 08:46:07 2017 -0700
@@ -27,8 +27,11 @@
 
 #include <string>
 
+#include "Array.h"
 #include "DASPK-opts.h"
 
+class Matrix;
+
 class
 OCTAVE_API
 DASPK : public DAE, public DASPK_options
--- a/liboctave/numeric/DASRT.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASRT.cc	Tue May 09 08:46:07 2017 -0700
@@ -29,7 +29,6 @@
 #include "DASRT.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
-#include "lo-math.h"
 #include "quit.h"
 
 typedef F77_INT (*dasrt_fcn_ptr) (const double&, const double*, const double*,
--- a/liboctave/numeric/DASRT.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASRT.h	Tue May 09 08:46:07 2017 -0700
@@ -27,7 +27,9 @@
 
 #include <string>
 
+#include "Array.h"
 #include "DASRT-opts.h"
+#include "dMatrix.h"
 
 class
 DASRT_result
--- a/liboctave/numeric/DASSL.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASSL.cc	Tue May 09 08:46:07 2017 -0700
@@ -27,9 +27,9 @@
 #include <sstream>
 
 #include "DASSL.h"
+#include "dMatrix.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
-#include "lo-math.h"
 #include "quit.h"
 
 typedef F77_INT (*dassl_fcn_ptr) (const double&, const double*,
--- a/liboctave/numeric/DASSL.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DASSL.h	Tue May 09 08:46:07 2017 -0700
@@ -27,8 +27,11 @@
 
 #include <string>
 
+#include "Array.h"
 #include "DASSL-opts.h"
 
+class Matrix;
+
 class
 OCTAVE_API
 DASSL : public DAE, public DASSL_options
--- a/liboctave/numeric/DET.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/DET.h	Tue May 09 08:46:07 2017 -0700
@@ -25,9 +25,9 @@
 
 #include "octave-config.h"
 
-#include <cmath>
+#include "lo-mappers.h"
+#include "lo-math.h"
 #include "oct-cmplx.h"
-#include "lo-mappers.h"
 
 template <typename T>
 class
--- a/liboctave/numeric/EIG.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/EIG.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,8 +25,10 @@
 #  include "config.h"
 #endif
 
+#include "Array.h"
 #include "EIG.h"
 #include "dColVector.h"
+#include "dMatrix.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
 
@@ -280,10 +282,11 @@
                              F77_CONST_CHAR_ARG2 (calc_rev ? "V" : "N", 1),
                              F77_CONST_CHAR_ARG2 ("N", 1),
                              n, F77_DBLE_CMPLX_ARG (tmp_data), n,
-                             F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), n,
-                             F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, pscale, abnrm,
-                             prconde, prcondv,
-                             F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, info
+                             F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl),
+                             n, F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi,
+                             pscale, abnrm, prconde, prcondv,
+                             F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork,
+                             info
                              F77_CHAR_ARG_LEN (1)
                              F77_CHAR_ARG_LEN (1)
                              F77_CHAR_ARG_LEN (1)
@@ -301,9 +304,9 @@
                              F77_CONST_CHAR_ARG2 (calc_rev ? "V" : "N", 1),
                              F77_CONST_CHAR_ARG2 ("N", 1),
                              n, F77_DBLE_CMPLX_ARG (tmp_data), n,
-                             F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), n,
-                             F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, pscale, abnrm,
-                             prconde, prcondv,
+                             F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl),
+                             n, F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi,
+                             pscale, abnrm, prconde, prcondv,
                              F77_DBLE_CMPLX_ARG (pwork), lwork, prwork, info
                              F77_CHAR_ARG_LEN (1)
                              F77_CHAR_ARG_LEN (1)
@@ -660,7 +663,8 @@
                            F77_DBLE_CMPLX_ARG (pbeta),
                            F77_DBLE_CMPLX_ARG (pvl), n,
                            F77_DBLE_CMPLX_ARG (pvr), n,
-                           F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, info
+                           F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork,
+                           info
                            F77_CHAR_ARG_LEN (1)
                            F77_CHAR_ARG_LEN (1)));
 
--- a/liboctave/numeric/EIG.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/EIG.h	Tue May 09 08:46:07 2017 -0700
@@ -27,9 +27,10 @@
 
 #include <iosfwd>
 
-#include "dMatrix.h"
+#include "CColVector.h"
 #include "CMatrix.h"
-#include "CColVector.h"
+
+class Matrix;
 
 class
 OCTAVE_API
--- a/liboctave/numeric/LSODE.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/LSODE.cc	Tue May 09 08:46:07 2017 -0700
@@ -29,7 +29,6 @@
 #include "LSODE.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
-#include "lo-math.h"
 #include "quit.h"
 
 typedef F77_INT (*lsode_fcn_ptr) (const F77_INT&, const double&, double*,
--- a/liboctave/numeric/LSODE.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/LSODE.h	Tue May 09 08:46:07 2017 -0700
@@ -27,6 +27,7 @@
 
 #include <string>
 
+#include "Array.h"
 #include "LSODE-opts.h"
 
 class
--- a/liboctave/numeric/ODE.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/ODE.h	Tue May 09 08:46:07 2017 -0700
@@ -27,6 +27,7 @@
 
 #include "ODEFunc.h"
 #include "base-de.h"
+#include "dMatrix.h"
 
 class
 ODE : public base_diff_eqn, public ODEFunc
--- a/liboctave/numeric/ODES.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/ODES.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,7 +25,6 @@
 #endif
 
 #include "ODES.h"
-#include "lo-error.h"
 
 void
 ODES::initialize (const ColumnVector& xx, double tt)
--- a/liboctave/numeric/ODESFunc.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/ODESFunc.h	Tue May 09 08:46:07 2017 -0700
@@ -27,6 +27,8 @@
 
 #include "dMatrix.h"
 
+class ColumnVector;
+
 class
 ODESFunc
 {
--- a/liboctave/numeric/Quad.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/Quad.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,6 +24,9 @@
 #  include "config.h"
 #endif
 
+#include <cassert>
+
+#include "Array.h"
 #include "Quad.h"
 #include "f77-fcn.h"
 #include "lo-error.h"
--- a/liboctave/numeric/aepbalance.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/aepbalance.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,17 +25,14 @@
 #  include "config.h"
 #endif
 
-#include <string>
-
-#include "CColVector.h"
 #include "CMatrix.h"
 #include "aepbalance.h"
 #include "dColVector.h"
 #include "dMatrix.h"
-#include "fCColVector.h"
 #include "fCMatrix.h"
 #include "fColVector.h"
 #include "fMatrix.h"
+#include "lo-error.h"
 #include "lo-lapack-proto.h"
 
 static inline char
@@ -56,7 +53,8 @@
       F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
-        (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
+        (*current_liboctave_error_handler)
+          ("aepbalance: requires square matrix");
 
       scale = ColumnVector (n);
 
@@ -106,7 +104,8 @@
       F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
-        (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
+        (*current_liboctave_error_handler)
+          ("aepbalance: requires square matrix");
 
       scale = FloatColumnVector (n);
 
@@ -156,7 +155,8 @@
       F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
-        (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
+        (*current_liboctave_error_handler)
+          ("aepbalance: requires square matrix");
 
       scale = ColumnVector (n);
 
@@ -207,7 +207,8 @@
       F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
-        (*current_liboctave_error_handler) ("aepbalance: requires square matrix");
+        (*current_liboctave_error_handler)
+          ("aepbalance: requires square matrix");
 
       scale = FloatColumnVector (n);
 
--- a/liboctave/numeric/base-de.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/base-de.h	Tue May 09 08:46:07 2017 -0700
@@ -28,7 +28,6 @@
 #include <string>
 
 #include "dColVector.h"
-#include "dMatrix.h"
 
 class
 base_diff_eqn
--- a/liboctave/numeric/base-min.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/base-min.h	Tue May 09 08:46:07 2017 -0700
@@ -48,14 +48,13 @@
     return *this;
   }
 
-  // Derived classes must provide a function to actually do the
-  // minimization.
+  // Derived classes must provide a function to actually do the minimization.
 
   virtual ColumnVector do_minimize (double& objf, octave_idx_type& inform,
                                     ColumnVector& lambda) = 0;
 
-  // Lots of ways to call the single function and optionally set and
-  // get additional information.
+  // Lots of ways to call the single function and optionally set and get
+  // additional information.
 
   virtual ColumnVector minimize (void)
   {
--- a/liboctave/numeric/bsxfun-decl.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/bsxfun-decl.h	Tue May 09 08:46:07 2017 -0700
@@ -24,8 +24,6 @@
 #if ! defined (octave_bsxfun_decl_h)
 #define octave_bsxfun_decl_h 1
 
-#include "octave-config.h"
-
 #define BSXFUN_OP_DECL(OP, ARRAY, API)                          \
   extern API ARRAY bsxfun_ ## OP (const ARRAY&, const ARRAY&);
 
--- a/liboctave/numeric/bsxfun-defs.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/bsxfun-defs.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,18 +24,15 @@
 #if ! defined (octave_bsxfun_defs_h)
 #define octave_bsxfun_defs_h 1
 
-// This file should not include config.h.  It is only included in other
-// C++ source files that should have included config.h before including
-// this file.
+// This file should *not* include config.h.  It is only included in other C++
+// source files that should have included config.h before including this file.
 
 #include <algorithm>
-#include <iostream>
 
 #include "dim-vector.h"
+#include "lo-error.h"
+#include "mx-inlines.cc"
 #include "oct-locbuf.h"
-#include "lo-error.h"
-
-#include "mx-inlines.cc"
 
 template <typename R, typename X, typename Y>
 Array<R>
--- a/liboctave/numeric/bsxfun.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/bsxfun.h	Tue May 09 08:46:07 2017 -0700
@@ -28,10 +28,9 @@
 #include "octave-config.h"
 
 #include <algorithm>
+#include <string>
 
-#include "Array.h"
 #include "dim-vector.h"
-#include "lo-error.h"
 
 inline
 bool
--- a/liboctave/numeric/chol.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/chol.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,21 +25,16 @@
 #  include "config.h"
 #endif
 
-#include <vector>
-
+#include "Array.h"
 #include "CColVector.h"
 #include "CMatrix.h"
-#include "CRowVector.h"
 #include "chol.h"
 #include "dColVector.h"
 #include "dMatrix.h"
-#include "dRowVector.h"
 #include "fCColVector.h"
 #include "fCMatrix.h"
-#include "fCRowVector.h"
 #include "fColVector.h"
 #include "fMatrix.h"
-#include "fRowVector.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
 #include "lo-qrupdate-proto.h"
--- a/liboctave/numeric/eigs-base.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/eigs-base.cc	Tue May 09 08:46:07 2017 -0700
@@ -27,19 +27,21 @@
 #include <cmath>
 #include <iostream>
 
+#include "Array.h"
 #include "CSparse.h"
 #include "MatrixType.h"
+#include "PermMatrix.h"
 #include "chol.h"
 #include "dSparse.h"
 #include "eigs-base.h"
-#include "f77-fcn.h"
 #include "lo-arpack-proto.h"
 #include "lo-blas-proto.h"
+#include "lo-error.h"
+#include "lo-ieee.h"
 #include "lu.h"
 #include "mx-ops.h"
 #include "oct-locbuf.h"
 #include "oct-rand.h"
-#include "quit.h"
 #include "sparse-chol.h"
 #include "sparse-lu.h"
 
--- a/liboctave/numeric/fEIG.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/fEIG.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,8 +25,10 @@
 #  include "config.h"
 #endif
 
+#include "Array.h"
 #include "fEIG.h"
 #include "fColVector.h"
+#include "fMatrix.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
 
--- a/liboctave/numeric/fEIG.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/fEIG.h	Tue May 09 08:46:07 2017 -0700
@@ -27,9 +27,10 @@
 
 #include <iosfwd>
 
-#include "fMatrix.h"
+#include "fCColVector.h"
 #include "fCMatrix.h"
-#include "fCColVector.h"
+
+class FloatMatrix;
 
 class
 OCTAVE_API
--- a/liboctave/numeric/gepbalance.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/gepbalance.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,17 +24,16 @@
 #  include "config.h"
 #endif
 
-#include <string>
-#include <vector>
-
-#include "Array-util.h"
 #include "CMatrix.h"
 #include "dMatrix.h"
 #include "fCMatrix.h"
 #include "fMatrix.h"
 #include "gepbalance.h"
+#include "lo-array-errwarn.h"
+#include "lo-error.h"
 #include "lo-lapack-proto.h"
 #include "oct-locbuf.h"
+#include "quit.h"
 
 namespace octave
 {
@@ -48,7 +47,8 @@
       F77_INT n = octave::to_f77_int (a.cols ());
 
       if (a.rows () != n)
-        (*current_liboctave_error_handler) ("GEPBALANCE requires square matrix");
+        (*current_liboctave_error_handler)
+          ("GEPBALANCE requires square matrix");
 
       if (a.dims () != b.dims ())
         octave::err_nonconformant ("GEPBALANCE", n, n, b.rows(), b.cols());
@@ -116,7 +116,8 @@
           ("FloatGEPBALANCE requires square matrix");
 
       if (a.dims () != b.dims ())
-        octave::err_nonconformant ("FloatGEPBALANCE", n, n, b.rows(), b.cols());
+        octave::err_nonconformant ("FloatGEPBALANCE",
+                                   n, n, b.rows(), b.cols());
 
       F77_INT info;
       F77_INT ilo;
@@ -182,7 +183,8 @@
           ("ComplexGEPBALANCE requires square matrix");
 
       if (a.dims () != b.dims ())
-        octave::err_nonconformant ("ComplexGEPBALANCE", n, n, b.rows(), b.cols());
+        octave::err_nonconformant ("ComplexGEPBALANCE",
+                                   n, n, b.rows(), b.cols());
 
       F77_INT info;
       F77_INT ilo;
@@ -200,7 +202,8 @@
       char job = balance_job[0];
 
       F77_XFCN (zggbal, ZGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
-                                 n, F77_DBLE_CMPLX_ARG (p_balanced_mat), n, F77_DBLE_CMPLX_ARG (p_balanced_mat2),
+                                 n, F77_DBLE_CMPLX_ARG (p_balanced_mat),
+                                 n, F77_DBLE_CMPLX_ARG (p_balanced_mat2),
                                  n, ilo, ihi, plscale, prscale, pwork, info
                                  F77_CHAR_ARG_LEN (1)));
 
@@ -251,7 +254,8 @@
         }
 
       if (a.dims () != b.dims ())
-        octave::err_nonconformant ("FloatComplexGEPBALANCE", n, n, b.rows(), b.cols());
+        octave::err_nonconformant ("FloatComplexGEPBALANCE",
+                                   n, n, b.rows(), b.cols());
 
       F77_INT info;
       F77_INT ilo;
@@ -269,7 +273,8 @@
       char job = balance_job[0];
 
       F77_XFCN (cggbal, CGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
-                                 n, F77_CMPLX_ARG (p_balanced_mat), n, F77_CMPLX_ARG (p_balanced_mat2),
+                                 n, F77_CMPLX_ARG (p_balanced_mat),
+                                 n, F77_CMPLX_ARG (p_balanced_mat2),
                                  n, ilo, ihi, plscale, prscale, pwork, info
                                  F77_CHAR_ARG_LEN (1)));
 
--- a/liboctave/numeric/gsvd.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/gsvd.cc	Tue May 09 08:46:07 2017 -0700
@@ -28,16 +28,15 @@
 
 #include <vector>
 
+#include "CMatrix.h"
+#include "dDiagMatrix.h"
+#include "dMatrix.h"
+#include "fCMatrix.h"
+#include "fDiagMatrix.h"
+#include "fMatrix.h"
 #include "gsvd.h"
-
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
-#include "dMatrix.h"
-#include "fMatrix.h"
-#include "CMatrix.h"
-#include "fCMatrix.h"
-#include "dDiagMatrix.h"
-#include "fDiagMatrix.h"
 
 namespace octave
 {
--- a/liboctave/numeric/hess.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/hess.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,6 +24,7 @@
 #  include "config.h"
 #endif
 
+#include "Array.h"
 #include "CMatrix.h"
 #include "dMatrix.h"
 #include "fCMatrix.h"
@@ -39,7 +40,7 @@
     template <>
     octave_idx_type
     hess<Matrix>::init (const Matrix& a)
-    {
+   {
       F77_INT a_nr = octave::to_f77_int (a.rows ());
       F77_INT a_nc = octave::to_f77_int (a.cols ());
 
--- a/liboctave/numeric/lo-blas-proto.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-blas-proto.h	Tue May 09 08:46:07 2017 -0700
@@ -110,7 +110,8 @@
                            const F77_INT&, const F77_DBLE&,
                            const F77_DBLE*, const F77_INT&,
                            const F77_DBLE*, const F77_INT&,
-                           const F77_DBLE&, F77_DBLE*, const F77_INT&
+                           const F77_DBLE&, F77_DBLE*,
+                           const F77_INT&
                            F77_CHAR_ARG_LEN_DECL
                            F77_CHAR_ARG_LEN_DECL);
 
@@ -133,7 +134,8 @@
                            const F77_INT&, const F77_DBLE_CMPLX&,
                            const F77_DBLE_CMPLX*, const F77_INT&,
                            const F77_DBLE_CMPLX*, const F77_INT&,
-                           const F77_DBLE_CMPLX&, F77_DBLE_CMPLX*, const F77_INT&
+                           const F77_DBLE_CMPLX&, F77_DBLE_CMPLX*,
+                           const F77_INT&
                            F77_CHAR_ARG_LEN_DECL
                            F77_CHAR_ARG_LEN_DECL);
 
--- a/liboctave/numeric/lo-lapack-proto.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-lapack-proto.h	Tue May 09 08:46:07 2017 -0700
@@ -46,8 +46,8 @@
                              const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_DBLE_CMPLX*,
                              const F77_INT&, const F77_INT*,
-                             const F77_DBLE&, F77_DBLE&, F77_DBLE_CMPLX*, F77_DBLE*,
-                             F77_INT&
+                             const F77_DBLE&, F77_DBLE&, F77_DBLE_CMPLX*,
+                             F77_DBLE*, F77_INT&
                              F77_CHAR_ARG_LEN_DECL);
 
   // GBTRF
@@ -191,9 +191,8 @@
   F77_RET_T
   F77_FUNC (cgehrd, CGEHRD) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_CMPLX*,
-                             const F77_INT&, F77_CMPLX*,
-                             F77_CMPLX*, const F77_INT&,
-                             F77_INT&);
+                             const F77_INT&, F77_CMPLX*, F77_CMPLX*,
+                             const F77_INT&, F77_INT&);
 
   F77_RET_T
   F77_FUNC (dgehrd, DGEHRD) (const F77_INT&, const F77_INT&,
@@ -229,15 +228,14 @@
 
   F77_RET_T
   F77_FUNC (sgeqp3, SGEQP3) (const F77_INT&, const F77_INT&,
-                             F77_REAL*, const F77_INT&, F77_INT*,
-                             F77_REAL*, F77_REAL*, const F77_INT&,
-                             F77_INT&);
+                             F77_REAL*, const F77_INT&,
+                             F77_INT*, F77_REAL*, F77_REAL*,
+                             const F77_INT&, F77_INT&);
   F77_RET_T
   F77_FUNC (zgeqp3, ZGEQP3) (const F77_INT&, const F77_INT&,
                              F77_DBLE_CMPLX*, const F77_INT&,
                              F77_INT*, F77_DBLE_CMPLX*, F77_DBLE_CMPLX*,
-                             const F77_INT&, F77_DBLE*,
-                             F77_INT&);
+                             const F77_INT&, F77_DBLE*, F77_INT&);
 
   // GEQRF
 
@@ -249,20 +247,21 @@
 
   F77_RET_T
   F77_FUNC (dgeqrf, DGEQRF) (const F77_INT&, const F77_INT&,
-                             F77_DBLE*, const F77_INT&, F77_DBLE*,
                              F77_DBLE*, const F77_INT&,
-                             F77_INT&);
+                             F77_DBLE*, F77_DBLE*,
+                             const F77_INT&, F77_INT&);
 
   F77_RET_T
   F77_FUNC (sgeqrf, SGEQRF) (const F77_INT&, const F77_INT&,
-                             F77_REAL*, const F77_INT&, F77_REAL*, F77_REAL*,
+                             F77_REAL*, const F77_INT&,
+                             F77_REAL*, F77_REAL*,
                              const F77_INT&, F77_INT&);
 
   F77_RET_T
   F77_FUNC (zgeqrf, ZGEQRF) (const F77_INT&, const F77_INT&,
-                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*,
                              F77_DBLE_CMPLX*, const F77_INT&,
-                             F77_INT&);
+                             F77_DBLE_CMPLX*, F77_DBLE_CMPLX*,
+                             const F77_INT&, F77_INT&);
 
   // GESDD
 
@@ -272,37 +271,37 @@
                              F77_CMPLX*, const F77_INT&, F77_REAL*,
                              F77_CMPLX*, const F77_INT&,
                              F77_CMPLX*, const F77_INT&,
-                             F77_CMPLX*, const F77_INT&,
-                             F77_REAL*, F77_INT *, F77_INT&
+                             F77_CMPLX*, const F77_INT&, F77_REAL*,
+                             F77_INT *, F77_INT&
                              F77_CHAR_ARG_LEN_DECL);
 
   F77_RET_T
   F77_FUNC (dgesdd, DGESDD) (F77_CONST_CHAR_ARG_DECL,
                              const F77_INT&, const F77_INT&,
                              F77_DBLE*, const F77_INT&, F77_DBLE*,
-                             F77_DBLE*, const F77_INT&, F77_DBLE*,
-                             const F77_INT&, F77_DBLE*,
-                             const F77_INT&, F77_INT *,
-                             F77_INT&
+                             F77_DBLE*, const F77_INT&,
+                             F77_DBLE*, const F77_INT&,
+                             F77_DBLE*, const F77_INT&,
+                             F77_INT *, F77_INT&
                              F77_CHAR_ARG_LEN_DECL);
 
   F77_RET_T
   F77_FUNC (sgesdd, SGESDD) (F77_CONST_CHAR_ARG_DECL,
                              const F77_INT&, const F77_INT&,
                              F77_REAL*, const F77_INT&, F77_REAL*,
-                             F77_REAL*, const F77_INT&, F77_REAL*,
-                             const F77_INT&, F77_REAL*,
-                             const F77_INT&, F77_INT *,
-                             F77_INT&
+                             F77_REAL*, const F77_INT&,
+                             F77_REAL*, const F77_INT&,
+                             F77_REAL*, const F77_INT&,
+                             F77_INT *, F77_INT&
                              F77_CHAR_ARG_LEN_DECL);
 
   F77_RET_T
   F77_FUNC (zgesdd, ZGESDD) (F77_CONST_CHAR_ARG_DECL,
                              const F77_INT&, const F77_INT&,
+                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE*,
                              F77_DBLE_CMPLX*, const F77_INT&,
-                             F77_DBLE*, F77_DBLE_CMPLX*, const F77_INT&,
-                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*,
-                             const F77_INT&, F77_DBLE*,
+                             F77_DBLE_CMPLX*, const F77_INT&,
+                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE*,
                              F77_INT *, F77_INT&
                              F77_CHAR_ARG_LEN_DECL);
   // GESVD
--- a/liboctave/numeric/lo-mappers.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-mappers.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,16 +25,9 @@
 #  include "config.h"
 #endif
 
-#include "lo-error.h"
-#include "lo-ieee.h"
 #include "lo-mappers.h"
-#include "lo-math.h"
 #include "lo-specfun.h"
-#include "lo-utils.h"
 #include "math-wrappers.h"
-#include "oct-cmplx.h"
-
-#include "f77-fcn.h"
 
 // FIXME: We used to have this situation:
 //
--- a/liboctave/numeric/lo-mappers.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-mappers.h	Tue May 09 08:46:07 2017 -0700
@@ -75,13 +75,16 @@
 
     using std::atan;
 
-    // C++ now provides versions of the following funtions for
-    // arguments of type std::complex<T> and T.  But some compilers
-    // (I'm looking at you, clang) apparently don't get this right
-    // yet...  So we provide our own wrappers for real-valued arguments.
+    // C++ now provides versions of the following functions for arguments of
+    // type std::complex<T> and T.  But some compilers (I'm looking at you,
+    // clang) apparently don't get this right yet...  So we provide our own
+    // wrappers for real-valued arguments.
 
     inline double arg (double x) { return signbit (x) ? M_PI : 0; }
-    inline float arg (float x) { return signbit (x) ? static_cast<float> (M_PI) : 0; }
+    inline float arg (float x)
+    {
+      return signbit (x) ? static_cast<float> (M_PI) : 0;
+    }
 
     template <typename T>
     T
@@ -302,9 +305,16 @@
     }
 
     template <>
-    inline double x_nint (double x) { return (finite (x) ? floor (x + 0.5) : x); }
+    inline double x_nint (double x)
+    {
+      return (finite (x) ? floor (x + 0.5) : x);
+    }
+
     template <>
-    inline float x_nint (float x) { return (finite (x) ? floor (x + 0.5f) : x); }
+    inline float x_nint (float x)
+    {
+      return (finite (x) ? floor (x + 0.5f) : x);
+    }
 
     extern OCTAVE_API octave_idx_type nint_big (double x);
     extern OCTAVE_API octave_idx_type nint_big (float x);
@@ -496,27 +506,45 @@
 OCTAVE_DEPRECATED ("use 'octave::math::is_NA' instead")
 inline bool octave_is_NA (const Complex& x) { return octave::math::is_NA (x); }
 OCTAVE_DEPRECATED ("use 'octave::math::is_NA' instead")
-inline bool octave_is_NA (const FloatComplex& x) { return octave::math::is_NA (x); }
+inline bool octave_is_NA (const FloatComplex& x)
+{
+  return octave::math::is_NA (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::is_NaN_or_NA' instead")
-inline bool octave_is_NaN_or_NA (const Complex& x) { return octave::math::is_NaN_or_NA (x); }
+inline bool octave_is_NaN_or_NA (const Complex& x)
+{
+  return octave::math::is_NaN_or_NA (x);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::is_NaN_or_NA' instead")
-inline bool octave_is_NaN_or_NA (const FloatComplex& x) { return octave::math::is_NaN_or_NA (x); }
+inline bool octave_is_NaN_or_NA (const FloatComplex& x)
+{
+  return octave::math::is_NaN_or_NA (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::acos' instead")
 inline Complex acos (const Complex& x) { return octave::math::acos (x); }
 OCTAVE_DEPRECATED ("use 'octave::math::acos' instead")
-inline FloatComplex acos (const FloatComplex& x) { return octave::math::acos (x); }
+inline FloatComplex acos (const FloatComplex& x)
+{
+  return octave::math::acos (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::asin' instead")
 inline Complex asin (const Complex& x) { return octave::math::asin (x); }
 OCTAVE_DEPRECATED ("use 'octave::math::asin' instead")
-inline FloatComplex asin (const FloatComplex& x) { return octave::math::asin (x); }
+inline FloatComplex asin (const FloatComplex& x)
+{
+  return octave::math::asin (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::atan' instead")
 inline Complex atan (const Complex& x) { return octave::math::atan (x); }
 OCTAVE_DEPRECATED ("use 'octave::math::atan' instead")
-inline FloatComplex atan (const FloatComplex& x) { return octave::math::atan (x); }
+inline FloatComplex atan (const FloatComplex& x)
+{
+  return octave::math::atan (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::arg' instead")
 inline double arg (double x) { return octave::math::arg (x); }
@@ -546,17 +574,29 @@
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
 inline Complex xlog2 (const Complex& x) { return octave::math::log2 (x); }
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
-inline FloatComplex xlog2 (const FloatComplex& x) { return octave::math::log2 (x); }
+inline FloatComplex xlog2 (const FloatComplex& x)
+{ 
+  return octave::math::log2 (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
-inline double xlog2 (double x, int& exp) { return octave::math::log2 (x, exp); }
+inline double xlog2 (double x, int& exp)
+{ 
+  return octave::math::log2 (x, exp);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
 inline float xlog2 (float x, int& exp) { return octave::math::log2 (x, exp); }
 
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
-inline Complex xlog2 (const Complex& x, int& exp) { return octave::math::log2 (x, exp); }
+inline Complex xlog2 (const Complex& x, int& exp)
+{ 
+  return octave::math::log2 (x, exp);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::log2' instead")
-inline FloatComplex xlog2 (const FloatComplex& x, int& exp) { return octave::math::log2 (x, exp); }
+inline FloatComplex xlog2 (const FloatComplex& x, int& exp)
+{ 
+  return octave::math::log2 (x, exp);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::exp2' instead")
 inline double xexp2 (double x) { return octave::math::exp2 (x); }
@@ -577,9 +617,15 @@
 }
 
 OCTAVE_DEPRECATED ("use 'octave::math::copysign' instead")
-inline double xcopysign (double x, double y) { return octave::math::copysign (x, y); }
+inline double xcopysign (double x, double y)
+{ 
+  return octave::math::copysign (x, y);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::copysign' instead")
-inline float xcopysign (float x, float y) { return octave::math::copysign (x, y); }
+inline float xcopysign (float x, float y)
+{ 
+  return octave::math::copysign (x, y);
+}
 
 template <typename T>
 OCTAVE_DEPRECATED ("use 'octave::math::signbit' instead")
@@ -590,14 +636,26 @@
 }
 
 OCTAVE_DEPRECATED ("use 'octave::math::negative_sign' instead")
-inline bool xnegative_sign (double x) { return octave::math::negative_sign (x); }
+inline bool xnegative_sign (double x)
+{ 
+  return octave::math::negative_sign (x);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::negative_sign' instead")
-inline bool xnegative_sign (float x) { return octave::math::negative_sign (x); }
+inline bool xnegative_sign (float x)
+{ 
+  return octave::math::negative_sign (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::positive_sign' instead")
-inline bool xpositive_sign (double x) { return octave::math::positive_sign (x); }
+inline bool xpositive_sign (double x)
+{ 
+  return octave::math::positive_sign (x);
+}
 OCTAVE_DEPRECATED ("use 'octave::math::positive_sign' instead")
-inline bool xpositive_sign (float x) { return octave::math::positive_sign (x); }
+inline bool xpositive_sign (float x)
+{ 
+  return octave::math::positive_sign (x);
+}
 
 OCTAVE_DEPRECATED ("use 'octave::math::signum' instead")
 inline double signum (double x) { return octave::math::signum (x); }
--- a/liboctave/numeric/lo-qrupdate-proto.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-qrupdate-proto.h	Tue May 09 08:46:07 2017 -0700
@@ -41,18 +41,18 @@
 
   F77_RET_T
   F77_FUNC (dch1dn, DCH1DN) (const F77_INT&, F77_DBLE*,
-                             const F77_INT&, F77_DBLE*, F77_DBLE*,
-                             F77_INT&);
+                             const F77_INT&, F77_DBLE*,
+                             F77_DBLE*, F77_INT&);
 
   F77_RET_T
   F77_FUNC (sch1dn, SCH1DN) (const F77_INT&, F77_REAL*,
-                             const F77_INT&, F77_REAL*, F77_REAL*,
-                             F77_INT&);
+                             const F77_INT&, F77_REAL*,
+                             F77_REAL*, F77_INT&);
 
   F77_RET_T
   F77_FUNC (zch1dn, ZCH1DN) (const F77_INT&, F77_DBLE_CMPLX*,
-                             const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*,
-                             F77_INT&);
+                             const F77_INT&, F77_DBLE_CMPLX*,
+                             F77_DBLE*, F77_INT&);
 
   // CH1UP
 
@@ -186,8 +186,8 @@
   F77_FUNC (sqrdec, SQRDEC) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_REAL*,
                              const F77_INT&, F77_REAL*,
-                             const F77_INT&,
-                             const F77_INT&, F77_REAL*);
+                             const F77_INT&, const F77_INT&,
+                             F77_REAL*);
 
   F77_RET_T
   F77_FUNC (zqrdec, ZQRDEC) (const F77_INT&, const F77_INT&,
@@ -206,9 +206,9 @@
 
   F77_RET_T
   F77_FUNC (dqrder, DQRDER) (const F77_INT&, const F77_INT&,
-                             F77_DBLE*, const F77_INT&, F77_DBLE*,
-                             const F77_INT&, const F77_INT&,
-                             F77_DBLE*);
+                             F77_DBLE*, const F77_INT&,
+                             F77_DBLE*, const F77_INT&,
+                             const F77_INT&, F77_DBLE*);
 
   F77_RET_T
   F77_FUNC (sqrder, SQRDER) (const F77_INT&, const F77_INT&,
@@ -218,9 +218,9 @@
 
   F77_RET_T
   F77_FUNC (zqrder, ZQRDER) (const F77_INT&, const F77_INT&,
-                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*,
-                             const F77_INT&, const F77_INT&,
-                             F77_DBLE_CMPLX*, F77_DBLE*);
+                             F77_DBLE_CMPLX*, const F77_INT&,
+                             F77_DBLE_CMPLX*, const F77_INT&,
+                             const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*);
 
   // QRINC
 
@@ -228,7 +228,7 @@
   F77_FUNC (cqrinc, CQRINC) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_CMPLX*,
                              const F77_INT&, F77_CMPLX*,
-                             const F77_INT&,const F77_INT&,
+                             const F77_INT&, const F77_INT&,
                              const F77_CMPLX*, F77_REAL*);
 
   F77_RET_T
@@ -242,8 +242,8 @@
   F77_FUNC (sqrinc, SQRINC) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_REAL*,
                              const F77_INT&, F77_REAL*,
-                             const F77_INT&,
-                             const F77_INT&, const F77_REAL*, F77_REAL*);
+                             const F77_INT&, const F77_INT&,
+                             const F77_REAL*, F77_REAL*);
 
   F77_RET_T
   F77_FUNC (zqrinc, ZQRINC) (const F77_INT&, const F77_INT&,
@@ -263,21 +263,24 @@
 
   F77_RET_T
   F77_FUNC (dqrinr, DQRINR) (const F77_INT&, const F77_INT&,
-                             F77_DBLE*, const F77_INT&, F77_DBLE*,
-                             const F77_INT&, const F77_INT&,
-                             const F77_DBLE*, F77_DBLE*);
+                             F77_DBLE*, const F77_INT&,
+                             F77_DBLE*, const F77_INT&,
+                             const F77_INT&, const F77_DBLE*,
+                             F77_DBLE*);
 
   F77_RET_T
   F77_FUNC (sqrinr, SQRINR) (const F77_INT&, const F77_INT&,
                              F77_REAL*, const F77_INT&,
                              F77_REAL*, const F77_INT&,
-                             const F77_INT&, const F77_REAL*, F77_REAL*);
+                             const F77_INT&, const F77_REAL*,
+                             F77_REAL*);
 
   F77_RET_T
   F77_FUNC (zqrinr, ZQRINR) (const F77_INT&, const F77_INT&,
-                             F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*,
-                             const F77_INT&, const F77_INT&,
-                             const F77_DBLE_CMPLX*, F77_DBLE*);
+                             F77_DBLE_CMPLX*, const F77_INT&,
+                             F77_DBLE_CMPLX*, const F77_INT&,
+                             const F77_INT&, const F77_DBLE_CMPLX*,
+                             F77_DBLE*);
 
   // QRSHC
 
@@ -286,21 +289,22 @@
                              const F77_INT&, F77_CMPLX*,
                              const F77_INT&, F77_CMPLX*,
                              const F77_INT&, const F77_INT&,
-                             const F77_INT&, F77_CMPLX*,
-                             F77_REAL*);
+                             const F77_INT&,
+                             F77_CMPLX*, F77_REAL*);
   F77_RET_T
   F77_FUNC (dqrshc, DQRSHC) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_DBLE*,
                              const F77_INT&, F77_DBLE*,
                              const F77_INT&, const F77_INT&,
-                             const F77_INT&, F77_DBLE*);
+                             const F77_INT&,
+                             F77_DBLE*);
 
   F77_RET_T
   F77_FUNC (sqrshc, SQRSHC) (const F77_INT&, const F77_INT&,
                              const F77_INT&, F77_REAL*,
                              const F77_INT&, F77_REAL*,
+                             const F77_INT&, const F77_INT&,
                              const F77_INT&,
-                             const F77_INT&, const F77_INT&,
                              F77_REAL*);
 
   F77_RET_T
@@ -308,7 +312,8 @@
                              const F77_INT&, F77_DBLE_CMPLX*,
                              const F77_INT&, F77_DBLE_CMPLX*,
                              const F77_INT&, const F77_INT&,
-                             const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*);
+                             const F77_INT&,
+                             F77_DBLE_CMPLX*, F77_DBLE*);
 
 #endif
 
--- a/liboctave/numeric/lo-slatec-proto.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-slatec-proto.h	Tue May 09 08:46:07 2017 -0700
@@ -90,10 +90,12 @@
   // GAMMAINC
 
   F77_RET_T
-  F77_FUNC (xgammainc, XGAMMAINC) (const F77_DBLE&, const F77_DBLE&, F77_DBLE&);
+  F77_FUNC (xgammainc, XGAMMAINC) (const F77_DBLE&, const F77_DBLE&,
+                                   F77_DBLE&);
 
   F77_RET_T
-  F77_FUNC (xsgammainc, XSGAMMAINC) (const F77_REAL&, const F77_REAL&, F77_REAL&);
+  F77_FUNC (xsgammainc, XSGAMMAINC) (const F77_REAL&, const F77_REAL&,
+                                     F77_REAL&);
 
   // LGAMS
 
--- a/liboctave/numeric/lo-specfun.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-specfun.cc	Tue May 09 08:46:07 2017 -0700
@@ -28,30 +28,32 @@
 #  include "config.h"
 #endif
 
-#include "Range.h"
+#include <algorithm>
+#include <limits>
+#include <string>
+
 #include "CColVector.h"
 #include "CMatrix.h"
-#include "dRowVector.h"
+#include "CNDArray.h"
+#include "Faddeeva.hh"
 #include "dMatrix.h"
 #include "dNDArray.h"
-#include "CNDArray.h"
+#include "dRowVector.h"
+#include "f77-fcn.h"
 #include "fCColVector.h"
 #include "fCMatrix.h"
-#include "fRowVector.h"
+#include "fCNDArray.h"
 #include "fMatrix.h"
 #include "fNDArray.h"
-#include "fCNDArray.h"
-#include "f77-fcn.h"
+#include "fRowVector.h"
 #include "lo-amos-proto.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
+#include "lo-mappers.h"
+#include "lo-math.h"
 #include "lo-slatec-proto.h"
 #include "lo-specfun.h"
 #include "mx-inlines.cc"
-#include "lo-mappers.h"
-#include "lo-math.h"
-
-#include "Faddeeva.hh"
 
 namespace octave
 {
--- a/liboctave/numeric/lo-specfun.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lo-specfun.h	Tue May 09 08:46:07 2017 -0700
@@ -26,22 +26,21 @@
 
 #include "octave-config.h"
 
+#include "Array.h"
 #include "oct-cmplx.h"
-#include "Array.h"
 
+class ComplexColumnVector;
+class ComplexMatrix;
+class ComplexNDArray;
+class FloatComplexColumnVector;
+class FloatComplexMatrix;
+class FloatComplexNDArray;
+class FloatMatrix;
+class FloatNDArray;
+class FloatRowVector;
 class Matrix;
-class ComplexMatrix;
 class NDArray;
-class ComplexNDArray;
 class RowVector;
-class ComplexColumnVector;
-class FloatMatrix;
-class FloatComplexMatrix;
-class FloatNDArray;
-class FloatComplexNDArray;
-class FloatRowVector;
-class FloatComplexColumnVector;
-class Range;
 
 namespace octave
 {
--- a/liboctave/numeric/lu.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lu.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,8 +25,11 @@
 #  include "config.h"
 #endif
 
+#include <algorithm>
+
 #include "CColVector.h"
 #include "CMatrix.h"
+#include "PermMatrix.h"
 #include "dColVector.h"
 #include "dMatrix.h"
 #include "fCColVector.h"
@@ -294,8 +297,8 @@
 
       ColumnVector utmp = u;
       ColumnVector vtmp = v;
-      F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k,
-                                 utmp.fortran_vec (), vtmp.fortran_vec ()));
+      F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (),
+                                 k, utmp.fortran_vec (), vtmp.fortran_vec ()));
     }
 
     template <>
@@ -426,7 +429,8 @@
 
     template <>
     void
-    lu<FloatMatrix>::update (const FloatColumnVector& u, const FloatColumnVector& v)
+    lu<FloatMatrix>::update (const FloatColumnVector& u,
+                             const FloatColumnVector& v)
     {
       if (packed ())
         unpack ();
@@ -570,8 +574,8 @@
 
       F77_INT info = 0;
 
-      F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, F77_DBLE_CMPLX_ARG (tmp_data), a_nr,
-                                 pipvt, info));
+      F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, F77_DBLE_CMPLX_ARG (tmp_data),
+                                 a_nr, pipvt, info));
 
       for (F77_INT i = 0; i < mn; i++)
         pipvt[i] -= 1;
@@ -635,8 +639,10 @@
         {
           ComplexColumnVector utmp = u.column (i);
           ComplexColumnVector vtmp = v.column (i);
-          F77_XFCN (zlu1up, ZLU1UP, (m, n, F77_DBLE_CMPLX_ARG (l.fortran_vec ()),
-                                     m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k,
+          F77_XFCN (zlu1up, ZLU1UP, (m, n,
+                                     F77_DBLE_CMPLX_ARG (l.fortran_vec ()),
+                                     m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()),
+                                     k,
                                      F77_DBLE_CMPLX_ARG (utmp.fortran_vec ()),
                                      F77_DBLE_CMPLX_ARG (vtmp.fortran_vec ())));
         }
@@ -671,13 +677,15 @@
                                    m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k,
                                    ipvt.fortran_vec (),
                                    F77_CONST_DBLE_CMPLX_ARG (utmp.data ()),
-                                   F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), F77_DBLE_CMPLX_ARG (w)));
+                                   F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()),
+                                   F77_DBLE_CMPLX_ARG (w)));
       for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement
     }
 
     template <>
     void
-    lu<ComplexMatrix>::update_piv (const ComplexMatrix& u, const ComplexMatrix& v)
+    lu<ComplexMatrix>::update_piv (const ComplexMatrix& u,
+                                   const ComplexMatrix& v)
     {
       if (packed ())
         unpack ();
@@ -704,11 +712,14 @@
         {
           ComplexColumnVector utmp = u.column (i);
           ComplexColumnVector vtmp = v.column (i);
-          F77_XFCN (zlup1up, ZLUP1UP, (m, n, F77_DBLE_CMPLX_ARG (l.fortran_vec ()),
-                                       m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k,
-                                       ipvt.fortran_vec (),
+          F77_XFCN (zlup1up, ZLUP1UP, (m, n,
+                                       F77_DBLE_CMPLX_ARG (l.fortran_vec ()),
+                                       m,
+                                       F77_DBLE_CMPLX_ARG (r.fortran_vec ()),
+                                       k, ipvt.fortran_vec (),
                                        F77_CONST_DBLE_CMPLX_ARG (utmp.data ()),
-                                       F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), F77_DBLE_CMPLX_ARG (w)));
+                                       F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()),
+                                       F77_DBLE_CMPLX_ARG (w)));
         }
       for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement
     }
@@ -730,8 +741,8 @@
 
       F77_INT info = 0;
 
-      F77_XFCN (cgetrf, CGETRF, (a_nr, a_nc, F77_CMPLX_ARG (tmp_data), a_nr, pipvt,
-                                 info));
+      F77_XFCN (cgetrf, CGETRF, (a_nr, a_nc, F77_CMPLX_ARG (tmp_data), a_nr,
+                                 pipvt, info));
 
       for (F77_INT i = 0; i < mn; i++)
         pipvt[i] -= 1;
@@ -764,7 +775,8 @@
       FloatComplexColumnVector vtmp = v;
       F77_XFCN (clu1up, CLU1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()), m,
                                  F77_CMPLX_ARG (r.fortran_vec ()), k,
-                                 F77_CMPLX_ARG (utmp.fortran_vec ()), F77_CMPLX_ARG (vtmp.fortran_vec ())));
+                                 F77_CMPLX_ARG (utmp.fortran_vec ()),
+                                 F77_CMPLX_ARG (vtmp.fortran_vec ())));
     }
 
     template <>
@@ -797,7 +809,8 @@
           FloatComplexColumnVector vtmp = v.column (i);
           F77_XFCN (clu1up, CLU1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()),
                                      m, F77_CMPLX_ARG (r.fortran_vec ()), k,
-                                     F77_CMPLX_ARG (utmp.fortran_vec ()), F77_CMPLX_ARG (vtmp.fortran_vec ())));
+                                     F77_CMPLX_ARG (utmp.fortran_vec ()),
+                                     F77_CMPLX_ARG (vtmp.fortran_vec ())));
         }
     }
 
@@ -829,7 +842,8 @@
       F77_XFCN (clup1up, CLUP1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()),
                                    m, F77_CMPLX_ARG (r.fortran_vec ()), k,
                                    ipvt.fortran_vec (),
-                                   F77_CONST_CMPLX_ARG (utmp.data ()), F77_CONST_CMPLX_ARG (vtmp.data ()),
+                                   F77_CONST_CMPLX_ARG (utmp.data ()),
+                                   F77_CONST_CMPLX_ARG (vtmp.data ()),
                                    F77_CMPLX_ARG (w)));
       for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement
     }
@@ -867,7 +881,8 @@
           F77_XFCN (clup1up, CLUP1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()),
                                        m, F77_CMPLX_ARG (r.fortran_vec ()), k,
                                        ipvt.fortran_vec (),
-                                       F77_CONST_CMPLX_ARG (utmp.data ()), F77_CONST_CMPLX_ARG (vtmp.data ()),
+                                       F77_CONST_CMPLX_ARG (utmp.data ()),
+                                       F77_CONST_CMPLX_ARG (vtmp.data ()),
                                        F77_CMPLX_ARG (w)));
         }
       for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement
--- a/liboctave/numeric/lu.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/lu.h	Tue May 09 08:46:07 2017 -0700
@@ -26,7 +26,10 @@
 
 #include "octave-config.h"
 
-#include "PermMatrix.h"
+#include "Array.h"
+
+class ColumnVector;
+class PermMatrix;
 
 namespace octave
 {
@@ -91,15 +94,15 @@
 
     protected:
 
-      // The result of getp is passed to other Octave Matrix
-      // fucntions, so we use octave_idx_type.
+      // The result of getp is passed to other Octave Matrix functions,
+      // so we use octave_idx_type.
       Array<octave_idx_type> getp (void) const;
 
       T a_fact;
       T l_fact;
 
-      // This is internal storage that is passed to Fortran, so we
-      // need a Fortran INTEGER.
+      // This is internal storage that is passed to Fortran,
+      // so we need a Fortran INTEGER.
       Array<octave_f77_int_type> ipvt;
     };
   }
--- a/liboctave/numeric/oct-convn.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-convn.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,13 +24,12 @@
 #  include "config.h"
 #endif
 
-#include <iostream>
 #include <algorithm>
 
+#include "Array.h"
+#include "MArray.h"
 #include "f77-fcn.h"
-
 #include "oct-convn.h"
-#include "oct-locbuf.h"
 
 // 2d convolution with a matrix kernel.
 template <typename T, typename R>
--- a/liboctave/numeric/oct-convn.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-convn.h	Tue May 09 08:46:07 2017 -0700
@@ -26,25 +26,22 @@
 
 #include "octave-config.h"
 
+#include "CColVector.h"
+#include "CMatrix.h"
+#include "CNDArray.h"
+#include "CRowVector.h"
+#include "dColVector.h"
 #include "dMatrix.h"
-#include "fMatrix.h"
-#include "CMatrix.h"
+#include "dNDArray.h"
+#include "dRowVector.h"
+#include "fCColVector.h"
 #include "fCMatrix.h"
-
-#include "dNDArray.h"
-#include "fNDArray.h"
-#include "CNDArray.h"
 #include "fCNDArray.h"
-
-#include "dRowVector.h"
+#include "fCRowVector.h"
+#include "fColVector.h"
+#include "fMatrix.h"
+#include "fNDArray.h"
 #include "fRowVector.h"
-#include "CRowVector.h"
-#include "fCRowVector.h"
-
-#include "dColVector.h"
-#include "fColVector.h"
-#include "CColVector.h"
-#include "fCColVector.h"
 
 enum convn_type
 {
--- a/liboctave/numeric/oct-fftw.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-fftw.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,18 +24,14 @@
 #  include "config.h"
 #endif
 
-#include <iostream>
-#include <string>
-#include <vector>
-
 #if defined (HAVE_FFTW3_H)
 #  include <fftw3.h>
 #endif
 
 #include "lo-error.h"
 #include "oct-fftw.h"
+#include "oct-locbuf.h"
 #include "quit.h"
-#include "oct-locbuf.h"
 #include "singleton-cleanup.h"
 
 #if defined (HAVE_FFTW3_THREADS) || defined (HAVE_FFTW3F_THREADS)
--- a/liboctave/numeric/oct-fftw.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-fftw.h	Tue May 09 08:46:07 2017 -0700
@@ -27,8 +27,10 @@
 
 #include <cstddef>
 
+#include <string>
+
+#include "dim-vector.h"
 #include "oct-cmplx.h"
-#include "dim-vector.h"
 
 namespace octave
 {
--- a/liboctave/numeric/oct-norm.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-norm.cc	Tue May 09 08:46:07 2017 -0700
@@ -28,15 +28,16 @@
 
 #include <cmath>
 
+#include <algorithm>
 #include <limits>
 #include <vector>
 
-#include "Array-util.h"
 #include "Array.h"
 #include "CColVector.h"
 #include "CMatrix.h"
 #include "CRowVector.h"
 #include "CSparse.h"
+#include "MArray.h"
 #include "dColVector.h"
 #include "dDiagMatrix.h"
 #include "dMatrix.h"
@@ -51,11 +52,13 @@
 #include "fRowVector.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
+#include "lo-mappers.h"
 #include "mx-cm-s.h"
 #include "mx-fcm-fs.h"
 #include "mx-fs-fcm.h"
 #include "mx-s-cm.h"
 #include "oct-cmplx.h"
+#include "quit.h"
 #include "svd.h"
 
 // Theory: norm accumulator is an object that has an accum method able
--- a/liboctave/numeric/oct-rand.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-rand.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,13 +24,11 @@
 #  include "config.h"
 #endif
 
+#include <cassert>
 #include <cstdint>
 
-#include <map>
-#include <vector>
+#include <limits>
 
-#include "data-conv.h"
-#include "f77-fcn.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
 #include "lo-mappers.h"
@@ -39,6 +37,7 @@
 #include "oct-locbuf.h"
 #include "oct-rand.h"
 #include "oct-time.h"
+#include "quit.h"
 #include "randgamma.h"
 #include "randmtzig.h"
 #include "randpoisson.h"
--- a/liboctave/numeric/oct-rand.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-rand.h	Tue May 09 08:46:07 2017 -0700
@@ -28,11 +28,14 @@
 #include <map>
 #include <string>
 
+#include "Array.h"
 #include "dColVector.h"
 #include "dNDArray.h"
 #include "fNDArray.h"
 #include "lo-ieee.h"
 
+//class dim_vector;
+
 class
 OCTAVE_API
 octave_rand
--- a/liboctave/numeric/oct-spparms.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-spparms.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,9 +25,11 @@
 #  include "config.h"
 #endif
 
+#include <ostream>
+
+#include "dNDArray.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
-
 #include "oct-spparms.h"
 #include "singleton-cleanup.h"
 
--- a/liboctave/numeric/oct-spparms.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/oct-spparms.h	Tue May 09 08:46:07 2017 -0700
@@ -26,14 +26,13 @@
 
 #include "octave-config.h"
 
-#include <cassert>
-#include <cstddef>
-
 #include <iosfwd>
+#include <string>
 
 #include "str-vec.h"
 #include "dColVector.h"
-#include "dNDArray.h"
+
+class NDArray;
 
 #define OCTAVE_SPARSE_CONTROLS_SIZE 13
 
--- a/liboctave/numeric/qr.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/qr.cc	Tue May 09 08:46:07 2017 -0700
@@ -26,24 +26,27 @@
 #  include "config.h"
 #endif
 
+#include <algorithm>
+
+#include "Array.h"
 #include "CColVector.h"
 #include "CMatrix.h"
 #include "CRowVector.h"
 #include "dColVector.h"
 #include "dMatrix.h"
 #include "dRowVector.h"
-#include "f77-fcn.h"
 #include "fCColVector.h"
 #include "fCMatrix.h"
 #include "fCRowVector.h"
 #include "fColVector.h"
 #include "fMatrix.h"
 #include "fRowVector.h"
-#include "idx-vector.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
 #include "lo-qrupdate-proto.h"
+#include "oct-cmplx.h"
 #include "oct-locbuf.h"
+#include "oct-sort.h"
 #include "qr.h"
 
 namespace octave
--- a/liboctave/numeric/qr.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/qr.h	Tue May 09 08:46:07 2017 -0700
@@ -27,7 +27,7 @@
 
 #include "octave-config.h"
 
-#include "Array.h"
+template <typename T> class Array;
 
 namespace octave
 {
--- a/liboctave/numeric/qrp.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/qrp.cc	Tue May 09 08:46:07 2017 -0700
@@ -27,13 +27,16 @@
 
 #include <cassert>
 
+#include <algorithm>
+
+#include "Array.h"
 #include "CMatrix.h"
+#include "MArray.h"
 #include "dMatrix.h"
 #include "dRowVector.h"
 #include "fCMatrix.h"
 #include "fMatrix.h"
 #include "fRowVector.h"
-#include "lo-error.h"
 #include "lo-lapack-proto.h"
 #include "oct-locbuf.h"
 #include "qrp.h"
--- a/liboctave/numeric/randgamma.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/randgamma.cc	Tue May 09 08:46:07 2017 -0700
@@ -83,8 +83,8 @@
 
 #include "lo-ieee.h"
 #include "lo-math.h"
+#include "randgamma.h"
 #include "randmtzig.h"
-#include "randgamma.h"
 
 #define INFINITE lo_ieee_isinf
 #define RUNI oct_randu()
--- a/liboctave/numeric/randpoisson.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/randpoisson.cc	Tue May 09 08:46:07 2017 -0700
@@ -35,11 +35,12 @@
 #  include "config.h"
 #endif
 
+#include <cstddef>
+
 #include "f77-fcn.h"
 #include "lo-error.h"
 #include "lo-ieee.h"
 #include "lo-math.h"
-#include "lo-slatec-proto.h"
 #include "randmtzig.h"
 #include "randpoisson.h"
 
@@ -100,7 +101,8 @@
     {
       r  = 1.0 / k;
       rr = r * r;
-      return ((k + 0.5)*std::log (k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7))));
+      return ((k + 0.5)*std::log (k) - k + C0
+              + r*(C1 + rr*(C3 + rr*(C5 + rr*C7))));
     }
   else
     return (logfak[static_cast<int> (k)]);
--- a/liboctave/numeric/schur.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/schur.cc	Tue May 09 08:46:07 2017 -0700
@@ -24,12 +24,14 @@
 #  include "config.h"
 #endif
 
+#include "Array.h"
 #include "CMatrix.h"
 #include "dMatrix.h"
 #include "fCMatrix.h"
 #include "fMatrix.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
+#include "oct-locbuf.h"
 #include "schur.h"
 
 namespace octave
--- a/liboctave/numeric/schur.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/schur.h	Tue May 09 08:46:07 2017 -0700
@@ -27,17 +27,17 @@
 
 #include <string>
 
-#include "dMatrix.h"
+// FIXME: Don't really need these for compiling schur.h, but it messes
+// up compilation in liboctave/array if these are not present.
 #include "CMatrix.h"
+#include "dMatrix.h"
+#include "fCMatrix.h"
 #include "fMatrix.h"
-#include "fCMatrix.h"
 
 namespace octave
 {
   namespace math
   {
-    template <typename T> class schur;
-
     template <typename T>
     class
     schur
@@ -65,7 +65,6 @@
       schur (const T& s, const T& u) : schur_mat (s), unitary_mat (u) { }
 
       schur (const schur& a)
-
         : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat)
       { }
 
--- a/liboctave/numeric/sparse-chol.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-chol.cc	Tue May 09 08:46:07 2017 -0700
@@ -26,13 +26,20 @@
 #  include "config.h"
 #endif
 
-#include "sparse-chol.h"
-#include "sparse-util.h"
+#include <cstddef> 
+
+#include "CSparse.h"
+#include "MatrixType.h"
+#include "dRowVector.h"
+#include "dSparse.h"
 #include "lo-error.h"
+#include "oct-cmplx.h"
+#include "oct-refcount.h"
 #include "oct-sparse.h"
 #include "oct-spparms.h"
 #include "quit.h"
-#include "MatrixType.h"
+#include "sparse-chol.h"
+#include "sparse-util.h"
 
 namespace octave
 {
@@ -212,7 +219,8 @@
       octave_idx_type a_nc = a.cols ();
 
       if (a_nr != a_nc)
-        (*current_liboctave_error_handler) ("sparse_chol requires square matrix");
+        (*current_liboctave_error_handler)
+          ("sparse_chol requires square matrix");
 
       cholmod_common *cm = &Common;
 
@@ -231,12 +239,15 @@
       else
         {
           cm->print = static_cast<int> (spu) + 2;
-          SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &SparseCholPrint);
+          SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function,
+                                   &SparseCholPrint);
         }
 
       cm->error_handler = &SparseCholError;
 
-      SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex);
+      SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide,
+                                divcomplex);
+
       SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot);
 
       cm->final_asis = false;
@@ -310,7 +321,8 @@
                                                   Lsparse->p, &n1, cm);
               BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
               CHOLMOD_NAME(reallocate_sparse)
-                (static_cast<octave_idx_type *>(Lsparse->p)[minor_p], Lsparse, cm);
+                (static_cast<octave_idx_type *>(Lsparse->p)[minor_p],
+                 Lsparse, cm);
               END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
 
               Lsparse->ncol = minor_p;
@@ -390,21 +402,24 @@
     { }
 
     template <typename chol_type>
-    sparse_chol<chol_type>::sparse_chol (const chol_type& a, octave_idx_type& info,
+    sparse_chol<chol_type>::sparse_chol (const chol_type& a,
+                                         octave_idx_type& info,
                                          bool natural, bool force)
       : rep (new typename
              sparse_chol<chol_type>::sparse_chol_rep (a, info, natural, force))
     { }
 
     template <typename chol_type>
-    sparse_chol<chol_type>::sparse_chol (const chol_type& a, octave_idx_type& info,
+    sparse_chol<chol_type>::sparse_chol (const chol_type& a,
+                                         octave_idx_type& info,
                                          bool natural)
       : rep (new typename
              sparse_chol<chol_type>::sparse_chol_rep (a, info, natural, false))
     { }
 
     template <typename chol_type>
-    sparse_chol<chol_type>::sparse_chol (const chol_type& a, octave_idx_type& info)
+    sparse_chol<chol_type>::sparse_chol (const chol_type& a,
+                                         octave_idx_type& info)
       : rep (new typename
              sparse_chol<chol_type>::sparse_chol_rep (a, info, false, false))
     { }
--- a/liboctave/numeric/sparse-chol.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-chol.h	Tue May 09 08:46:07 2017 -0700
@@ -27,9 +27,9 @@
 
 #include "octave-config.h"
 
-#include "CSparse.h"
-#include "dRowVector.h"
-#include "dSparse.h"
+class RowVector;
+class SparseMatrix;
+class SparseComplexMatrix;
 
 namespace octave
 {
--- a/liboctave/numeric/sparse-dmsolve.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-dmsolve.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,15 +25,20 @@
 #  include "config.h"
 #endif
 
-#include <vector>
+#include <algorithm>
 
+#include "CMatrix.h"
+#include "CSparse.h"
 #include "MArray.h"
 #include "MSparse.h"
 #include "MatrixType.h"
+#include "dSparse.h"
+#include "lo-error.h"
 #include "oct-inttypes.h"
 #include "oct-locbuf.h"
 #include "oct-sort.h"
 #include "oct-sparse.h"
+#include "quit.h"
 #include "sparse-dmsolve.h"
 #include "sparse-qr.h"
 
@@ -389,9 +394,11 @@
       csm.nzmax = a.nnz ();
 
       // Cast away const on A, with full knowledge that CSparse won't touch it.
-      // Prevents the methods below making a copy of the data.
-      csm.p = const_cast<octave::suitesparse_integer *>(octave::to_suitesparse_intptr (a.cidx ()));
-      csm.i = const_cast<octave::suitesparse_integer *>(octave::to_suitesparse_intptr (a.ridx ()));
+      // Prevents the methods below from making a copy of the data.
+      csm.p = const_cast<octave::suitesparse_integer *>
+                (octave::to_suitesparse_intptr (a.cidx ()));
+      csm.i = const_cast<octave::suitesparse_integer *>
+                (octave::to_suitesparse_intptr (a.ridx ()));
 
       CXSPARSE_DNAME (d) *dm = CXSPARSE_DNAME(_dmperm) (&csm, 0);
       octave_idx_type *p = octave::to_octave_idx_type_ptr (dm->p);
@@ -414,8 +421,10 @@
           ST m = dmsolve_extract (a, pinv, q, dm->rr[2], nr, dm->cc[3], nc,
                                   nnz_remaining, true);
           nnz_remaining -= m.nnz ();
-          RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, dm->rr[2],
-                                           b_nr, 0, b_nc), info);
+          RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0,
+                                                               dm->rr[2], b_nr,
+                                                               0, b_nc),
+                                           info);
           dmsolve_insert (retval, mtmp, q, dm->cc[3], 0);
 
           if (dm->rr[2] > 0 && ! info)
@@ -463,8 +472,10 @@
         {
           ST m = dmsolve_extract (a, pinv, q, 0, dm->rr[1], 0,
                                   dm->cc[2], nnz_remaining, true);
-          RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, 0, dm->rr[1],
-                                           0, b_nc), info);
+          RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, 0,
+                                                               dm->rr[1], 0,
+                                                               b_nc),
+                                           info);
           dmsolve_insert (retval, mtmp, q, 0, 0);
         }
 
--- a/liboctave/numeric/sparse-lu.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-lu.cc	Tue May 09 08:46:07 2017 -0700
@@ -30,6 +30,7 @@
 #include "PermMatrix.h"
 #include "dSparse.h"
 #include "lo-error.h"
+#include "lo-mappers.h"
 #include "oct-locbuf.h"
 #include "oct-sparse.h"
 #include "oct-spparms.h"
--- a/liboctave/numeric/sparse-lu.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-lu.h	Tue May 09 08:46:07 2017 -0700
@@ -28,8 +28,12 @@
 #include "octave-config.h"
 
 #include "MArray.h"
+#include "dMatrix.h"
 #include "dSparse.h"
 
+class ColumnVector;
+class PermMatrix;
+
 namespace octave
 {
   namespace math
--- a/liboctave/numeric/sparse-qr.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-qr.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,9 +25,17 @@
 #  include "config.h"
 #endif
 
+#include "CMatrix.h"
+#include "CSparse.h"
+#include "MArray.h"
+#include "dColVector.h"
+#include "dMatrix.h"
+#include "dSparse.h"
 #include "lo-error.h"
 #include "oct-locbuf.h"
+#include "oct-refcount.h"
 #include "oct-sparse.h"
+#include "quit.h"
 #include "sparse-qr.h"
 
 namespace octave
@@ -184,9 +192,11 @@
       A.n = ncols;
       // Cast away const on A, with full knowledge that CSparse won't touch it
       // Prevents the methods below making a copy of the data.
-      A.p = const_cast<suitesparse_integer *>(to_suitesparse_intptr (a.cidx ()));
-      A.i = const_cast<suitesparse_integer *>(to_suitesparse_intptr (a.ridx ()));
-      A.x = const_cast<double *>(a.data ());
+      A.p = const_cast<suitesparse_integer *>
+              (to_suitesparse_intptr (a.cidx ()));
+      A.i = const_cast<suitesparse_integer *>
+              (to_suitesparse_intptr (a.ridx ()));
+      A.x = const_cast<double *> (a.data ());
       A.nz = -1;
 
       BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
@@ -326,7 +336,9 @@
         {
           OCTAVE_LOCAL_BUFFER (double, buf, S->m2);
 
-          for (volatile octave_idx_type j = 0, idx = 0; j < b_nc; j++, idx+=b_nr)
+          for (volatile octave_idx_type j = 0, idx = 0;
+               j < b_nc;
+               j++, idx += b_nr)
             {
               octave_quit ();
 
@@ -950,10 +962,12 @@
       A.n = ncols;
       // Cast away const on A, with full knowledge that CSparse won't touch it
       // Prevents the methods below making a copy of the data.
-      A.p = const_cast<suitesparse_integer *>(to_suitesparse_intptr (a.cidx ()));
-      A.i = const_cast<suitesparse_integer *>(to_suitesparse_intptr (a.ridx ()));
-      A.x = const_cast<cs_complex_t *> (
-              reinterpret_cast<const cs_complex_t *> (a.data ()));
+      A.p = const_cast<suitesparse_integer *>
+              (to_suitesparse_intptr (a.cidx ()));
+      A.i = const_cast<suitesparse_integer *>
+              (to_suitesparse_intptr (a.ridx ()));
+      A.x = const_cast<cs_complex_t *>
+              (reinterpret_cast<const cs_complex_t *> (a.data ()));
       A.nz = -1;
 
       BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;
@@ -1075,7 +1089,8 @@
       octave_idx_type b_nc = b.cols ();
       octave_idx_type nc = N->L->n;
       octave_idx_type nr = nrows;
-      const cs_complex_t *bvec = reinterpret_cast<const cs_complex_t *> (b.fortran_vec ());
+      const cs_complex_t *bvec
+        = reinterpret_cast<const cs_complex_t *> (b.fortran_vec ());
       ComplexMatrix ret (b_nr, b_nc);
       Complex *vec = ret.fortran_vec ();
 
--- a/liboctave/numeric/sparse-qr.h	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/sparse-qr.h	Tue May 09 08:46:07 2017 -0700
@@ -26,10 +26,12 @@
 
 #include "octave-config.h"
 
-#include "dMatrix.h"
-#include "CMatrix.h"
-#include "dSparse.h"
-#include "CSparse.h"
+class Matrix;
+class ComplexMatrix;
+class SparseComplexMatrix;
+class SparseMatrix;
+class ColumnVector;
+template <typename T> class MArray;
 
 namespace octave
 {
--- a/liboctave/numeric/svd.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/numeric/svd.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,20 +25,19 @@
 #  include "config.h"
 #endif
 
-#include "svd.h"
+#include <cassert>
 
-#include <cassert>
 #include <algorithm>
 
 #include "CMatrix.h"
 #include "dDiagMatrix.h"
-#include "fDiagMatrix.h"
 #include "dMatrix.h"
 #include "fCMatrix.h"
+#include "fDiagMatrix.h"
 #include "fMatrix.h"
 #include "lo-error.h"
 #include "lo-lapack-proto.h"
-#include "oct-locbuf.h"
+#include "svd.h"
 
 namespace octave
 {
@@ -66,7 +65,6 @@
       return right_sm;
     }
 
-
     // GESVD specializations
 
 #define GESVD_REAL_STEP(f, F)                                   \
@@ -164,7 +162,6 @@
 #undef GESVD_REAL_STEP
 #undef GESVD_COMPLEX_STEP
 
-
     // GESDD specializations
 
 #define GESDD_REAL_STEP(f, F)                                           \
@@ -274,7 +271,6 @@
 #undef GESDD_REAL_STEP
 #undef GESDD_COMPLEX_STEP
 
-
     template<typename T>
     svd<T>::svd (const T& a, svd::Type type,
                  svd::Driver driver)
@@ -335,11 +331,10 @@
 
         case svd::Type::sigma_only:
 
-          // Note:  for this case, both jobu and jobv should be 'N', but
-          // there seems to be a bug in dgesvd from Lapack V2.0.  To
-          // demonstrate the bug, set both jobu and jobv to 'N' and find
-          // the singular values of [eye(3), eye(3)].  The result is
-          // [-sqrt(2), -sqrt(2), -sqrt(2)].
+          // Note:  for this case, both jobu and jobv should be 'N', but there
+          // seems to be a bug in dgesvd from Lapack V2.0.  To demonstrate the
+          // bug, set both jobu and jobv to 'N' and find the singular values of
+          // [eye(3), eye(3)].  The result is [-sqrt(2), -sqrt(2), -sqrt(2)].
           //
           // For Lapack 3.0, this problem seems to be fixed.
 
--- a/liboctave/operators/mx-inlines.cc	Mon May 08 20:58:14 2017 -0700
+++ b/liboctave/operators/mx-inlines.cc	Tue May 09 08:46:07 2017 -0700
@@ -25,24 +25,20 @@
 #if ! defined (octave_mx_inlines_h)
 #define octave_mx_inlines_h 1
 
-// This file should not include config.h.  It is only included in other
-// C++ source files that should have included config.h before including
-// this file.
+// This file should *not* include config.h.  It is only included in other C++
+// source files that should have included config.h before including this file.
 
 #include <cstddef>
 #include <cmath>
-#include <cstring>
-#include <memory>
+
+#include <algorithm>
 
-#include "quit.h"
-
+#include "Array-util.h"
+#include "Array.h"
+#include "bsxfun.h"
 #include "oct-cmplx.h"
+#include "oct-inttypes.h"
 #include "oct-locbuf.h"
-#include "oct-inttypes.h"
-#include "Array.h"
-#include "Array-util.h"
-
-#include "bsxfun.h"
 
 // Provides some commonly repeated, basic loop templates.