From c7baf07a3e687784d7fcf7f00475f69f62c510e3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 7 Jan 2011 15:53:02 +0100 Subject: [PATCH] add plugin mechanism to sparse objects --- Eigen/src/Sparse/DynamicSparseMatrix.h | 4 ++++ Eigen/src/Sparse/SparseMatrix.h | 4 ++++ Eigen/src/Sparse/SparseMatrixBase.h | 16 ++++++++++------ Eigen/src/Sparse/SparseVector.h | 4 ++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h index ec6c3be8f..710b978fe 100644 --- a/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -333,6 +333,10 @@ class DynamicSparseMatrix /** \deprecated use finalize() * Does nothing. Provided for compatibility with SparseMatrix. */ EIGEN_DEPRECATED void endFill() {} + +# ifdef EIGEN_DYNAMICSPARSEMATRIX_PLUGIN +# include EIGEN_DYNAMICSPARSEMATRIX_PLUGIN +# endif }; template diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h index a29debddc..2346a0c2e 100644 --- a/Eigen/src/Sparse/SparseMatrix.h +++ b/Eigen/src/Sparse/SparseMatrix.h @@ -600,6 +600,10 @@ class SparseMatrix /** \deprecated use finalize */ EIGEN_DEPRECATED void endFill() { finalize(); } + +# ifdef EIGEN_SPARSEMATRIX_PLUGIN +# include EIGEN_SPARSEMATRIX_PLUGIN +# endif private: struct default_prunning_func { diff --git a/Eigen/src/Sparse/SparseMatrixBase.h b/Eigen/src/Sparse/SparseMatrixBase.h index c4c11f5fd..6ad428324 100644 --- a/Eigen/src/Sparse/SparseMatrixBase.h +++ b/Eigen/src/Sparse/SparseMatrixBase.h @@ -124,12 +124,16 @@ template class SparseMatrixBase : public EigenBase typedef SparseMatrix PlainObject; - #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase - #include "../plugins/CommonCwiseUnaryOps.h" - #include "../plugins/CommonCwiseBinaryOps.h" - #include "../plugins/MatrixCwiseUnaryOps.h" - #include "../plugins/MatrixCwiseBinaryOps.h" - #undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase +# include "../plugins/CommonCwiseUnaryOps.h" +# include "../plugins/CommonCwiseBinaryOps.h" +# include "../plugins/MatrixCwiseUnaryOps.h" +# include "../plugins/MatrixCwiseBinaryOps.h" +# ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN +# include EIGEN_SPARSEMATRIXBASE_PLUGIN +# endif +# undef EIGEN_CURRENT_STORAGE_BASE_CLASS +#undef EIGEN_CURRENT_STORAGE_BASE_CLASS #ifndef EIGEN_PARSED_BY_DOXYGEN /** This is the "real scalar" type; if the \a Scalar type is already real numbers diff --git a/Eigen/src/Sparse/SparseVector.h b/Eigen/src/Sparse/SparseVector.h index 88f96c304..47af90594 100644 --- a/Eigen/src/Sparse/SparseVector.h +++ b/Eigen/src/Sparse/SparseVector.h @@ -384,6 +384,10 @@ class SparseVector /** \deprecated use finalize() */ EIGEN_DEPRECATED void endFill() {} + +# ifdef EIGEN_SPARSEVECTOR_PLUGIN +# include EIGEN_SPARSEVECTOR_PLUGIN +# endif }; template