From 55ec3cc6d50807ae99dfe603e15ff5f7d075ecb3 Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Sun, 7 Jul 2013 19:34:13 +0800 Subject: [PATCH] Prevent copying with internal::noncopyable. --- .../Eigen/src/MatrixFunctions/MatrixExponential.h | 8 ++------ unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h | 10 +++------- .../Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h | 6 +----- .../Eigen/src/MatrixFunctions/MatrixLogarithm.h | 6 +----- unsupported/Eigen/src/MatrixFunctions/MatrixPower.h | 4 ++-- .../Eigen/src/MatrixFunctions/MatrixSquareRoot.h | 6 +++--- unsupported/Eigen/src/MatrixFunctions/StemFunction.h | 2 +- 7 files changed, 13 insertions(+), 29 deletions(-) diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h index ca4532357..e5d4e3ad2 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h @@ -21,8 +21,8 @@ namespace Eigen { * expected to be an instantiation of the Matrix class template. */ template -class MatrixExponential { - +class MatrixExponential : internal::noncopyable +{ public: /** \brief Constructor. @@ -43,10 +43,6 @@ class MatrixExponential { private: - // Prevent copying - MatrixExponential(const MatrixExponential&); - MatrixExponential& operator=(const MatrixExponential&); - /** \brief Compute the (3,3)-Padé approximant to the exponential. * * After exit, \f$ (V+U)(V-U)^{-1} \f$ is the Padé diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h index 7d426640c..a5476ac26 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h @@ -34,7 +34,7 @@ namespace Eigen { template ::Scalar>::IsComplex> -class MatrixFunction +class MatrixFunction : internal::noncopyable { public: @@ -65,7 +65,7 @@ class MatrixFunction * \brief Partial specialization of MatrixFunction for real matrices */ template -class MatrixFunction +class MatrixFunction : internal::noncopyable { private: @@ -111,8 +111,6 @@ class MatrixFunction private: typename internal::nested::type m_A; /**< \brief Reference to argument of matrix function. */ AtomicType& m_atomic; /**< \brief Class for computing matrix function of atomic blocks. */ - - MatrixFunction& operator=(const MatrixFunction&); }; @@ -120,7 +118,7 @@ class MatrixFunction * \brief Partial specialization of MatrixFunction for complex matrices */ template -class MatrixFunction +class MatrixFunction : internal::noncopyable { private: @@ -176,8 +174,6 @@ class MatrixFunction * separation constant is set to 0.1, a value taken from the * paper by Davies and Higham. */ static const RealScalar separation() { return static_cast(0.1); } - - MatrixFunction& operator=(const MatrixFunction&); }; /** \brief Constructor. diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h index efe332c48..d6ff5f1ce 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h @@ -21,7 +21,7 @@ namespace Eigen { * entries are close to each other. */ template -class MatrixFunctionAtomic +class MatrixFunctionAtomic : internal::noncopyable { public: @@ -44,10 +44,6 @@ class MatrixFunctionAtomic private: - // Prevent copying - MatrixFunctionAtomic(const MatrixFunctionAtomic&); - MatrixFunctionAtomic& operator=(const MatrixFunctionAtomic&); - void computeMu(); bool taylorConverged(Index s, const MatrixType& F, const MatrixType& Fincr, const MatrixType& P); diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h index c744fc05f..586c034af 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h @@ -28,7 +28,7 @@ namespace Eigen { * \sa class MatrixFunctionAtomic, MatrixBase::log() */ template -class MatrixLogarithmAtomic +class MatrixLogarithmAtomic : internal::noncopyable { public: @@ -71,10 +71,6 @@ private: std::numeric_limits::digits<= 64? 8: // extended precision std::numeric_limits::digits<=106? 10: // double-double 11; // quadruple precision - - // Prevent copying - MatrixLogarithmAtomic(const MatrixLogarithmAtomic&); - MatrixLogarithmAtomic& operator=(const MatrixLogarithmAtomic&); }; /** \brief Compute logarithm of triangular matrix with clustered eigenvalues. */ diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h index a49db1916..5d580ac9e 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h @@ -38,7 +38,7 @@ class MatrixPowerRetval : public ReturnByValue< MatrixPowerRetval > }; template -class MatrixPowerAtomic +class MatrixPowerAtomic : internal::noncopyable { private: enum { @@ -257,7 +257,7 @@ MatrixPowerAtomic::computeSuperDiag(RealScalar curr, RealScalar prev * Output: \verbinclude MatrixPower_optimal.out */ template -class MatrixPower +class MatrixPower : internal::noncopyable { private: typedef typename MatrixType::Scalar Scalar; diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h index b48ea9d46..f3bcef409 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h @@ -24,7 +24,7 @@ namespace Eigen { * \sa MatrixSquareRoot, MatrixSquareRootTriangular */ template -class MatrixSquareRootQuasiTriangular +class MatrixSquareRootQuasiTriangular : internal::noncopyable { public: @@ -253,7 +253,7 @@ void MatrixSquareRootQuasiTriangular * \sa MatrixSquareRoot, MatrixSquareRootQuasiTriangular */ template -class MatrixSquareRootTriangular +class MatrixSquareRootTriangular : internal::noncopyable { public: MatrixSquareRootTriangular(const MatrixType& A) @@ -370,7 +370,7 @@ class MatrixSquareRoot // ********** Partial specialization for complex matrices ********** template -class MatrixSquareRoot +class MatrixSquareRoot : internal::noncopyable { public: diff --git a/unsupported/Eigen/src/MatrixFunctions/StemFunction.h b/unsupported/Eigen/src/MatrixFunctions/StemFunction.h index 724e55c1d..0a815d834 100644 --- a/unsupported/Eigen/src/MatrixFunctions/StemFunction.h +++ b/unsupported/Eigen/src/MatrixFunctions/StemFunction.h @@ -16,7 +16,7 @@ namespace Eigen { * \brief Stem functions corresponding to standard mathematical functions. */ template -class StdStemFunctions +class StdStemFunctions : internal::noncopyable { public: