changeset 22317:6ca3acf5fad8

move some new numeric classes to namespace octave::math * aepbalance.cc, aepbalance.h, chol.cc, chol.h, gepbalance.cc, gepbalance.h, hess.cc, hess.h, lu.cc, lu.h, qr.cc, qr.h, qrp.cc, qrp.h, 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, svd.h: Move classes to namespace octave::math. * __luinc__.cc, __qp__.cc, balance.cc, hess.cc, lu.cc, qz.cc, schur.cc, sqrtm.cc, svd.cc, chol.cc, dmperm.cc, qr.cc, lex.h, CMatrix.cc, CSparse.cc, dMatrix.cc, dSparse.cc, fCMatrix.cc, fMatrix.cc, eigs-base.cc, oct-norm.cc: Update for new namespaces.
author John W. Eaton <jwe@octave.org>
date Tue, 16 Aug 2016 15:48:22 -0400
parents b67a29a96056
children 0e8c36397197
files libinterp/corefcn/__luinc__.cc libinterp/corefcn/__qp__.cc libinterp/corefcn/balance.cc libinterp/corefcn/hess.cc libinterp/corefcn/lu.cc libinterp/corefcn/qz.cc libinterp/corefcn/schur.cc libinterp/corefcn/sqrtm.cc libinterp/corefcn/svd.cc libinterp/dldfcn/chol.cc libinterp/dldfcn/dmperm.cc libinterp/dldfcn/qr.cc libinterp/parse-tree/lex.h liboctave/array/CMatrix.cc liboctave/array/CSparse.cc liboctave/array/dMatrix.cc liboctave/array/dSparse.cc liboctave/array/fCMatrix.cc liboctave/array/fMatrix.cc liboctave/numeric/aepbalance.cc liboctave/numeric/aepbalance.h liboctave/numeric/chol.cc liboctave/numeric/chol.h liboctave/numeric/eigs-base.cc liboctave/numeric/gepbalance.cc liboctave/numeric/gepbalance.h liboctave/numeric/hess.cc liboctave/numeric/hess.h liboctave/numeric/lu.cc liboctave/numeric/lu.h liboctave/numeric/oct-norm.cc liboctave/numeric/qr.cc liboctave/numeric/qr.h liboctave/numeric/qrp.cc liboctave/numeric/qrp.h 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/numeric/svd.h
diffstat 46 files changed, 386 insertions(+), 190 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__luinc__.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/__luinc__.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -145,8 +145,8 @@
         case 1:
         case 2:
           {
-            sparse_lu<SparseMatrix> fact (sm, Qinit, thresh, false, true, droptol,
-                           milu, udiag);
+            octave::math::sparse_lu<SparseMatrix> fact
+              (sm, Qinit, thresh, false, true, droptol, milu, udiag);
 
             SparseMatrix P = fact.Pr ();
             SparseMatrix L = P.transpose () * fact.L ();
@@ -162,8 +162,8 @@
 
         case 3:
           {
-            sparse_lu<SparseMatrix> fact (sm, Qinit, thresh, false, true, droptol,
-                           milu, udiag);
+            octave::math::sparse_lu<SparseMatrix> fact
+              (sm, Qinit, thresh, false, true, droptol, milu, udiag);
 
             if (vecout)
               retval(2) = fact.Pr_vec ();
@@ -181,8 +181,8 @@
         case 4:
         default:
           {
-            sparse_lu<SparseMatrix> fact (sm, Qinit, thresh, false, false, droptol,
-                           milu, udiag);
+            octave::math::sparse_lu<SparseMatrix> fact
+              (sm, Qinit, thresh, false, false, droptol, milu, udiag);
 
             if (vecout)
               {
@@ -220,8 +220,8 @@
         case 1:
         case 2:
           {
-            sparse_lu<SparseComplexMatrix> fact (sm, Qinit, thresh, false, true,
-                                  droptol, milu, udiag);
+            octave::math::sparse_lu<SparseComplexMatrix> fact
+              (sm, Qinit, thresh, false, true, droptol, milu, udiag);
 
             SparseMatrix P = fact.Pr ();
             SparseComplexMatrix L = P.transpose () * fact.L ();
@@ -237,8 +237,8 @@
 
         case 3:
           {
-            sparse_lu<SparseComplexMatrix> fact (sm, Qinit, thresh, false, true,
-                                  droptol, milu, udiag);
+            octave::math::sparse_lu<SparseComplexMatrix> fact
+              (sm, Qinit, thresh, false, true, droptol, milu, udiag);
 
             if (vecout)
               retval(2) = fact.Pr_vec ();
@@ -256,8 +256,8 @@
         case 4:
         default:
           {
-            sparse_lu<SparseComplexMatrix> fact (sm, Qinit, thresh, false, false,
-                                  droptol, milu, udiag);
+            octave::math::sparse_lu<SparseComplexMatrix> fact
+              (sm, Qinit, thresh, false, false, droptol, milu, udiag);
 
             if (vecout)
               {
--- a/libinterp/corefcn/__qp__.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/__qp__.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -47,7 +47,7 @@
 
   if (! A.is_empty ())
     {
-      svd<Matrix> A_svd (A);
+      octave::math::svd<Matrix> A_svd (A);
 
       DiagMatrix S = A_svd.singular_values ();
 
@@ -191,11 +191,11 @@
               // factorization since the Hessian is positive
               // definite.
 
-              chol<Matrix> cholH (H);
+              octave::math::chol<Matrix> cholH (H);
 
               R = cholH.chol_matrix ();
 
-              Matrix Hinv = chol2inv (R);
+              Matrix Hinv = octave::math::chol2inv (R);
 
               // Computing the unconstrained step.
               // p = -Hinv * g;
@@ -250,7 +250,7 @@
               // Computing the Cholesky factorization (pR = 0 means
               // that the reduced Hessian was positive definite).
 
-              chol<Matrix> cholrH (rH, pR);
+              octave::math::chol<Matrix> cholrH (rH, pR);
               Matrix tR = cholrH.chol_matrix ();
               if (pR == 0)
                 R = tR;
@@ -265,7 +265,7 @@
                 {
                   // Using the Cholesky factorization to invert rH
 
-                  Matrix rHinv = chol2inv (R);
+                  Matrix rHinv = octave::math::chol2inv (R);
 
                   ColumnVector pz = -rHinv * Zt * g;
 
--- a/libinterp/corefcn/balance.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/balance.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -150,7 +150,7 @@
         {
           if (complex_case)
             {
-              aepbalance<FloatComplexMatrix> result (fcaa, noperm, noscal);
+              octave::math::aepbalance<FloatComplexMatrix> result (fcaa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
                 retval = ovl (result.balanced_matrix ());
@@ -164,7 +164,7 @@
             }
           else
             {
-              aepbalance<FloatMatrix> result (faa, noperm, noscal);
+              octave::math::aepbalance<FloatMatrix> result (faa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
                 retval = ovl (result.balanced_matrix ());
@@ -181,7 +181,7 @@
         {
           if (complex_case)
             {
-              aepbalance<ComplexMatrix> result (caa, noperm, noscal);
+              octave::math::aepbalance<ComplexMatrix> result (caa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
                 retval = ovl (result.balanced_matrix ());
@@ -195,7 +195,7 @@
             }
           else
             {
-              aepbalance<Matrix> result (aa, noperm, noscal);
+              octave::math::aepbalance<Matrix> result (aa, noperm, noscal);
 
               if (nargout == 0 || nargout == 1)
                 retval = ovl (result.balanced_matrix ());
@@ -249,7 +249,7 @@
         {
           if (complex_case)
             {
-              gepbalance<FloatComplexMatrix> result (fcaa, fcbb, bal_job);
+              octave::math::gepbalance<FloatComplexMatrix> result (fcaa, fcbb, bal_job);
 
               switch (nargout)
                 {
@@ -274,7 +274,7 @@
             }
           else
             {
-              gepbalance<FloatMatrix> result (faa, fbb, bal_job);
+              octave::math::gepbalance<FloatMatrix> result (faa, fbb, bal_job);
 
               switch (nargout)
                 {
@@ -302,7 +302,7 @@
         {
           if (complex_case)
             {
-              gepbalance<ComplexMatrix> result (caa, cbb, bal_job);
+              octave::math::gepbalance<ComplexMatrix> result (caa, cbb, bal_job);
 
               switch (nargout)
                 {
@@ -327,7 +327,7 @@
             }
           else
             {
-              gepbalance<Matrix> result (aa, bb, bal_job);
+              octave::math::gepbalance<Matrix> result (aa, bb, bal_job);
 
               switch (nargout)
                 {
--- a/libinterp/corefcn/hess.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/hess.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -87,7 +87,7 @@
         {
           FloatMatrix tmp = arg.float_matrix_value ();
 
-          hess<FloatMatrix> result (tmp);
+          octave::math::hess<FloatMatrix> result (tmp);
 
           if (nargout <= 1)
             retval = ovl (result.hess_matrix ());
@@ -99,7 +99,7 @@
         {
           FloatComplexMatrix ctmp = arg.float_complex_matrix_value ();
 
-          hess<FloatComplexMatrix> result (ctmp);
+          octave::math::hess<FloatComplexMatrix> result (ctmp);
 
           if (nargout <= 1)
             retval = ovl (result.hess_matrix ());
@@ -114,7 +114,7 @@
         {
           Matrix tmp = arg.matrix_value ();
 
-          hess<Matrix> result (tmp);
+          octave::math::hess<Matrix> result (tmp);
 
           if (nargout <= 1)
             retval = ovl (result.hess_matrix ());
@@ -126,7 +126,7 @@
         {
           ComplexMatrix ctmp = arg.complex_matrix_value ();
 
-          hess<ComplexMatrix> result (ctmp);
+          octave::math::hess<ComplexMatrix> result (ctmp);
 
           if (nargout <= 1)
             retval = ovl (result.hess_matrix ());
--- a/libinterp/corefcn/lu.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/lu.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -37,7 +37,7 @@
 
 template <typename MT>
 static octave_value
-get_lu_l (const lu<MT>& fact)
+get_lu_l (const octave::math::lu<MT>& fact)
 {
   MT L = fact.L ();
   if (L.is_square ())
@@ -48,7 +48,7 @@
 
 template <typename MT>
 static octave_value
-get_lu_u (const lu<MT>& fact)
+get_lu_u (const octave::math::lu<MT>& fact)
 {
   MT U = fact.U ();
   if (U.is_square () && fact.regular ())
@@ -204,7 +204,7 @@
               ColumnVector Qinit (nc);
               for (octave_idx_type i = 0; i < nc; i++)
                 Qinit(i) = i;
-              sparse_lu<SparseMatrix> fact (m, Qinit, thres, false, true);
+              octave::math::sparse_lu<SparseMatrix> fact (m, Qinit, thres, false, true);
 
               if (nargout < 2)
                 retval(0) = fact.Y ();
@@ -238,7 +238,7 @@
           else
             {
               retval.resize (scale ? 5 : 4);
-              sparse_lu<SparseMatrix> fact (m, thres, scale);
+              octave::math::sparse_lu<SparseMatrix> fact (m, thres, scale);
 
               retval(0) = octave_value (fact.L (),
                                         MatrixType (MatrixType::Lower));
@@ -269,7 +269,7 @@
               ColumnVector Qinit (nc);
               for (octave_idx_type i = 0; i < nc; i++)
                 Qinit(i) = i;
-              sparse_lu<SparseComplexMatrix> fact (m, Qinit, thres, false, true);
+              octave::math::sparse_lu<SparseComplexMatrix> fact (m, Qinit, thres, false, true);
 
               if (nargout < 2)
                 retval(0) = fact.Y ();
@@ -302,7 +302,7 @@
           else
             {
               retval.resize (scale ? 5 : 4);
-              sparse_lu<SparseComplexMatrix> fact (m, thres, scale);
+              octave::math::sparse_lu<SparseComplexMatrix> fact (m, thres, scale);
 
               retval(0) = octave_value (fact.L (),
                                         MatrixType (MatrixType::Lower));
@@ -341,7 +341,7 @@
             {
               FloatMatrix m = arg.float_matrix_value ();
 
-              lu<FloatMatrix> fact (m);
+              octave::math::lu<FloatMatrix> fact (m);
 
               switch (nargout)
                 {
@@ -375,7 +375,7 @@
             {
               Matrix m = arg.matrix_value ();
 
-              lu<Matrix> fact (m);
+              octave::math::lu<Matrix> fact (m);
 
               switch (nargout)
                 {
@@ -412,7 +412,7 @@
             {
               FloatComplexMatrix m = arg.float_complex_matrix_value ();
 
-              lu<FloatComplexMatrix> fact (m);
+              octave::math::lu<FloatComplexMatrix> fact (m);
 
               switch (nargout)
                 {
@@ -446,7 +446,7 @@
             {
               ComplexMatrix m = arg.complex_matrix_value ();
 
-              lu<ComplexMatrix> fact (m);
+              octave::math::lu<ComplexMatrix> fact (m);
 
               switch (nargout)
                 {
@@ -647,7 +647,7 @@
           FloatMatrix x = argx.float_matrix_value ();
           FloatMatrix y = argy.float_matrix_value ();
 
-          lu<FloatMatrix> fact (L, U, P);
+          octave::math::lu<FloatMatrix> fact (L, U, P);
           if (pivoted)
             fact.update_piv (x, y);
           else
@@ -665,7 +665,7 @@
           Matrix x = argx.matrix_value ();
           Matrix y = argy.matrix_value ();
 
-          lu<Matrix> fact (L, U, P);
+          octave::math::lu<Matrix> fact (L, U, P);
           if (pivoted)
             fact.update_piv (x, y);
           else
@@ -688,7 +688,7 @@
           FloatComplexMatrix x = argx.float_complex_matrix_value ();
           FloatComplexMatrix y = argy.float_complex_matrix_value ();
 
-          lu<FloatComplexMatrix> fact (L, U, P);
+          octave::math::lu<FloatComplexMatrix> fact (L, U, P);
           if (pivoted)
             fact.update_piv (x, y);
           else
@@ -706,7 +706,7 @@
           ComplexMatrix x = argx.complex_matrix_value ();
           ComplexMatrix y = argy.complex_matrix_value ();
 
-          lu<ComplexMatrix> fact (L, U, P);
+          octave::math::lu<ComplexMatrix> fact (L, U, P);
           if (pivoted)
             fact.update_piv (x, y);
           else
--- a/libinterp/corefcn/qz.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/qz.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -613,7 +613,7 @@
       // Complex case.
 
       // The QR decomposition of cbb.
-      qr<ComplexMatrix> cbqr (cbb);
+      octave::math::qr<ComplexMatrix> cbqr (cbb);
       // The R matrix of QR decomposition for cbb.
       cbb = cbqr.R ();
       // (Q*)caa for following work.
@@ -679,7 +679,7 @@
 #endif
 
       // Compute the QR factorization of bb.
-      qr<Matrix> bqr (bb);
+      octave::math::qr<Matrix> bqr (bb);
 
 #if defined (DEBUG)
       std::cout << "qz: qr (bb) done; now peforming qz decomposition"
--- a/libinterp/corefcn/schur.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/schur.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -179,12 +179,12 @@
 
           if (nargout <= 1)
             {
-              schur<FloatMatrix> result (tmp, ord, false);
+              octave::math::schur<FloatMatrix> result (tmp, ord, false);
               retval = ovl (result.schur_matrix ());
             }
           else
             {
-              schur<FloatMatrix> result (tmp, ord, true);
+              octave::math::schur<FloatMatrix> result (tmp, ord, true);
               retval = ovl (result.unitary_matrix (),
                             result.schur_matrix ());
             }
@@ -195,12 +195,12 @@
 
           if (nargout <= 1)
             {
-              schur<FloatComplexMatrix> result (ctmp, ord, false);
+              octave::math::schur<FloatComplexMatrix> result (ctmp, ord, false);
               retval = ovl (mark_upper_triangular (result.schur_matrix ()));
             }
           else
             {
-              schur<FloatComplexMatrix> result (ctmp, ord, true);
+              octave::math::schur<FloatComplexMatrix> result (ctmp, ord, true);
               retval = ovl (result.unitary_matrix (),
                             mark_upper_triangular (result.schur_matrix ()));
             }
@@ -214,12 +214,12 @@
 
           if (nargout <= 1)
             {
-              schur<Matrix> result (tmp, ord, false);
+              octave::math::schur<Matrix> result (tmp, ord, false);
               retval = ovl (result.schur_matrix ());
             }
           else
             {
-              schur<Matrix> result (tmp, ord, true);
+              octave::math::schur<Matrix> result (tmp, ord, true);
               retval = ovl (result.unitary_matrix (),
                             result.schur_matrix ());
             }
@@ -230,12 +230,12 @@
 
           if (nargout <= 1)
             {
-              schur<ComplexMatrix> result (ctmp, ord, false);
+              octave::math::schur<ComplexMatrix> result (ctmp, ord, false);
               retval = ovl (mark_upper_triangular (result.schur_matrix ()));
             }
           else
             {
-              schur<ComplexMatrix> result (ctmp, ord, true);
+              octave::math::schur<ComplexMatrix> result (ctmp, ord, true);
               retval = ovl (result.unitary_matrix (),
                             mark_upper_triangular (result.schur_matrix ()));
             }
@@ -301,8 +301,8 @@
       FloatMatrix u = args(0).float_matrix_value ();
       FloatMatrix t = args(1).float_matrix_value ();
 
-      schur<FloatComplexMatrix> cs
-        = rsf2csf<FloatComplexMatrix, FloatMatrix> (t, u);
+      octave::math::schur<FloatComplexMatrix> cs
+        = octave::math::rsf2csf<FloatComplexMatrix, FloatMatrix> (t, u);
 
       return ovl (cs.unitary_matrix (), cs.schur_matrix ());
     }
@@ -311,7 +311,8 @@
       Matrix u = args(0).matrix_value ();
       Matrix t = args(1).matrix_value ();
 
-      schur<ComplexMatrix> cs = rsf2csf<ComplexMatrix, Matrix> (t, u);
+      octave::math::schur<ComplexMatrix> cs
+        = octave::math::rsf2csf<ComplexMatrix, Matrix> (t, u);
 
       return ovl (cs.unitary_matrix (), cs.schur_matrix ());
     }
--- a/libinterp/corefcn/sqrtm.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/sqrtm.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -234,9 +234,10 @@
     retval(0) = arg.sqrt ();
   else if (arg.is_single_type ())
     retval(0) = do_sqrtm<FloatMatrix, FloatComplexMatrix,
-                         schur<FloatComplexMatrix> > (arg);
+                         octave::math::schur<FloatComplexMatrix> > (arg);
   else if (arg.is_numeric_type ())
-    retval(0) = do_sqrtm<Matrix, ComplexMatrix, schur<ComplexMatrix> > (arg);
+    retval(0) = do_sqrtm<Matrix, ComplexMatrix,
+                         octave::math::schur<ComplexMatrix> > (arg);
 
   if (nargout > 1)
     {
--- a/libinterp/corefcn/svd.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/corefcn/svd.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -37,19 +37,23 @@
 static std::string Vsvd_driver = "gesvd";
 
 template <typename T>
-static typename svd<T>::Type
+static typename octave::math::svd<T>::Type
 svd_type (int nargin, int nargout)
 {
   return ((nargout == 0 || nargout == 1)
-          ? svd<T>::Type::sigma_only
-          : (nargin == 2) ? svd<T>::Type::economy : svd<T>::Type::std);
+          ? octave::math::svd<T>::Type::sigma_only
+          : ((nargin == 2)
+             ? octave::math::svd<T>::Type::economy
+             : octave::math::svd<T>::Type::std));
 }
 
 template <typename T>
-static typename svd<T>::Driver
+static typename octave::math::svd<T>::Driver
 svd_driver (void)
 {
-  return Vsvd_driver == "gesvd" ? svd<T>::Driver::GESVD : svd<T>::Driver::GESDD;
+  return (Vsvd_driver == "gesvd"
+          ? octave::math::svd<T>::Driver::GESVD
+          : octave::math::svd<T>::Driver::GESDD);
 }
 
 DEFUN (svd, args, nargout,
@@ -160,9 +164,9 @@
           if (tmp.any_element_is_inf_or_nan ())
             error ("svd: cannot take SVD of matrix containing Inf or NaN values");
 
-          svd<FloatMatrix> result (tmp,
-                                   svd_type<FloatMatrix> (nargin, nargout),
-                                   svd_driver<FloatMatrix> ());
+          octave::math::svd<FloatMatrix> result
+            (tmp, svd_type<FloatMatrix> (nargin, nargout),
+             svd_driver<FloatMatrix> ());
 
           FloatDiagMatrix sigma = result.singular_values ();
 
@@ -180,9 +184,9 @@
           if (ctmp.any_element_is_inf_or_nan ())
             error ("svd: cannot take SVD of matrix containing Inf or NaN values");
 
-          svd<FloatComplexMatrix> result (ctmp,
-                                          svd_type<FloatComplexMatrix> (nargin, nargout),
-                                          svd_driver<FloatComplexMatrix> ());
+          octave::math::svd<FloatComplexMatrix> result
+            (ctmp, svd_type<FloatComplexMatrix> (nargin, nargout),
+             svd_driver<FloatComplexMatrix> ());
 
           FloatDiagMatrix sigma = result.singular_values ();
 
@@ -203,9 +207,9 @@
           if (tmp.any_element_is_inf_or_nan ())
             error ("svd: cannot take SVD of matrix containing Inf or NaN values");
 
-          svd<Matrix> result (tmp,
-                              svd_type<Matrix> (nargin, nargout),
-                              svd_driver<Matrix> ());
+          octave::math::svd<Matrix> result
+            (tmp, svd_type<Matrix> (nargin, nargout),
+             svd_driver<Matrix> ());
 
           DiagMatrix sigma = result.singular_values ();
 
@@ -223,9 +227,9 @@
           if (ctmp.any_element_is_inf_or_nan ())
             error ("svd: cannot take SVD of matrix containing Inf or NaN values");
 
-          svd<ComplexMatrix> result (ctmp,
-                                     svd_type<ComplexMatrix> (nargin, nargout),
-                                     svd_driver<ComplexMatrix> ());
+          octave::math::svd<ComplexMatrix> result
+            (ctmp, svd_type<ComplexMatrix> (nargin, nargout),
+             svd_driver<ComplexMatrix> ());
 
           DiagMatrix sigma = result.singular_values ();
 
--- a/libinterp/dldfcn/chol.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/dldfcn/chol.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -199,7 +199,7 @@
         {
           SparseMatrix m = arg.sparse_matrix_value ();
 
-          sparse_chol<SparseMatrix> fact (m, info, natural, force);
+          octave::math::sparse_chol<SparseMatrix> fact (m, info, natural, force);
 
           if (nargout == 3)
             {
@@ -224,7 +224,7 @@
         {
           SparseComplexMatrix m = arg.sparse_complex_matrix_value ();
 
-          sparse_chol<SparseComplexMatrix> fact (m, info, natural, force);
+          octave::math::sparse_chol<SparseComplexMatrix> fact (m, info, natural, force);
 
           if (nargout == 3)
             {
@@ -258,7 +258,7 @@
 
           octave_idx_type info;
 
-          chol<FloatMatrix> fact (m, info, LLt != true);
+          octave::math::chol<FloatMatrix> fact (m, info, LLt != true);
 
           if (nargout == 2 || info == 0)
             retval = ovl (get_chol (fact), info);
@@ -271,7 +271,7 @@
 
           octave_idx_type info;
 
-          chol<FloatComplexMatrix> fact (m, info, LLt != true);
+          octave::math::chol<FloatComplexMatrix> fact (m, info, LLt != true);
 
           if (nargout == 2 || info == 0)
             retval = ovl (get_chol (fact), info);
@@ -291,7 +291,7 @@
 
           octave_idx_type info;
 
-          chol<Matrix> fact (m, info, LLt != true);
+          octave::math::chol<Matrix> fact (m, info, LLt != true);
 
           if (nargout == 2 || info == 0)
             retval = ovl (get_chol (fact), info);
@@ -304,7 +304,7 @@
 
           octave_idx_type info;
 
-          chol<ComplexMatrix> fact (m, info, LLt != true);
+          octave::math::chol<ComplexMatrix> fact (m, info, LLt != true);
 
           if (nargout == 2 || info == 0)
             retval = ovl (get_chol (fact), info);
@@ -393,7 +393,7 @@
             {
               SparseMatrix m = arg.sparse_matrix_value ();
 
-              sparse_chol<SparseMatrix> chol (m, info);
+              octave::math::sparse_chol<SparseMatrix> chol (m, info);
 
               if (info == 0)
                 retval = chol.inverse ();
@@ -404,7 +404,7 @@
             {
               SparseComplexMatrix m = arg.sparse_complex_matrix_value ();
 
-              sparse_chol<SparseComplexMatrix> chol (m, info);
+              octave::math::sparse_chol<SparseComplexMatrix> chol (m, info);
 
               if (info == 0)
                 retval = chol.inverse ();
@@ -421,7 +421,7 @@
               FloatMatrix m = arg.float_matrix_value ();
 
               octave_idx_type info;
-              chol<FloatMatrix> chol (m, info);
+              octave::math::chol<FloatMatrix> chol (m, info);
               if (info == 0)
                 retval = chol.inverse ();
               else
@@ -432,7 +432,7 @@
               FloatComplexMatrix m = arg.float_complex_matrix_value ();
 
               octave_idx_type info;
-              chol<FloatComplexMatrix> chol (m, info);
+              octave::math::chol<FloatComplexMatrix> chol (m, info);
               if (info == 0)
                 retval = chol.inverse ();
               else
@@ -448,7 +448,7 @@
               Matrix m = arg.matrix_value ();
 
               octave_idx_type info;
-              chol<Matrix> chol (m, info);
+              octave::math::chol<Matrix> chol (m, info);
               if (info == 0)
                 retval = chol.inverse ();
               else
@@ -459,7 +459,7 @@
               ComplexMatrix m = arg.complex_matrix_value ();
 
               octave_idx_type info;
-              chol<ComplexMatrix> chol (m, info);
+              octave::math::chol<ComplexMatrix> chol (m, info);
               if (info == 0)
                 retval = chol.inverse ();
               else
@@ -520,13 +520,13 @@
             {
               SparseMatrix r = arg.sparse_matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else if (arg.is_complex_type ())
             {
               SparseComplexMatrix r = arg.sparse_complex_matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else
             err_wrong_type_arg ("chol2inv", arg);
@@ -537,13 +537,13 @@
             {
               FloatMatrix r = arg.float_matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else if (arg.is_complex_type ())
             {
               FloatComplexMatrix r = arg.float_complex_matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else
             err_wrong_type_arg ("chol2inv", arg);
@@ -555,13 +555,13 @@
             {
               Matrix r = arg.matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else if (arg.is_complex_type ())
             {
               ComplexMatrix r = arg.complex_matrix_value ();
 
-              retval = chol2inv (r);
+              retval = octave::math::chol2inv (r);
             }
           else
             err_wrong_type_arg ("chol2inv", arg);
@@ -667,7 +667,7 @@
           FloatMatrix R = argr.float_matrix_value ();
           FloatColumnVector u = argu.float_column_vector_value ();
 
-          chol<FloatMatrix> fact;
+          octave::math::chol<FloatMatrix> fact;
           fact.set (R);
 
           if (down)
@@ -684,7 +684,7 @@
           FloatComplexColumnVector u =
             argu.float_complex_column_vector_value ();
 
-          chol<FloatComplexMatrix> fact;
+          octave::math::chol<FloatComplexMatrix> fact;
           fact.set (R);
 
           if (down)
@@ -703,7 +703,7 @@
           Matrix R = argr.matrix_value ();
           ColumnVector u = argu.column_vector_value ();
 
-          chol<Matrix> fact;
+          octave::math::chol<Matrix> fact;
           fact.set (R);
 
           if (down)
@@ -719,7 +719,7 @@
           ComplexMatrix R = argr.complex_matrix_value ();
           ComplexColumnVector u = argu.complex_column_vector_value ();
 
-          chol<ComplexMatrix> fact;
+          octave::math::chol<ComplexMatrix> fact;
           fact.set (R);
 
           if (down)
@@ -858,7 +858,7 @@
           FloatMatrix R = argr.float_matrix_value ();
           FloatColumnVector u = argu.float_column_vector_value ();
 
-          chol<FloatMatrix> fact;
+          octave::math::chol<FloatMatrix> fact;
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
@@ -871,7 +871,7 @@
           FloatComplexColumnVector u =
             argu.float_complex_column_vector_value ();
 
-          chol<FloatComplexMatrix> fact;
+          octave::math::chol<FloatComplexMatrix> fact;
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
@@ -886,7 +886,7 @@
           Matrix R = argr.matrix_value ();
           ColumnVector u = argu.column_vector_value ();
 
-          chol<Matrix> fact;
+          octave::math::chol<Matrix> fact;
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
@@ -899,7 +899,7 @@
           ComplexColumnVector u =
             argu.complex_column_vector_value ();
 
-          chol<ComplexMatrix> fact;
+          octave::math::chol<ComplexMatrix> fact;
           fact.set (R);
           err = fact.insert_sym (u, j-1);
 
@@ -1093,7 +1093,7 @@
           // real case
           FloatMatrix R = argr.float_matrix_value ();
 
-          chol<FloatMatrix> fact;
+          octave::math::chol<FloatMatrix> fact;
           fact.set (R);
           fact.delete_sym (j-1);
 
@@ -1104,7 +1104,7 @@
           // complex case
           FloatComplexMatrix R = argr.float_complex_matrix_value ();
 
-          chol<FloatComplexMatrix> fact;
+          octave::math::chol<FloatComplexMatrix> fact;
           fact.set (R);
           fact.delete_sym (j-1);
 
@@ -1118,7 +1118,7 @@
           // real case
           Matrix R = argr.matrix_value ();
 
-          chol<Matrix> fact;
+          octave::math::chol<Matrix> fact;
           fact.set (R);
           fact.delete_sym (j-1);
 
@@ -1129,7 +1129,7 @@
           // complex case
           ComplexMatrix R = argr.complex_matrix_value ();
 
-          chol<ComplexMatrix> fact;
+          octave::math::chol<ComplexMatrix> fact;
           fact.set (R);
           fact.delete_sym (j-1);
 
@@ -1223,7 +1223,7 @@
           // real case
           FloatMatrix R = argr.float_matrix_value ();
 
-          chol<FloatMatrix> fact;
+          octave::math::chol<FloatMatrix> fact;
           fact.set (R);
           fact.shift_sym (i-1, j-1);
 
@@ -1234,7 +1234,7 @@
           // complex case
           FloatComplexMatrix R = argr.float_complex_matrix_value ();
 
-          chol<FloatComplexMatrix> fact;
+          octave::math::chol<FloatComplexMatrix> fact;
           fact.set (R);
           fact.shift_sym (i-1, j-1);
 
@@ -1248,7 +1248,7 @@
           // real case
           Matrix R = argr.matrix_value ();
 
-          chol<Matrix> fact;
+          octave::math::chol<Matrix> fact;
           fact.set (R);
           fact.shift_sym (i-1, j-1);
 
@@ -1259,7 +1259,7 @@
           // complex case
           ComplexMatrix R = argr.complex_matrix_value ();
 
-          chol<ComplexMatrix> fact;
+          octave::math::chol<ComplexMatrix> fact;
           fact.set (R);
           fact.shift_sym (i-1, j-1);
 
--- a/libinterp/dldfcn/dmperm.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/dldfcn/dmperm.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -34,7 +34,6 @@
 #include "oct-sparse.h"
 #include "ov-re-sparse.h"
 #include "ov-cx-sparse.h"
-#include "sparse-qr.h"
 
 #if defined (OCTAVE_ENABLE_64)
 #  define CXSPARSE_NAME(name) cs_dl ## name
--- a/libinterp/dldfcn/qr.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/dldfcn/qr.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -38,7 +38,7 @@
 
 template <typename MT>
 static octave_value
-get_qr_r (const qr<MT>& fact)
+get_qr_r (const octave::math::qr<MT>& fact)
 {
   MT R = fact.R ();
   if (R.is_square () && fact.regular ())
@@ -48,12 +48,12 @@
 }
 
 template <typename T>
-static typename qr<T>::type
+static typename octave::math::qr<T>::type
 qr_type (int nargin, int nargout)
 {
   return ((nargout == 0 || nargout == 1)
-          ? qr<T>::raw
-          : (nargin == 2) ? qr<T>::economy : qr<T>::std);
+          ? octave::math::qr<T>::raw
+          : (nargin == 2) ? octave::math::qr<T>::economy : octave::math::qr<T>::std);
 }
 
 // [Q, R] = qr (X):      form Q unitary and R upper triangular such
@@ -276,7 +276,7 @@
 
       if (is_cmplx)
         {
-          sparse_qr<SparseComplexMatrix> q (arg.sparse_complex_matrix_value ());
+          octave::math::sparse_qr<SparseComplexMatrix> q (arg.sparse_complex_matrix_value ());
 
           if (have_b)
             {
@@ -293,7 +293,7 @@
         }
       else
         {
-          sparse_qr<SparseMatrix> q (arg.sparse_matrix_value ());
+          octave::math::sparse_qr<SparseMatrix> q (arg.sparse_matrix_value ());
 
           if (have_b)
             {
@@ -314,7 +314,7 @@
         {
           if (arg.is_real_type ())
             {
-              qr<FloatMatrix>::type type
+              octave::math::qr<FloatMatrix>::type type
                 = qr_type<FloatMatrix> (nargin, nargout);
 
               FloatMatrix m = arg.float_matrix_value ();
@@ -324,14 +324,14 @@
                 case 0:
                 case 1:
                   {
-                    qr<FloatMatrix> fact (m, type);
+                    octave::math::qr<FloatMatrix> fact (m, type);
                     retval = ovl (fact.R ());
                   }
                   break;
 
                 case 2:
                   {
-                    qr<FloatMatrix> fact (m, type);
+                    octave::math::qr<FloatMatrix> fact (m, type);
                     retval = ovl (fact.Q (), get_qr_r (fact));
                     if (have_b)
                       {
@@ -347,9 +347,9 @@
 
                 default:
                   {
-                    qrp<FloatMatrix> fact (m, type);
+                    octave::math::qrp<FloatMatrix> fact (m, type);
 
-                    if (type == qr<FloatMatrix>::economy || vector_p)
+                    if (type == octave::math::qr<FloatMatrix>::economy || vector_p)
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.Pvec ());
                     else
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.P ());
@@ -359,7 +359,7 @@
             }
           else if (arg.is_complex_type ())
             {
-              qr<FloatComplexMatrix>::type type
+              octave::math::qr<FloatComplexMatrix>::type type
                 = qr_type<FloatComplexMatrix> (nargin, nargout);
 
               FloatComplexMatrix m = arg.float_complex_matrix_value ();
@@ -369,14 +369,14 @@
                 case 0:
                 case 1:
                   {
-                    qr<FloatComplexMatrix> fact (m, type);
+                    octave::math::qr<FloatComplexMatrix> fact (m, type);
                     retval = ovl (fact.R ());
                   }
                   break;
 
                 case 2:
                   {
-                    qr<FloatComplexMatrix> fact (m, type);
+                    octave::math::qr<FloatComplexMatrix> fact (m, type);
                     retval = ovl (fact.Q (), get_qr_r (fact));
                     if (have_b)
                       retval (0) = conj (fact.Q ().transpose ())
@@ -386,8 +386,8 @@
 
                 default:
                   {
-                    qrp<FloatComplexMatrix> fact (m, type);
-                    if (type == qr<FloatComplexMatrix>::economy || vector_p)
+                    octave::math::qrp<FloatComplexMatrix> fact (m, type);
+                    if (type == octave::math::qr<FloatComplexMatrix>::economy || vector_p)
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.Pvec ());
                     else
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.P ());
@@ -400,7 +400,7 @@
         {
           if (arg.is_real_type ())
             {
-              qr<Matrix>::type type = qr_type<Matrix> (nargin, nargout);
+              octave::math::qr<Matrix>::type type = qr_type<Matrix> (nargin, nargout);
 
               Matrix m = arg.matrix_value ();
 
@@ -409,14 +409,14 @@
                 case 0:
                 case 1:
                   {
-                    qr<Matrix> fact (m, type);
+                    octave::math::qr<Matrix> fact (m, type);
                     retval = ovl (fact.R ());
                   }
                   break;
 
                 case 2:
                   {
-                    qr<Matrix> fact (m, type);
+                    octave::math::qr<Matrix> fact (m, type);
                     retval = ovl (fact.Q (), get_qr_r (fact));
                     if (have_b)
                       {
@@ -432,8 +432,8 @@
 
                 default:
                   {
-                    qrp<Matrix> fact (m, type);
-                    if (type == qr<Matrix>::economy || vector_p)
+                    octave::math::qrp<Matrix> fact (m, type);
+                    if (type == octave::math::qr<Matrix>::economy || vector_p)
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.Pvec ());
                     else
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.P ());
@@ -443,7 +443,7 @@
             }
           else if (arg.is_complex_type ())
             {
-              qr<ComplexMatrix>::type type
+              octave::math::qr<ComplexMatrix>::type type
                 = qr_type<ComplexMatrix> (nargin, nargout);
 
               ComplexMatrix m = arg.complex_matrix_value ();
@@ -453,14 +453,14 @@
                 case 0:
                 case 1:
                   {
-                    qr<ComplexMatrix> fact (m, type);
+                    octave::math::qr<ComplexMatrix> fact (m, type);
                     retval = ovl (fact.R ());
                   }
                   break;
 
                 case 2:
                   {
-                    qr<ComplexMatrix> fact (m, type);
+                    octave::math::qr<ComplexMatrix> fact (m, type);
                     retval = ovl (fact.Q (), get_qr_r (fact));
                     if (have_b)
                       retval (0) = conj (fact.Q ().transpose ())
@@ -470,8 +470,8 @@
 
                 default:
                   {
-                    qrp<ComplexMatrix> fact (m, type);
-                    if (type == qr<ComplexMatrix>::economy || vector_p)
+                    octave::math::qrp<ComplexMatrix> fact (m, type);
+                    if (type == octave::math::qr<ComplexMatrix>::economy || vector_p)
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.Pvec ());
                     else
                       retval = ovl (fact.Q (), get_qr_r (fact), fact.P ());
@@ -923,7 +923,7 @@
           FloatMatrix u = argu.float_matrix_value ();
           FloatMatrix v = argv.float_matrix_value ();
 
-          qr<FloatMatrix> fact (Q, R);
+          octave::math::qr<FloatMatrix> fact (Q, R);
           fact.update (u, v);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -935,7 +935,7 @@
           Matrix u = argu.matrix_value ();
           Matrix v = argv.matrix_value ();
 
-          qr<Matrix> fact (Q, R);
+          octave::math::qr<Matrix> fact (Q, R);
           fact.update (u, v);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -952,7 +952,7 @@
           FloatComplexMatrix u = argu.float_complex_matrix_value ();
           FloatComplexMatrix v = argv.float_complex_matrix_value ();
 
-          qr<FloatComplexMatrix> fact (Q, R);
+          octave::math::qr<FloatComplexMatrix> fact (Q, R);
           fact.update (u, v);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -964,7 +964,7 @@
           ComplexMatrix u = argu.complex_matrix_value ();
           ComplexMatrix v = argv.complex_matrix_value ();
 
-          qr<ComplexMatrix> fact (Q, R);
+          octave::math::qr<ComplexMatrix> fact (Q, R);
           fact.update (u, v);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -1107,7 +1107,7 @@
           FloatMatrix R = argr.float_matrix_value ();
           FloatMatrix x = argx.float_matrix_value ();
 
-          qr<FloatMatrix> fact (Q, R);
+          octave::math::qr<FloatMatrix> fact (Q, R);
 
           if (col)
             fact.insert_col (x, j-one);
@@ -1122,7 +1122,7 @@
           Matrix R = argr.matrix_value ();
           Matrix x = argx.matrix_value ();
 
-          qr<Matrix> fact (Q, R);
+          octave::math::qr<Matrix> fact (Q, R);
 
           if (col)
             fact.insert_col (x, j-one);
@@ -1145,7 +1145,7 @@
           FloatComplexMatrix x =
             argx.float_complex_matrix_value ();
 
-          qr<FloatComplexMatrix> fact (Q, R);
+          octave::math::qr<FloatComplexMatrix> fact (Q, R);
 
           if (col)
             fact.insert_col (x, j-one);
@@ -1160,7 +1160,7 @@
           ComplexMatrix R = argr.complex_matrix_value ();
           ComplexMatrix x = argx.complex_matrix_value ();
 
-          qr<ComplexMatrix> fact (Q, R);
+          octave::math::qr<ComplexMatrix> fact (Q, R);
 
           if (col)
             fact.insert_col (x, j-one);
@@ -1298,7 +1298,7 @@
           FloatMatrix Q = argq.float_matrix_value ();
           FloatMatrix R = argr.float_matrix_value ();
 
-          qr<FloatMatrix> fact (Q, R);
+          octave::math::qr<FloatMatrix> fact (Q, R);
 
           if (col)
             fact.delete_col (j-one);
@@ -1312,7 +1312,7 @@
           Matrix Q = argq.matrix_value ();
           Matrix R = argr.matrix_value ();
 
-          qr<Matrix> fact (Q, R);
+          octave::math::qr<Matrix> fact (Q, R);
 
           if (col)
             fact.delete_col (j-one);
@@ -1332,7 +1332,7 @@
           FloatComplexMatrix R =
             argr.float_complex_matrix_value ();
 
-          qr<FloatComplexMatrix> fact (Q, R);
+          octave::math::qr<FloatComplexMatrix> fact (Q, R);
 
           if (col)
             fact.delete_col (j-one);
@@ -1346,7 +1346,7 @@
           ComplexMatrix Q = argq.complex_matrix_value ();
           ComplexMatrix R = argr.complex_matrix_value ();
 
-          qr<ComplexMatrix> fact (Q, R);
+          octave::math::qr<ComplexMatrix> fact (Q, R);
 
           if (col)
             fact.delete_col (j-one);
@@ -1524,7 +1524,7 @@
           FloatMatrix Q = argq.float_matrix_value ();
           FloatMatrix R = argr.float_matrix_value ();
 
-          qr<FloatMatrix> fact (Q, R);
+          octave::math::qr<FloatMatrix> fact (Q, R);
           fact.shift_cols (i-1, j-1);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -1534,7 +1534,7 @@
           Matrix Q = argq.matrix_value ();
           Matrix R = argr.matrix_value ();
 
-          qr<Matrix> fact (Q, R);
+          octave::math::qr<Matrix> fact (Q, R);
           fact.shift_cols (i-1, j-1);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -1549,7 +1549,7 @@
           FloatComplexMatrix Q = argq.float_complex_matrix_value ();
           FloatComplexMatrix R = argr.float_complex_matrix_value ();
 
-          qr<FloatComplexMatrix> fact (Q, R);
+          octave::math::qr<FloatComplexMatrix> fact (Q, R);
           fact.shift_cols (i-1, j-1);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
@@ -1559,7 +1559,7 @@
           ComplexMatrix Q = argq.complex_matrix_value ();
           ComplexMatrix R = argr.complex_matrix_value ();
 
-          qr<ComplexMatrix> fact (Q, R);
+          octave::math::qr<ComplexMatrix> fact (Q, R);
           fact.shift_cols (i-1, j-1);
 
           retval = ovl (fact.Q (), get_qr_r (fact));
--- a/libinterp/parse-tree/lex.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/libinterp/parse-tree/lex.h	Tue Aug 16 15:48:22 2016 -0400
@@ -725,7 +725,7 @@
     { }
 
     lexer (const std::string& eval_string,
-                  interpreter *interp_context = 0)
+           interpreter *interp_context = 0)
       : base_lexer (interp_context), input_reader (eval_string, this)
     { }
 
@@ -789,7 +789,7 @@
     }
 
     push_lexer (const std::string& input,
-                       interpreter *interp_context = 0)
+                interpreter *interp_context = 0)
       : base_lexer (interp_context), pflag (1)
     {
       append_input (input, false);
@@ -802,7 +802,7 @@
     }
 
     push_lexer (const std::string& input, bool eof,
-                       interpreter *interp_context = 0)
+                interpreter *interp_context = 0)
       : base_lexer (interp_context), pflag (1)
     {
       append_input (input, eof);
--- a/liboctave/array/CMatrix.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/CMatrix.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -1110,7 +1110,7 @@
     {
       if (mattype.is_hermitian ())
         {
-          chol<ComplexMatrix> chol (*this, info, true, calc_cond);
+          octave::math::chol<ComplexMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
             {
               if (calc_cond)
@@ -1139,7 +1139,7 @@
 {
   ComplexMatrix retval;
 
-  svd<ComplexMatrix> result (*this, svd<ComplexMatrix>::Type::economy);
+  octave::math::svd<ComplexMatrix> result (*this, octave::math::svd<ComplexMatrix>::Type::economy);
 
   DiagMatrix S = result.singular_values ();
   ComplexMatrix U = result.left_singular_matrix ();
@@ -3491,8 +3491,8 @@
 
   // Compute Schur decompositions
 
-  schur<ComplexMatrix> as (a, "U");
-  schur<ComplexMatrix> bs (b, "U");
+  octave::math::schur<ComplexMatrix> as (a, "U");
+  octave::math::schur<ComplexMatrix> bs (b, "U");
 
   // Transform c to new coordinates.
 
--- a/liboctave/array/CSparse.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/CSparse.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -1077,7 +1077,7 @@
       if (mattype.is_hermitian ())
         {
           MatrixType tmp_typ (MatrixType::Upper);
-          sparse_chol<SparseComplexMatrix> fact (*this, info, false);
+          octave::math::sparse_chol<SparseComplexMatrix> fact (*this, info, false);
           rcond = fact.rcond ();
           if (info == 0)
             {
@@ -1103,7 +1103,7 @@
             Qinit(i) = i;
 
           MatrixType tmp_typ (MatrixType::Upper);
-          sparse_lu<SparseComplexMatrix> fact (*this, Qinit, Matrix (), false, false);
+          octave::math::sparse_lu<SparseComplexMatrix> fact (*this, Qinit, Matrix (), false, false);
           rcond = fact.rcond ();
           double rcond2;
           SparseComplexMatrix InvL = fact.L ().transpose ().
--- a/liboctave/array/dMatrix.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/dMatrix.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -797,7 +797,7 @@
     {
       if (mattype.is_hermitian ())
         {
-          chol<Matrix> chol (*this, info, true, calc_cond);
+          octave::math::chol<Matrix> chol (*this, info, true, calc_cond);
           if (info == 0)
             {
               if (calc_cond)
@@ -823,7 +823,7 @@
 Matrix
 Matrix::pseudo_inverse (double tol) const
 {
-  svd<Matrix> result (*this, svd<Matrix>::Type::economy);
+  octave::math::svd<Matrix> result (*this, octave::math::svd<Matrix>::Type::economy);
 
   DiagMatrix S = result.singular_values ();
   Matrix U = result.left_singular_matrix ();
@@ -2950,8 +2950,8 @@
 
   // Compute Schur decompositions.
 
-  schur<Matrix> as (a, "U");
-  schur<Matrix> bs (b, "U");
+  octave::math::schur<Matrix> as (a, "U");
+  octave::math::schur<Matrix> bs (b, "U");
 
   // Transform c to new coordinates.
 
--- a/liboctave/array/dSparse.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/dSparse.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -1169,7 +1169,7 @@
       if (mattype.is_hermitian ())
         {
           MatrixType tmp_typ (MatrixType::Upper);
-          sparse_chol<SparseMatrix> fact (*this, info, false);
+          octave::math::sparse_chol<SparseMatrix> fact (*this, info, false);
           rcond = fact.rcond ();
           if (info == 0)
             {
@@ -1194,7 +1194,7 @@
             Qinit(i) = i;
 
           MatrixType tmp_typ (MatrixType::Upper);
-          sparse_lu<SparseMatrix> fact (*this, Qinit, Matrix (), false, false);
+          octave::math::sparse_lu<SparseMatrix> fact (*this, Qinit, Matrix (), false, false);
           rcond = fact.rcond ();
           double rcond2;
           SparseMatrix InvL = fact.L ().transpose ().tinverse (tmp_typ,
--- a/liboctave/array/fCMatrix.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/fCMatrix.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -1115,7 +1115,7 @@
     {
       if (mattype.is_hermitian ())
         {
-          chol<FloatComplexMatrix> chol (*this, info, true, calc_cond);
+          octave::math::chol<FloatComplexMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
             {
               if (calc_cond)
@@ -1144,7 +1144,7 @@
 {
   FloatComplexMatrix retval;
 
-  svd<FloatComplexMatrix> result (*this, svd<FloatComplexMatrix>::Type::economy);
+  octave::math::svd<FloatComplexMatrix> result (*this, octave::math::svd<FloatComplexMatrix>::Type::economy);
 
   FloatDiagMatrix S = result.singular_values ();
   FloatComplexMatrix U = result.left_singular_matrix ();
@@ -3518,8 +3518,8 @@
 
   // Compute Schur decompositions
 
-  schur<FloatComplexMatrix> as (a, "U");
-  schur<FloatComplexMatrix> bs (b, "U");
+  octave::math::schur<FloatComplexMatrix> as (a, "U");
+  octave::math::schur<FloatComplexMatrix> bs (b, "U");
 
   // Transform c to new coordinates.
 
--- a/liboctave/array/fMatrix.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/array/fMatrix.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -804,7 +804,7 @@
     {
       if (mattype.is_hermitian ())
         {
-          chol<FloatMatrix> chol (*this, info, true, calc_cond);
+          octave::math::chol<FloatMatrix> chol (*this, info, true, calc_cond);
           if (info == 0)
             {
               if (calc_cond)
@@ -830,7 +830,7 @@
 FloatMatrix
 FloatMatrix::pseudo_inverse (float tol) const
 {
-  svd<FloatMatrix> result (*this, svd<FloatMatrix>::Type::economy);
+  octave::math::svd<FloatMatrix> result (*this, octave::math::svd<FloatMatrix>::Type::economy);
 
   FloatDiagMatrix S = result.singular_values ();
   FloatMatrix U = result.left_singular_matrix ();
@@ -2965,8 +2965,8 @@
 
   // Compute Schur decompositions.
 
-  schur<FloatMatrix> as (a, "U");
-  schur<FloatMatrix> bs (b, "U");
+  octave::math::schur<FloatMatrix> as (a, "U");
+  octave::math::schur<FloatMatrix> bs (b, "U");
 
   // Transform c to new coordinates.
 
--- a/liboctave/numeric/aepbalance.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/aepbalance.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -115,6 +115,11 @@
   return noperm ? (noscal ? 'N' : 'S') : (noscal ? 'P' : 'B');
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <>
 aepbalance<Matrix>::aepbalance (const Matrix& a, bool noperm, bool noscal)
   : balanced_mat (a), scale (), ilo (), ihi (), job (get_job (noperm, noscal))
@@ -295,3 +300,6 @@
 template class aepbalance<ComplexMatrix>;
 
 template class aepbalance<FloatComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/aepbalance.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/aepbalance.h	Tue Aug 16 15:48:22 2016 -0400
@@ -26,6 +26,11 @@
 
 #include "octave-config.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename MT>
 class aepbalance
 {
@@ -117,4 +122,7 @@
   char job;
 };
 
+}
+}
+
 #endif
--- a/liboctave/numeric/chol.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/chol.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -420,6 +420,11 @@
   return retval;
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 T
 chol2inv (const T& r)
@@ -463,7 +468,7 @@
 }
 
 template <typename T>
-static bool
+bool
 singular (const T& a)
 {
   static typename T::element_type zero (0);
@@ -1296,3 +1301,6 @@
 
 template FloatComplexMatrix
 chol2inv<FloatComplexMatrix> (const FloatComplexMatrix& r);
+
+}
+}
--- a/liboctave/numeric/chol.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/chol.h	Tue Aug 16 15:48:22 2016 -0400
@@ -26,6 +26,11 @@
 
 #include "octave-config.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 chol
@@ -98,4 +103,7 @@
 T
 chol2inv (const T& r);
 
+}
+}
+
 #endif
--- a/liboctave/numeric/eigs-base.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/eigs-base.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -302,7 +302,7 @@
 make_cholb (Matrix& b, Matrix& bt, ColumnVector& permB)
 {
   octave_idx_type info;
-  chol<Matrix> fact (b, info);
+  octave::math::chol<Matrix> fact (b, info);
   octave_idx_type n = b.cols ();
 
   if (info != 0)
@@ -322,7 +322,7 @@
 make_cholb (SparseMatrix& b, SparseMatrix& bt, ColumnVector& permB)
 {
   octave_idx_type info;
-  sparse_chol<SparseMatrix> fact (b, info, false);
+  octave::math::sparse_chol<SparseMatrix> fact (b, info, false);
 
   if (fact.P () != 0)
     return false;
@@ -339,7 +339,7 @@
 make_cholb (ComplexMatrix& b, ComplexMatrix& bt, ColumnVector& permB)
 {
   octave_idx_type info;
-  chol<ComplexMatrix> fact (b, info);
+  octave::math::chol<ComplexMatrix> fact (b, info);
   octave_idx_type n = b.cols ();
 
   if (info != 0)
@@ -360,7 +360,7 @@
             ColumnVector& permB)
 {
   octave_idx_type info;
-  sparse_chol<SparseComplexMatrix> fact (b, info, false);
+  octave::math::sparse_chol<SparseComplexMatrix> fact (b, info, false);
 
   if (fact.P () != 0)
     return false;
@@ -426,7 +426,7 @@
       AminusSigmaB -= sigmat;
     }
 
-  sparse_lu<SparseMatrix> fact (AminusSigmaB);
+  octave::math::sparse_lu<SparseMatrix> fact (AminusSigmaB);
 
   L = fact.L ();
   U = fact.U ();
@@ -508,7 +508,7 @@
         p[i*(n+1)] -= sigma;
     }
 
-  lu<Matrix> fact (AminusSigmaB);
+  octave::math::lu<Matrix> fact (AminusSigmaB);
 
   L = fact.P ().transpose () * fact.L ();
   U = fact.U ();
@@ -590,7 +590,7 @@
       AminusSigmaB -= sigmat;
     }
 
-  sparse_lu<SparseComplexMatrix> fact (AminusSigmaB);
+  octave::math::sparse_lu<SparseComplexMatrix> fact (AminusSigmaB);
 
   L = fact.L ();
   U = fact.U ();
@@ -672,7 +672,7 @@
         p[i*(n+1)] -= sigma;
     }
 
-  lu<ComplexMatrix> fact (AminusSigmaB);
+  octave::math::lu<ComplexMatrix> fact (AminusSigmaB);
 
   L = fact.P ().transpose () * fact.L ();
   U = fact.U ();
--- a/liboctave/numeric/gepbalance.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/gepbalance.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -103,6 +103,11 @@
                              F77_CHAR_ARG_LEN_DECL);
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <>
 octave_idx_type
 gepbalance<Matrix>::init (const Matrix& a, const Matrix& b,
@@ -376,3 +381,6 @@
 template class gepbalance<ComplexMatrix>;
 
 template class gepbalance<FloatComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/gepbalance.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/gepbalance.h	Tue Aug 16 15:48:22 2016 -0400
@@ -27,6 +27,11 @@
 
 #include <string>
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 gepbalance
@@ -83,4 +88,7 @@
   octave_idx_type init (const T& a, const T& b, const std::string& job);
 };
 
+}
+}
+
 #endif
--- a/liboctave/numeric/hess.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/hess.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -153,6 +153,11 @@
                              F77_CHAR_ARG_LEN_DECL);
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <>
 octave_idx_type
 hess<Matrix>::init (const Matrix& a)
@@ -403,3 +408,6 @@
 
   return info;
 }
+
+}
+}
--- a/liboctave/numeric/hess.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/hess.h	Tue Aug 16 15:48:22 2016 -0400
@@ -27,6 +27,11 @@
 
 #include <iosfwd>
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 hess
@@ -82,4 +87,7 @@
 extern std::ostream&
 operator << (std::ostream& os, const hess<T>& a);
 
+}
+}
+
 #endif
--- a/liboctave/numeric/lu.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/lu.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -121,6 +121,11 @@
 #endif
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 lu<T>::lu (const T& l, const T& u,
                            const PermMatrix& p)
@@ -882,3 +887,6 @@
 template class lu<ComplexMatrix>;
 
 template class lu<FloatComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/lu.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/lu.h	Tue Aug 16 15:48:22 2016 -0400
@@ -28,6 +28,11 @@
 
 #include "PermMatrix.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 lu
@@ -95,4 +100,7 @@
   Array<octave_idx_type> ipvt;
 };
 
+}
+}
+
 #endif
--- a/liboctave/numeric/oct-norm.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/oct-norm.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -485,7 +485,8 @@
   R res = 0;
   if (p == 2)
     {
-      svd<MatrixT> fact (m, svd<MatrixT>::Type::sigma_only);
+      octave::math::svd<MatrixT> fact
+        (m, octave::math::svd<MatrixT>::Type::sigma_only);
       res = fact.singular_values () (0,0);
     }
   else if (p == 1)
--- a/liboctave/numeric/qr.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/qr.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -272,6 +272,11 @@
 #endif
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 qr<T>::qr (const T& q_arg, const T& r_arg)
   : q (q_arg), r (r_arg)
@@ -2042,3 +2047,6 @@
 template class qr<ComplexMatrix>;
 
 template class qr<FloatComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/qr.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/qr.h	Tue Aug 16 15:48:22 2016 -0400
@@ -29,6 +29,11 @@
 
 #include "Array.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 qr
@@ -109,4 +114,7 @@
 
 extern void warn_qrupdate_once (void);
 
+}
+}
+
 #endif
--- a/liboctave/numeric/qrp.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/qrp.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -64,6 +64,11 @@
                              const F77_INT&, F77_REAL*, F77_INT&);
 }
 
+namespace octave
+{
+namespace math
+{
+
 // Specialization.
 
 template <>
@@ -325,3 +330,6 @@
   FloatRowVector pv (MArray<float> (pa) + 1.0f);
   return pv;
 }
+
+}
+}
--- a/liboctave/numeric/qrp.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/qrp.h	Tue Aug 16 15:48:22 2016 -0400
@@ -29,6 +29,11 @@
 #include "PermMatrix.h"
 #include "qr.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 qrp : public qr<T>
@@ -69,4 +74,7 @@
   PermMatrix p;
 };
 
+}
+}
+
 #endif
--- a/liboctave/numeric/schur.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/schur.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -107,6 +107,11 @@
                                  F77_CMPLX *, F77_REAL *, F77_REAL *);
 }
 
+namespace octave
+{
+namespace math
+{
+
 // For real types.
 
 template <typename T>
@@ -535,3 +540,6 @@
 template class schur<FloatMatrix>;
 
 template class schur<Matrix>;
+
+}
+}
--- a/liboctave/numeric/schur.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/schur.h	Tue Aug 16 15:48:22 2016 -0400
@@ -32,6 +32,11 @@
 #include "fMatrix.h"
 #include "fCMatrix.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T> class schur;
 
 template <typename T>
@@ -97,4 +102,7 @@
 extern schur<RT>
 rsf2csf (const AT& s, const AT& u);
 
+}
+}
+
 #endif
--- a/liboctave/numeric/sparse-chol.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-chol.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -34,6 +34,11 @@
 #include "quit.h"
 #include "MatrixType.h"
 
+namespace octave
+{
+namespace math
+{
+
 template <typename chol_type>
 class sparse_chol<chol_type>::sparse_chol_rep
 {
@@ -588,3 +593,6 @@
 
 template SparseComplexMatrix
 chol2inv<SparseComplexMatrix> (const SparseComplexMatrix& r);
+
+}
+}
--- a/liboctave/numeric/sparse-chol.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-chol.h	Tue Aug 16 15:48:22 2016 -0400
@@ -31,6 +31,11 @@
 #include "dRowVector.h"
 #include "dSparse.h"
 
+namespace octave
+{
+namespace math
+{
+
 // If the sparse matrix classes become templated on the element type
 // (i.e., sparse_matrix<double>), then it might be best to make the
 // template parameter of this class also be the element type instead
@@ -96,4 +101,7 @@
 sparse_chol<SparseComplexMatrix>::sparse_chol (const SparseComplexMatrix& a,
                                                octave_idx_type& info);
 
+}
+}
+
 #endif
--- a/liboctave/numeric/sparse-dmsolve.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-dmsolve.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -413,8 +413,7 @@
           ST m = dmsolve_extract (a, pinv, q, dm->rr[2], nr, dm->cc[3], nc,
                                   nnz_remaining, true);
           nnz_remaining -= m.nnz ();
-          RT mtmp = 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)
@@ -443,7 +442,7 @@
           if (info != 0)
             {
               info = 0;
-              mtmp = qrsolve (m, btmp2, info);
+              mtmp = octave::math::qrsolve (m, btmp2, info);
             }
 
           dmsolve_insert (retval, mtmp, q, dm->cc[2], 0);
@@ -462,8 +461,7 @@
         {
           ST m = dmsolve_extract (a, pinv, q, 0, dm->rr[1], 0,
                                   dm->cc[2], nnz_remaining, true);
-          RT mtmp = 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	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-lu.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -35,6 +35,11 @@
 #include "oct-spparms.h"
 #include "sparse-lu.h"
 
+namespace octave
+{
+namespace math
+{
+
 // Wrappers for SuiteSparse (formerly UMFPACK) functions that have
 // different names depending on the sparse matrix data type.
 //
@@ -911,3 +916,6 @@
 template class sparse_lu<SparseMatrix>;
 
 template class sparse_lu<SparseComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/sparse-lu.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-lu.h	Tue Aug 16 15:48:22 2016 -0400
@@ -30,6 +30,11 @@
 #include "MArray.h"
 #include "dSparse.h"
 
+namespace octave
+{
+namespace math
+{
+
 // If the sparse matrix classes become templated on the element type
 // (i.e., sparse_matrix<double>), then it might be best to make the
 // template parameter of this class also be the element type instead
@@ -113,4 +118,7 @@
   MArray<octave_idx_type> Q;
 };
 
+}
+}
+
 #endif
--- a/liboctave/numeric/sparse-qr.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-qr.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -30,6 +30,11 @@
 #include "oct-sparse.h"
 #include "sparse-qr.h"
 
+namespace octave
+{
+namespace math
+{
+  
 template <typename SPARSE_T>
 class
 cxsparse_types
@@ -2304,3 +2309,6 @@
 template class sparse_qr<SparseMatrix>;
 
 template class sparse_qr<SparseComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/sparse-qr.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/sparse-qr.h	Tue Aug 16 15:48:22 2016 -0400
@@ -31,6 +31,11 @@
 #include "dSparse.h"
 #include "CSparse.h"
 
+namespace octave
+{
+namespace math
+{
+
 // If the sparse matrix classes become templated on the element type
 // (i.e., sparse_matrix<double>), then it might be best to make the
 // template parameter of this class also be the element type instead
@@ -125,4 +130,7 @@
 typedef sparse_qr<SparseMatrix> SparseQR;
 typedef sparse_qr<SparseComplexMatrix> SparseComplexQR;
 
+}
+}
+
 #endif
--- a/liboctave/numeric/svd.cc	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/svd.cc	Tue Aug 16 15:48:22 2016 -0400
@@ -127,6 +127,11 @@
                              F77_CHAR_ARG_LEN_DECL);
 }
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 T
 svd<T>::left_singular_matrix (void) const
@@ -494,3 +499,6 @@
 template class svd<ComplexMatrix>;
 
 template class svd<FloatComplexMatrix>;
+
+}
+}
--- a/liboctave/numeric/svd.h	Tue Aug 16 20:43:59 2016 +0200
+++ b/liboctave/numeric/svd.h	Tue Aug 16 15:48:22 2016 -0400
@@ -28,6 +28,11 @@
 
 #include <vector>
 
+namespace octave
+{
+namespace math
+{
+
 template <typename T>
 class
 svd
@@ -108,4 +113,7 @@
 
 };
 
+}
+}
+
 #endif