# HG changeset patch # User John W. Eaton # Date 1471376902 14400 # Node ID 6ca3acf5fad86d2d8335fcc171cd7879d026ca77 # Parent b67a29a960561087d5e486947e2bd937711becd3 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. diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/__luinc__.cc --- 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 fact (sm, Qinit, thresh, false, true, droptol, - milu, udiag); + octave::math::sparse_lu 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 fact (sm, Qinit, thresh, false, true, droptol, - milu, udiag); + octave::math::sparse_lu 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 fact (sm, Qinit, thresh, false, false, droptol, - milu, udiag); + octave::math::sparse_lu fact + (sm, Qinit, thresh, false, false, droptol, milu, udiag); if (vecout) { @@ -220,8 +220,8 @@ case 1: case 2: { - sparse_lu fact (sm, Qinit, thresh, false, true, - droptol, milu, udiag); + octave::math::sparse_lu 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 fact (sm, Qinit, thresh, false, true, - droptol, milu, udiag); + octave::math::sparse_lu 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 fact (sm, Qinit, thresh, false, false, - droptol, milu, udiag); + octave::math::sparse_lu fact + (sm, Qinit, thresh, false, false, droptol, milu, udiag); if (vecout) { diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/__qp__.cc --- 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 A_svd (A); + octave::math::svd A_svd (A); DiagMatrix S = A_svd.singular_values (); @@ -191,11 +191,11 @@ // factorization since the Hessian is positive // definite. - chol cholH (H); + octave::math::chol 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 cholrH (rH, pR); + octave::math::chol 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; diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/balance.cc --- 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 result (fcaa, noperm, noscal); + octave::math::aepbalance result (fcaa, noperm, noscal); if (nargout == 0 || nargout == 1) retval = ovl (result.balanced_matrix ()); @@ -164,7 +164,7 @@ } else { - aepbalance result (faa, noperm, noscal); + octave::math::aepbalance result (faa, noperm, noscal); if (nargout == 0 || nargout == 1) retval = ovl (result.balanced_matrix ()); @@ -181,7 +181,7 @@ { if (complex_case) { - aepbalance result (caa, noperm, noscal); + octave::math::aepbalance result (caa, noperm, noscal); if (nargout == 0 || nargout == 1) retval = ovl (result.balanced_matrix ()); @@ -195,7 +195,7 @@ } else { - aepbalance result (aa, noperm, noscal); + octave::math::aepbalance result (aa, noperm, noscal); if (nargout == 0 || nargout == 1) retval = ovl (result.balanced_matrix ()); @@ -249,7 +249,7 @@ { if (complex_case) { - gepbalance result (fcaa, fcbb, bal_job); + octave::math::gepbalance result (fcaa, fcbb, bal_job); switch (nargout) { @@ -274,7 +274,7 @@ } else { - gepbalance result (faa, fbb, bal_job); + octave::math::gepbalance result (faa, fbb, bal_job); switch (nargout) { @@ -302,7 +302,7 @@ { if (complex_case) { - gepbalance result (caa, cbb, bal_job); + octave::math::gepbalance result (caa, cbb, bal_job); switch (nargout) { @@ -327,7 +327,7 @@ } else { - gepbalance result (aa, bb, bal_job); + octave::math::gepbalance result (aa, bb, bal_job); switch (nargout) { diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/hess.cc --- 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 result (tmp); + octave::math::hess result (tmp); if (nargout <= 1) retval = ovl (result.hess_matrix ()); @@ -99,7 +99,7 @@ { FloatComplexMatrix ctmp = arg.float_complex_matrix_value (); - hess result (ctmp); + octave::math::hess result (ctmp); if (nargout <= 1) retval = ovl (result.hess_matrix ()); @@ -114,7 +114,7 @@ { Matrix tmp = arg.matrix_value (); - hess result (tmp); + octave::math::hess result (tmp); if (nargout <= 1) retval = ovl (result.hess_matrix ()); @@ -126,7 +126,7 @@ { ComplexMatrix ctmp = arg.complex_matrix_value (); - hess result (ctmp); + octave::math::hess result (ctmp); if (nargout <= 1) retval = ovl (result.hess_matrix ()); diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/lu.cc --- 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 static octave_value -get_lu_l (const lu& fact) +get_lu_l (const octave::math::lu& fact) { MT L = fact.L (); if (L.is_square ()) @@ -48,7 +48,7 @@ template static octave_value -get_lu_u (const lu& fact) +get_lu_u (const octave::math::lu& 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 fact (m, Qinit, thres, false, true); + octave::math::sparse_lu 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 fact (m, thres, scale); + octave::math::sparse_lu 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 fact (m, Qinit, thres, false, true); + octave::math::sparse_lu 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 fact (m, thres, scale); + octave::math::sparse_lu fact (m, thres, scale); retval(0) = octave_value (fact.L (), MatrixType (MatrixType::Lower)); @@ -341,7 +341,7 @@ { FloatMatrix m = arg.float_matrix_value (); - lu fact (m); + octave::math::lu fact (m); switch (nargout) { @@ -375,7 +375,7 @@ { Matrix m = arg.matrix_value (); - lu fact (m); + octave::math::lu fact (m); switch (nargout) { @@ -412,7 +412,7 @@ { FloatComplexMatrix m = arg.float_complex_matrix_value (); - lu fact (m); + octave::math::lu fact (m); switch (nargout) { @@ -446,7 +446,7 @@ { ComplexMatrix m = arg.complex_matrix_value (); - lu fact (m); + octave::math::lu fact (m); switch (nargout) { @@ -647,7 +647,7 @@ FloatMatrix x = argx.float_matrix_value (); FloatMatrix y = argy.float_matrix_value (); - lu fact (L, U, P); + octave::math::lu 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 fact (L, U, P); + octave::math::lu 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 fact (L, U, P); + octave::math::lu 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 fact (L, U, P); + octave::math::lu fact (L, U, P); if (pivoted) fact.update_piv (x, y); else diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/qz.cc --- 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 cbqr (cbb); + octave::math::qr 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 bqr (bb); + octave::math::qr bqr (bb); #if defined (DEBUG) std::cout << "qz: qr (bb) done; now peforming qz decomposition" diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/schur.cc --- 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 result (tmp, ord, false); + octave::math::schur result (tmp, ord, false); retval = ovl (result.schur_matrix ()); } else { - schur result (tmp, ord, true); + octave::math::schur result (tmp, ord, true); retval = ovl (result.unitary_matrix (), result.schur_matrix ()); } @@ -195,12 +195,12 @@ if (nargout <= 1) { - schur result (ctmp, ord, false); + octave::math::schur result (ctmp, ord, false); retval = ovl (mark_upper_triangular (result.schur_matrix ())); } else { - schur result (ctmp, ord, true); + octave::math::schur result (ctmp, ord, true); retval = ovl (result.unitary_matrix (), mark_upper_triangular (result.schur_matrix ())); } @@ -214,12 +214,12 @@ if (nargout <= 1) { - schur result (tmp, ord, false); + octave::math::schur result (tmp, ord, false); retval = ovl (result.schur_matrix ()); } else { - schur result (tmp, ord, true); + octave::math::schur result (tmp, ord, true); retval = ovl (result.unitary_matrix (), result.schur_matrix ()); } @@ -230,12 +230,12 @@ if (nargout <= 1) { - schur result (ctmp, ord, false); + octave::math::schur result (ctmp, ord, false); retval = ovl (mark_upper_triangular (result.schur_matrix ())); } else { - schur result (ctmp, ord, true); + octave::math::schur 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 cs - = rsf2csf (t, u); + octave::math::schur cs + = octave::math::rsf2csf (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 cs = rsf2csf (t, u); + octave::math::schur cs + = octave::math::rsf2csf (t, u); return ovl (cs.unitary_matrix (), cs.schur_matrix ()); } diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/sqrtm.cc --- 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 > (arg); + octave::math::schur > (arg); else if (arg.is_numeric_type ()) - retval(0) = do_sqrtm > (arg); + retval(0) = do_sqrtm > (arg); if (nargout > 1) { diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/corefcn/svd.cc --- 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 -static typename svd::Type +static typename octave::math::svd::Type svd_type (int nargin, int nargout) { return ((nargout == 0 || nargout == 1) - ? svd::Type::sigma_only - : (nargin == 2) ? svd::Type::economy : svd::Type::std); + ? octave::math::svd::Type::sigma_only + : ((nargin == 2) + ? octave::math::svd::Type::economy + : octave::math::svd::Type::std)); } template -static typename svd::Driver +static typename octave::math::svd::Driver svd_driver (void) { - return Vsvd_driver == "gesvd" ? svd::Driver::GESVD : svd::Driver::GESDD; + return (Vsvd_driver == "gesvd" + ? octave::math::svd::Driver::GESVD + : octave::math::svd::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 result (tmp, - svd_type (nargin, nargout), - svd_driver ()); + octave::math::svd result + (tmp, svd_type (nargin, nargout), + svd_driver ()); 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 result (ctmp, - svd_type (nargin, nargout), - svd_driver ()); + octave::math::svd result + (ctmp, svd_type (nargin, nargout), + svd_driver ()); 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 result (tmp, - svd_type (nargin, nargout), - svd_driver ()); + octave::math::svd result + (tmp, svd_type (nargin, nargout), + svd_driver ()); 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 result (ctmp, - svd_type (nargin, nargout), - svd_driver ()); + octave::math::svd result + (ctmp, svd_type (nargin, nargout), + svd_driver ()); DiagMatrix sigma = result.singular_values (); diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/dldfcn/chol.cc --- 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 fact (m, info, natural, force); + octave::math::sparse_chol fact (m, info, natural, force); if (nargout == 3) { @@ -224,7 +224,7 @@ { SparseComplexMatrix m = arg.sparse_complex_matrix_value (); - sparse_chol fact (m, info, natural, force); + octave::math::sparse_chol fact (m, info, natural, force); if (nargout == 3) { @@ -258,7 +258,7 @@ octave_idx_type info; - chol fact (m, info, LLt != true); + octave::math::chol 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 fact (m, info, LLt != true); + octave::math::chol 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 fact (m, info, LLt != true); + octave::math::chol 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 fact (m, info, LLt != true); + octave::math::chol 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 chol (m, info); + octave::math::sparse_chol chol (m, info); if (info == 0) retval = chol.inverse (); @@ -404,7 +404,7 @@ { SparseComplexMatrix m = arg.sparse_complex_matrix_value (); - sparse_chol chol (m, info); + octave::math::sparse_chol chol (m, info); if (info == 0) retval = chol.inverse (); @@ -421,7 +421,7 @@ FloatMatrix m = arg.float_matrix_value (); octave_idx_type info; - chol chol (m, info); + octave::math::chol 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 chol (m, info); + octave::math::chol chol (m, info); if (info == 0) retval = chol.inverse (); else @@ -448,7 +448,7 @@ Matrix m = arg.matrix_value (); octave_idx_type info; - chol chol (m, info); + octave::math::chol 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 chol (m, info); + octave::math::chol 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 fact; + octave::math::chol fact; fact.set (R); if (down) @@ -684,7 +684,7 @@ FloatComplexColumnVector u = argu.float_complex_column_vector_value (); - chol fact; + octave::math::chol fact; fact.set (R); if (down) @@ -703,7 +703,7 @@ Matrix R = argr.matrix_value (); ColumnVector u = argu.column_vector_value (); - chol fact; + octave::math::chol fact; fact.set (R); if (down) @@ -719,7 +719,7 @@ ComplexMatrix R = argr.complex_matrix_value (); ComplexColumnVector u = argu.complex_column_vector_value (); - chol fact; + octave::math::chol fact; fact.set (R); if (down) @@ -858,7 +858,7 @@ FloatMatrix R = argr.float_matrix_value (); FloatColumnVector u = argu.float_column_vector_value (); - chol fact; + octave::math::chol fact; fact.set (R); err = fact.insert_sym (u, j-1); @@ -871,7 +871,7 @@ FloatComplexColumnVector u = argu.float_complex_column_vector_value (); - chol fact; + octave::math::chol 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 fact; + octave::math::chol fact; fact.set (R); err = fact.insert_sym (u, j-1); @@ -899,7 +899,7 @@ ComplexColumnVector u = argu.complex_column_vector_value (); - chol fact; + octave::math::chol fact; fact.set (R); err = fact.insert_sym (u, j-1); @@ -1093,7 +1093,7 @@ // real case FloatMatrix R = argr.float_matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.delete_sym (j-1); @@ -1104,7 +1104,7 @@ // complex case FloatComplexMatrix R = argr.float_complex_matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.delete_sym (j-1); @@ -1118,7 +1118,7 @@ // real case Matrix R = argr.matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.delete_sym (j-1); @@ -1129,7 +1129,7 @@ // complex case ComplexMatrix R = argr.complex_matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.delete_sym (j-1); @@ -1223,7 +1223,7 @@ // real case FloatMatrix R = argr.float_matrix_value (); - chol fact; + octave::math::chol 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 fact; + octave::math::chol fact; fact.set (R); fact.shift_sym (i-1, j-1); @@ -1248,7 +1248,7 @@ // real case Matrix R = argr.matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.shift_sym (i-1, j-1); @@ -1259,7 +1259,7 @@ // complex case ComplexMatrix R = argr.complex_matrix_value (); - chol fact; + octave::math::chol fact; fact.set (R); fact.shift_sym (i-1, j-1); diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/dldfcn/dmperm.cc --- 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 diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/dldfcn/qr.cc --- 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 static octave_value -get_qr_r (const qr& fact) +get_qr_r (const octave::math::qr& fact) { MT R = fact.R (); if (R.is_square () && fact.regular ()) @@ -48,12 +48,12 @@ } template -static typename qr::type +static typename octave::math::qr::type qr_type (int nargin, int nargout) { return ((nargout == 0 || nargout == 1) - ? qr::raw - : (nargin == 2) ? qr::economy : qr::std); + ? octave::math::qr::raw + : (nargin == 2) ? octave::math::qr::economy : octave::math::qr::std); } // [Q, R] = qr (X): form Q unitary and R upper triangular such @@ -276,7 +276,7 @@ if (is_cmplx) { - sparse_qr q (arg.sparse_complex_matrix_value ()); + octave::math::sparse_qr q (arg.sparse_complex_matrix_value ()); if (have_b) { @@ -293,7 +293,7 @@ } else { - sparse_qr q (arg.sparse_matrix_value ()); + octave::math::sparse_qr q (arg.sparse_matrix_value ()); if (have_b) { @@ -314,7 +314,7 @@ { if (arg.is_real_type ()) { - qr::type type + octave::math::qr::type type = qr_type (nargin, nargout); FloatMatrix m = arg.float_matrix_value (); @@ -324,14 +324,14 @@ case 0: case 1: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.R ()); } break; case 2: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.Q (), get_qr_r (fact)); if (have_b) { @@ -347,9 +347,9 @@ default: { - qrp fact (m, type); + octave::math::qrp fact (m, type); - if (type == qr::economy || vector_p) + if (type == octave::math::qr::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::type type + octave::math::qr::type type = qr_type (nargin, nargout); FloatComplexMatrix m = arg.float_complex_matrix_value (); @@ -369,14 +369,14 @@ case 0: case 1: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.R ()); } break; case 2: { - qr fact (m, type); + octave::math::qr 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 fact (m, type); - if (type == qr::economy || vector_p) + octave::math::qrp fact (m, type); + if (type == octave::math::qr::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::type type = qr_type (nargin, nargout); + octave::math::qr::type type = qr_type (nargin, nargout); Matrix m = arg.matrix_value (); @@ -409,14 +409,14 @@ case 0: case 1: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.R ()); } break; case 2: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.Q (), get_qr_r (fact)); if (have_b) { @@ -432,8 +432,8 @@ default: { - qrp fact (m, type); - if (type == qr::economy || vector_p) + octave::math::qrp fact (m, type); + if (type == octave::math::qr::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::type type + octave::math::qr::type type = qr_type (nargin, nargout); ComplexMatrix m = arg.complex_matrix_value (); @@ -453,14 +453,14 @@ case 0: case 1: { - qr fact (m, type); + octave::math::qr fact (m, type); retval = ovl (fact.R ()); } break; case 2: { - qr fact (m, type); + octave::math::qr 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 fact (m, type); - if (type == qr::economy || vector_p) + octave::math::qrp fact (m, type); + if (type == octave::math::qr::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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr fact (Q, R); if (col) fact.insert_col (x, j-one); @@ -1145,7 +1145,7 @@ FloatComplexMatrix x = argx.float_complex_matrix_value (); - qr fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr fact (Q, R); if (col) fact.delete_col (j-one); @@ -1332,7 +1332,7 @@ FloatComplexMatrix R = argr.float_complex_matrix_value (); - qr fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr 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 fact (Q, R); + octave::math::qr fact (Q, R); fact.shift_cols (i-1, j-1); retval = ovl (fact.Q (), get_qr_r (fact)); diff -r b67a29a96056 -r 6ca3acf5fad8 libinterp/parse-tree/lex.h --- 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); diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/CMatrix.cc --- 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 chol (*this, info, true, calc_cond); + octave::math::chol chol (*this, info, true, calc_cond); if (info == 0) { if (calc_cond) @@ -1139,7 +1139,7 @@ { ComplexMatrix retval; - svd result (*this, svd::Type::economy); + octave::math::svd result (*this, octave::math::svd::Type::economy); DiagMatrix S = result.singular_values (); ComplexMatrix U = result.left_singular_matrix (); @@ -3491,8 +3491,8 @@ // Compute Schur decompositions - schur as (a, "U"); - schur bs (b, "U"); + octave::math::schur as (a, "U"); + octave::math::schur bs (b, "U"); // Transform c to new coordinates. diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/CSparse.cc --- 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 fact (*this, info, false); + octave::math::sparse_chol fact (*this, info, false); rcond = fact.rcond (); if (info == 0) { @@ -1103,7 +1103,7 @@ Qinit(i) = i; MatrixType tmp_typ (MatrixType::Upper); - sparse_lu fact (*this, Qinit, Matrix (), false, false); + octave::math::sparse_lu fact (*this, Qinit, Matrix (), false, false); rcond = fact.rcond (); double rcond2; SparseComplexMatrix InvL = fact.L ().transpose (). diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/dMatrix.cc --- 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 chol (*this, info, true, calc_cond); + octave::math::chol chol (*this, info, true, calc_cond); if (info == 0) { if (calc_cond) @@ -823,7 +823,7 @@ Matrix Matrix::pseudo_inverse (double tol) const { - svd result (*this, svd::Type::economy); + octave::math::svd result (*this, octave::math::svd::Type::economy); DiagMatrix S = result.singular_values (); Matrix U = result.left_singular_matrix (); @@ -2950,8 +2950,8 @@ // Compute Schur decompositions. - schur as (a, "U"); - schur bs (b, "U"); + octave::math::schur as (a, "U"); + octave::math::schur bs (b, "U"); // Transform c to new coordinates. diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/dSparse.cc --- 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 fact (*this, info, false); + octave::math::sparse_chol fact (*this, info, false); rcond = fact.rcond (); if (info == 0) { @@ -1194,7 +1194,7 @@ Qinit(i) = i; MatrixType tmp_typ (MatrixType::Upper); - sparse_lu fact (*this, Qinit, Matrix (), false, false); + octave::math::sparse_lu fact (*this, Qinit, Matrix (), false, false); rcond = fact.rcond (); double rcond2; SparseMatrix InvL = fact.L ().transpose ().tinverse (tmp_typ, diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/fCMatrix.cc --- 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 chol (*this, info, true, calc_cond); + octave::math::chol chol (*this, info, true, calc_cond); if (info == 0) { if (calc_cond) @@ -1144,7 +1144,7 @@ { FloatComplexMatrix retval; - svd result (*this, svd::Type::economy); + octave::math::svd result (*this, octave::math::svd::Type::economy); FloatDiagMatrix S = result.singular_values (); FloatComplexMatrix U = result.left_singular_matrix (); @@ -3518,8 +3518,8 @@ // Compute Schur decompositions - schur as (a, "U"); - schur bs (b, "U"); + octave::math::schur as (a, "U"); + octave::math::schur bs (b, "U"); // Transform c to new coordinates. diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/array/fMatrix.cc --- 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 chol (*this, info, true, calc_cond); + octave::math::chol chol (*this, info, true, calc_cond); if (info == 0) { if (calc_cond) @@ -830,7 +830,7 @@ FloatMatrix FloatMatrix::pseudo_inverse (float tol) const { - svd result (*this, svd::Type::economy); + octave::math::svd result (*this, octave::math::svd::Type::economy); FloatDiagMatrix S = result.singular_values (); FloatMatrix U = result.left_singular_matrix (); @@ -2965,8 +2965,8 @@ // Compute Schur decompositions. - schur as (a, "U"); - schur bs (b, "U"); + octave::math::schur as (a, "U"); + octave::math::schur bs (b, "U"); // Transform c to new coordinates. diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/aepbalance.cc --- 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::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; template class aepbalance; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/aepbalance.h --- 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 class aepbalance { @@ -117,4 +122,7 @@ char job; }; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/chol.cc --- 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 T chol2inv (const T& r) @@ -463,7 +468,7 @@ } template -static bool +bool singular (const T& a) { static typename T::element_type zero (0); @@ -1296,3 +1301,6 @@ template FloatComplexMatrix chol2inv (const FloatComplexMatrix& r); + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/chol.h --- 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 class chol @@ -98,4 +103,7 @@ T chol2inv (const T& r); +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/eigs-base.cc --- 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 fact (b, info); + octave::math::chol 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 fact (b, info, false); + octave::math::sparse_chol 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 fact (b, info); + octave::math::chol fact (b, info); octave_idx_type n = b.cols (); if (info != 0) @@ -360,7 +360,7 @@ ColumnVector& permB) { octave_idx_type info; - sparse_chol fact (b, info, false); + octave::math::sparse_chol fact (b, info, false); if (fact.P () != 0) return false; @@ -426,7 +426,7 @@ AminusSigmaB -= sigmat; } - sparse_lu fact (AminusSigmaB); + octave::math::sparse_lu fact (AminusSigmaB); L = fact.L (); U = fact.U (); @@ -508,7 +508,7 @@ p[i*(n+1)] -= sigma; } - lu fact (AminusSigmaB); + octave::math::lu fact (AminusSigmaB); L = fact.P ().transpose () * fact.L (); U = fact.U (); @@ -590,7 +590,7 @@ AminusSigmaB -= sigmat; } - sparse_lu fact (AminusSigmaB); + octave::math::sparse_lu fact (AminusSigmaB); L = fact.L (); U = fact.U (); @@ -672,7 +672,7 @@ p[i*(n+1)] -= sigma; } - lu fact (AminusSigmaB); + octave::math::lu fact (AminusSigmaB); L = fact.P ().transpose () * fact.L (); U = fact.U (); diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/gepbalance.cc --- 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::init (const Matrix& a, const Matrix& b, @@ -376,3 +381,6 @@ template class gepbalance; template class gepbalance; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/gepbalance.h --- 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 +namespace octave +{ +namespace math +{ + template class gepbalance @@ -83,4 +88,7 @@ octave_idx_type init (const T& a, const T& b, const std::string& job); }; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/hess.cc --- 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::init (const Matrix& a) @@ -403,3 +408,6 @@ return info; } + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/hess.h --- 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 +namespace octave +{ +namespace math +{ + template class hess @@ -82,4 +87,7 @@ extern std::ostream& operator << (std::ostream& os, const hess& a); +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/lu.cc --- 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 lu::lu (const T& l, const T& u, const PermMatrix& p) @@ -882,3 +887,6 @@ template class lu; template class lu; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/lu.h --- 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 class lu @@ -95,4 +100,7 @@ Array ipvt; }; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/oct-norm.cc --- 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 fact (m, svd::Type::sigma_only); + octave::math::svd fact + (m, octave::math::svd::Type::sigma_only); res = fact.singular_values () (0,0); } else if (p == 1) diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/qr.cc --- 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 qr::qr (const T& q_arg, const T& r_arg) : q (q_arg), r (r_arg) @@ -2042,3 +2047,6 @@ template class qr; template class qr; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/qr.h --- 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 class qr @@ -109,4 +114,7 @@ extern void warn_qrupdate_once (void); +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/qrp.cc --- 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 (pa) + 1.0f); return pv; } + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/qrp.h --- 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 class qrp : public qr @@ -69,4 +74,7 @@ PermMatrix p; }; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/schur.cc --- 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 @@ -535,3 +540,6 @@ template class schur; template class schur; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/schur.h --- 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 class schur; template @@ -97,4 +102,7 @@ extern schur rsf2csf (const AT& s, const AT& u); +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-chol.cc --- 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 class sparse_chol::sparse_chol_rep { @@ -588,3 +593,6 @@ template SparseComplexMatrix chol2inv (const SparseComplexMatrix& r); + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-chol.h --- 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), 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::sparse_chol (const SparseComplexMatrix& a, octave_idx_type& info); +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-dmsolve.cc --- 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); } diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-lu.cc --- 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; template class sparse_lu; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-lu.h --- 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), then it might be best to make the // template parameter of this class also be the element type instead @@ -113,4 +118,7 @@ MArray Q; }; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-qr.cc --- 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 class cxsparse_types @@ -2304,3 +2309,6 @@ template class sparse_qr; template class sparse_qr; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/sparse-qr.h --- 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), 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 SparseQR; typedef sparse_qr SparseComplexQR; +} +} + #endif diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/svd.cc --- 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 T svd::left_singular_matrix (void) const @@ -494,3 +499,6 @@ template class svd; template class svd; + +} +} diff -r b67a29a96056 -r 6ca3acf5fad8 liboctave/numeric/svd.h --- 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 +namespace octave +{ +namespace math +{ + template class svd @@ -108,4 +113,7 @@ }; +} +} + #endif