Mercurial > jwe > octave
changeset 21149:7962dbca527f
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 29 Jan 2016 12:23:09 -0500 |
parents | e8c3590da9ff |
children | f090661930ba |
files | configure.ac libinterp/corefcn/filter.cc liboctave/numeric/eigs-base.cc liboctave/numeric/sparse-dmsolve.cc m4/acinclude.m4 |
diffstat | 5 files changed, 0 insertions(+), 410 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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<double> -filter (MArray<double>&, MArray<double>&, MArray<double>&, int dim); - -extern MArray<Complex> -filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, int dim); - -extern MArray<float> -filter (MArray<float>&, MArray<float>&, MArray<float>&, int dim); - -extern MArray<FloatComplex> -filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, - int dim); -#endif - template <typename T> MArray<T> filter (MArray<T>& b, MArray<T>& a, MArray<T>& x, MArray<T>& si, @@ -217,24 +202,6 @@ return y; } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -extern MArray<double> -filter (MArray<double>&, MArray<double>&, MArray<double>&, - MArray<double>&, int dim); - -extern MArray<Complex> -filter (MArray<Complex>&, MArray<Complex>&, MArray<Complex>&, - MArray<Complex>&, int dim); - -extern MArray<float> -filter (MArray<float>&, MArray<float>&, MArray<float>&, - MArray<float>&, int dim); - -extern MArray<FloatComplex> -filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, - MArray<FloatComplex>&, int dim); -#endif - template <typename T> MArray<T> filter (MArray<T>& b, MArray<T>& a, MArray<T>& x, int dim = -1)
--- 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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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<double>::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&);
--- 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<double> -dmsolve_extract (const MSparse<double> &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<Complex> -dmsolve_extract (const MSparse<Complex> &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 <typename T> static MArray<T> dmsolve_extract (const MArray<T> &m, const octave_idx_type *, @@ -149,20 +133,6 @@ return result; } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static MArray<double> -dmsolve_extract (const MArray<double> &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<Complex> -dmsolve_extract (const MArray<Complex> &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 <typename T> static void dmsolve_insert (MArray<T> &a, const MArray<T> &b, const octave_idx_type *Q, @@ -185,16 +155,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_insert (MArray<double> &a, const MArray<double> &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); - -static void -dmsolve_insert (MArray<Complex> &a, const MArray<Complex> &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); -#endif - template <typename T> static void dmsolve_insert (MSparse<T> &a, const MSparse<T> &b, const octave_idx_type *Q, @@ -272,16 +232,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_insert (MSparse<double> &a, const SparseMatrix &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); - -static void -dmsolve_insert (MSparse<Complex> &a, const MSparse<Complex> &b, - const octave_idx_type *Q, octave_idx_type r, octave_idx_type c); -#endif - template <typename T, typename RT> static void dmsolve_permute (MArray<RT> &a, const MArray<T>& b, const octave_idx_type *p) @@ -302,20 +252,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_permute (MArray<double> &a, const MArray<double>& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MArray<Complex> &a, const MArray<double>& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MArray<Complex> &a, const MArray<Complex>& b, - const octave_idx_type *p); -#endif - template <typename T, typename RT> static void dmsolve_permute (MSparse<RT> &a, const MSparse<T>& b, const octave_idx_type *p) @@ -348,20 +284,6 @@ } } -#if ! defined (CXX_NEW_FRIEND_TEMPLATE_DECL) -static void -dmsolve_permute (MSparse<double> &a, const MSparse<double>& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MSparse<Complex> &a, const MSparse<double>& b, - const octave_idx_type *p); - -static void -dmsolve_permute (MSparse<Complex> &a, const MSparse<Complex>& 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
--- 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 <<EOB - struct A { - friend int operator== (const A&, const A&); - A (int) { } - }; - - template <class T> 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], [