# HG changeset patch # User John W. Eaton # Date 1454088189 18000 # Node ID 7962dbca527f91f48822976839b57a8c0cb0cb99 # Parent e8c3590da9ff7f67726fccb300fbe26e7aead9b3 eliminate obsolete CXX_NEW_FRIEND_TEMPLATE_DECL macro * acinclude.m4 (OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL): Delete macro definition. * configure.ac: Don't use it. * filter.cc, eigs-base.cc, sparse-dmsolve.cc: Eliminate use of CXX_NEW_FRIEND_TEMPLATE_DECL macro since this feature should be present in all modern C++ compilers. diff -r e8c3590da9ff -r 7962dbca527f configure.ac --- a/configure.ac Fri Jan 29 06:24:34 2016 +0100 +++ b/configure.ac Fri Jan 29 12:23:09 2016 -0500 @@ -2215,9 +2215,6 @@ ### Check compiler characteristics. -## Does compiler have support for new friend template declarations? -OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL - ## Does reinterpret_cast fail for function pointers? OCTAVE_CXX_BROKEN_REINTERPRET_CAST diff -r e8c3590da9ff -r 7962dbca527f libinterp/corefcn/filter.cc --- a/libinterp/corefcn/filter.cc Fri Jan 29 06:24:34 2016 +0100 +++ b/libinterp/corefcn/filter.cc Fri Jan 29 12:23:09 2016 -0500 @@ -38,21 +38,6 @@ #include "error.h" #include "ovl.h" -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -extern MArray -filter (MArray&, MArray&, MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, - int dim); -#endif - template MArray filter (MArray& b, MArray& a, MArray& x, MArray& si, @@ -217,24 +202,6 @@ return y; } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -extern MArray -filter (MArray&, MArray&, MArray&, - MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, - MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, - MArray&, int dim); - -extern MArray -filter (MArray&, MArray&, MArray&, - MArray&, int dim); -#endif - template MArray filter (MArray& b, MArray& a, MArray& x, int dim = -1) diff -r e8c3590da9ff -r 7962dbca527f liboctave/numeric/eigs-base.cc --- a/liboctave/numeric/eigs-base.cc Fri Jan 29 06:24:34 2016 +0100 +++ b/liboctave/numeric/eigs-base.cc Fri Jan 29 12:23:09 2016 -0500 @@ -163,48 +163,6 @@ } - -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static octave_idx_type -lusolve (const SparseMatrix&, const SparseMatrix&, Matrix&); - -static octave_idx_type -lusolve (const SparseComplexMatrix&, const SparseComplexMatrix&, - ComplexMatrix&); - -static octave_idx_type -lusolve (const Matrix&, const Matrix&, Matrix&); - -static octave_idx_type -lusolve (const ComplexMatrix&, const ComplexMatrix&, ComplexMatrix&); - -static ComplexMatrix -ltsolve (const SparseComplexMatrix&, const ColumnVector&, - const ComplexMatrix&); - -static Matrix -ltsolve (const SparseMatrix&, const ColumnVector&, const Matrix&,); - -static ComplexMatrix -ltsolve (const ComplexMatrix&, const ColumnVector&, const ComplexMatrix&); - -static Matrix -ltsolve (const Matrix&, const ColumnVector&, const Matrix&,); - -static ComplexMatrix -utsolve (const SparseComplexMatrix&, const ColumnVector&, const ComplexMatrix&); - -static Matrix -utsolve (const SparseMatrix&, const ColumnVector&, const Matrix&); - -static ComplexMatrix -utsolve (const ComplexMatrix&, const ColumnVector&, const ComplexMatrix&); - -static Matrix -utsolve (const Matrix&, const ColumnVector&, const Matrix&); - -#endif - static void warn_convergence (void) { @@ -3297,188 +3255,6 @@ return ip(4); } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -extern octave_idx_type -EigsRealSymmetricMatrix (const Matrix& m, const std::string typ, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, Matrix &eig_vec, - ColumnVector &eig_val, const Matrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealSymmetricMatrix (const SparseMatrix& m, const std::string typ, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, Matrix &eig_vec, - ColumnVector &eig_val, const SparseMatrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream& os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealSymmetricMatrixShift (const Matrix& m, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, Matrix &eig_vec, - ColumnVector &eig_val, const Matrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealSymmetricMatrixShift (const SparseMatrix& m, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, Matrix &eig_vec, - ColumnVector &eig_val, const SparseMatrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealSymmetricFunc (EigsFunc fun, octave_idx_type n, - const std::string &typ, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, - Matrix &eig_vec, ColumnVector &eig_val, - ColumnVector &resid, std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealNonSymmetricMatrix (const Matrix& m, const std::string typ, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, const Matrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealNonSymmetricMatrix (const SparseMatrix& m, const std::string typ, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const SparseMatrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsRealNonSymmetricMatrixShift (const Matrix& m, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, - ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, const Matrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, - int disp = 0, int maxit = 300); - -extern octave_idx_type -EigsRealNonSymmetricMatrixShift (const SparseMatrix& m, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, - ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const SparseMatrix& b, - ColumnVector &permB, ColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, - int disp = 0, int maxit = 300); - -extern octave_idx_type -EigsRealNonSymmetricFunc (EigsFunc fun, octave_idx_type n, - const std::string &_typ, double sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - ColumnVector &resid, std::ostream& os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsComplexNonSymmetricMatrix (const ComplexMatrix& m, const std::string typ, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const ComplexMatrix& b, ColumnVector &permB, - ComplexColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsComplexNonSymmetricMatrix (const SparseComplexMatrix& m, - const std::string typ, octave_idx_type k, - octave_idx_type p, octave_idx_type &info, - ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const SparseComplexMatrix& b, - ColumnVector &permB, - ComplexColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, int disp = 0, - int maxit = 300); - -extern octave_idx_type -EigsComplexNonSymmetricMatrixShift (const ComplexMatrix& m, Complex sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, - ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const ComplexMatrix& b, - ColumnVector &permB, - ComplexColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, - int disp = 0, int maxit = 300); - -extern octave_idx_type -EigsComplexNonSymmetricMatrixShift (const SparseComplexMatrix& m, - Complex sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, - ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - const SparseComplexMatrix& b, - ColumnVector &permB, - ComplexColumnVector &resid, - std::ostream &os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, - int disp = 0, int maxit = 300); - -extern octave_idx_type -EigsComplexNonSymmetricFunc (EigsComplexFunc fun, octave_idx_type n, - const std::string &_typ, Complex sigma, - octave_idx_type k, octave_idx_type p, - octave_idx_type &info, ComplexMatrix &eig_vec, - ComplexColumnVector &eig_val, - ComplexColumnVector &resid, std::ostream& os, - double tol = std::numeric_limits::epsilon (), - bool rvec = false, bool cholB = 0, - int disp = 0, int maxit = 300); -#endif - #ifndef _MSC_VER template octave_idx_type lusolve (const SparseMatrix&, const SparseMatrix&, Matrix&); diff -r e8c3590da9ff -r 7962dbca527f liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Fri Jan 29 06:24:34 2016 +0100 +++ b/liboctave/numeric/sparse-dmsolve.cc Fri Jan 29 12:23:09 2016 -0500 @@ -109,22 +109,6 @@ return B; } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static MSparse -dmsolve_extract (const MSparse &A, const octave_idx_type *Pinv, - const octave_idx_type *Q, octave_idx_type rst, - octave_idx_type rend, octave_idx_type cst, - octave_idx_type cend, octave_idx_type maxnz, - bool lazy); - -static MSparse -dmsolve_extract (const MSparse &A, const octave_idx_type *Pinv, - const octave_idx_type *Q, octave_idx_type rst, - octave_idx_type rend, octave_idx_type cst, - octave_idx_type cend, octave_idx_type maxnz, - bool lazy); -#endif - template static MArray dmsolve_extract (const MArray &m, const octave_idx_type *, @@ -149,20 +133,6 @@ return result; } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static MArray -dmsolve_extract (const MArray &m, const octave_idx_type *, - const octave_idx_type *, octave_idx_type r1, - octave_idx_type r2, octave_idx_type c1, - octave_idx_type c2) - -static MArray -dmsolve_extract (const MArray &m, const octave_idx_type *, - const octave_idx_type *, octave_idx_type r1, - octave_idx_type r2, octave_idx_type c1, - octave_idx_type c2) -#endif - template static void dmsolve_insert (MArray &a, const MArray &b, const octave_idx_type *Q, @@ -185,16 +155,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_insert (MArray &a, const MArray &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); - -static void -dmsolve_insert (MArray &a, const MArray &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); -#endif - template static void dmsolve_insert (MSparse &a, const MSparse &b, const octave_idx_type *Q, @@ -272,16 +232,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_insert (MSparse &a, const SparseMatrix &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); - -static void -dmsolve_insert (MSparse &a, const MSparse &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); -#endif - template static void dmsolve_permute (MArray &a, const MArray& b, const octave_idx_type *p) @@ -302,20 +252,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_permute (MArray &a, const MArray& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MArray &a, const MArray& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MArray &a, const MArray& b, - const octave_idx_type *p); -#endif - template static void dmsolve_permute (MSparse &a, const MSparse& b, const octave_idx_type *p) @@ -348,20 +284,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_permute (MSparse &a, const MSparse& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MSparse &a, const MSparse& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MSparse &a, const MSparse& b, - const octave_idx_type *p); -#endif - static void solve_singularity_warning (double) { @@ -489,37 +411,3 @@ ("support for CXSparse was unavailable or disabled when liboctave was built"); #endif } - -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -extern Matrix -dmsolve (const SparseMatrix &a, const Matrix &b, - octave_idx_type &info); - -extern ComplexMatrix -dmsolve (const SparseMatrix &a, const ComplexMatrix &b, - octave_idx_type &info); - -extern ComplexMatrix -dmsolve (const SparseComplexMatrix &a, const Matrix &b, - octave_idx_type &info); - -extern ComplexMatrix -dmsolve (const SparseComplexMatrix &a, const ComplexMatrix &b, - octave_idx_type &info); - -extern SparseMatrix -dmsolve (const SparseMatrix &a, const SparseMatrix &b, - octave_idx_type &info); - -extern SparseComplexMatrix -dmsolve (const SparseMatrix &a, const SparseComplexMatrix &b, - octave_idx_type &info); - -extern SparseComplexMatrix -dmsolve (const SparseComplexMatrix &a, const SparseMatrix &b, - octave_idx_type &info); - -extern SparseComplexMatrix -dmsolve (const SparseComplexMatrix &a, const SparseComplexMatrix &b, - octave_idx_type &info); -#endif diff -r e8c3590da9ff -r 7962dbca527f m4/acinclude.m4 --- a/m4/acinclude.m4 Fri Jan 29 06:24:34 2016 +0100 +++ b/m4/acinclude.m4 Fri Jan 29 12:23:09 2016 -0500 @@ -1460,44 +1460,6 @@ fi ]) dnl -dnl Check if C++ compiler needs the new friend template declaration -dnl syntax. -dnl -AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_MSG_CHECKING([for C++ support for new friend template declaration]) - AC_CACHE_VAL([octave_cv_cxx_new_friend_template_decl], - [AC_LANG_PUSH(C++) - rm -f conftest.h - cat > conftest.h < int - operator== (const T&, const T&) - { - return 0; - } -EOB - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include "conftest.h" - ]], [[ - A a (1); - return a == A(1); - ]])], - octave_cv_cxx_new_friend_template_decl=no, - octave_cv_cxx_new_friend_template_decl=yes) - AC_LANG_POP(C++) - ]) - AC_MSG_RESULT([$octave_cv_cxx_new_friend_template_decl]) - if test $octave_cv_cxx_new_friend_template_decl = yes; then - AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL, 1, - [Define to 1 if your compiler supports `<>' stuff for template friends.]) - fi -]) -dnl dnl Check if the compiler supports placement delete. dnl AC_DEFUN([OCTAVE_CXX_PLACEMENT_DELETE], [