add a noncopyable base class for decompositions

This commit is contained in:
Gael Guennebaud 2012-06-04 13:21:15 +02:00
parent 1b20e16546
commit a2ae063491
5 changed files with 19 additions and 4 deletions

View File

@ -103,6 +103,21 @@ template<bool Condition, typename T> struct enable_if;
template<typename T> struct enable_if<true,T>
{ typedef T type; };
/** \internal
* A base class do disable default copy ctor and copy assignement operator.
*/
class noncopyable
{
noncopyable(const noncopyable&);
const noncopyable& operator=(const noncopyable&);
protected:
noncopyable() {}
~noncopyable() {}
};
/** \internal
* Convenient struct to get the result type of a unary or binary functor.
*

View File

@ -51,7 +51,7 @@ namespace Eigen {
* see http://www-users.cs.umn.edu/~saad/software/SPARSKIT/README for more details.
*/
template <typename _Scalar>
class IncompleteLUT
class IncompleteLUT : internal::noncopyable
{
typedef _Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;

View File

@ -33,7 +33,7 @@ namespace Eigen {
* \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner
*/
template< typename Derived>
class IterativeSolverBase
class IterativeSolverBase : internal::noncopyable
{
public:
typedef typename internal::traits<Derived>::MatrixType MatrixType;

View File

@ -303,7 +303,7 @@ MappedSparseMatrix<Scalar,Flags,Index> map_superlu(SluMatrix& sluMat)
* \brief The base class for the direct and incomplete LU factorization of SuperLU
*/
template<typename _MatrixType, typename Derived>
class SuperLUBase
class SuperLUBase : internal::noncopyable
{
public:
typedef _MatrixType MatrixType;

View File

@ -136,7 +136,7 @@ inline int umfpack_get_determinant(std::complex<double> *Mx, double *Ex, void *N
* \sa \ref TutorialSparseDirectSolvers
*/
template<typename _MatrixType>
class UmfPackLU
class UmfPackLU : internal::noncopyable
{
public:
typedef _MatrixType MatrixType;