From a997dacc6728157e143e772545a47bac5e920e49 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 24 Oct 2011 09:51:02 +0200 Subject: [PATCH] mark deprecated sparse solvers as so. --- .../src/SparseExtra/CholmodSupportLegacy.h | 7 +++++-- .../Eigen/src/SparseExtra/SparseLDLTLegacy.h | 13 ++++++++----- unsupported/Eigen/src/SparseExtra/SparseLLT.h | 17 ++++++++++------- unsupported/Eigen/src/SparseExtra/SparseLU.h | 13 ++++++++----- .../src/SparseExtra/SuperLUSupportLegacy.h | 7 +++++-- .../src/SparseExtra/UmfPackSupportLegacy.h | 8 +++++--- unsupported/test/sparse_ldlt.cpp | 2 ++ unsupported/test/sparse_llt.cpp | 2 ++ unsupported/test/sparse_lu_legacy.cpp | 2 ++ 9 files changed, 47 insertions(+), 24 deletions(-) diff --git a/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h index 676cd8574..33af6a176 100644 --- a/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h +++ b/unsupported/Eigen/src/SparseExtra/CholmodSupportLegacy.h @@ -121,6 +121,7 @@ MappedSparseMatrix map_cholmod_sparse_to_eigen(cholmod_spars } // namespace internal +/** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient */ template class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType> { @@ -139,13 +140,15 @@ class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType> typedef _MatrixType MatrixType; typedef typename MatrixType::Index Index; - SparseLLT(int flags = 0) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLLT(int flags = 0) : Base(flags), m_cholmodFactor(0) { cholmod_start(&m_cholmod); } - SparseLLT(const MatrixType& matrix, int flags = 0) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLLT(const MatrixType& matrix, int flags = 0) : Base(flags), m_cholmodFactor(0) { cholmod_start(&m_cholmod); diff --git a/unsupported/Eigen/src/SparseExtra/SparseLDLTLegacy.h b/unsupported/Eigen/src/SparseExtra/SparseLDLTLegacy.h index 6b240f169..1d60e0f1e 100644 --- a/unsupported/Eigen/src/SparseExtra/SparseLDLTLegacy.h +++ b/unsupported/Eigen/src/SparseExtra/SparseLDLTLegacy.h @@ -63,7 +63,8 @@ LDL License: #ifndef EIGEN_SPARSELDLT_LEGACY_H #define EIGEN_SPARSELDLT_LEGACY_H -/** \ingroup Sparse_Module +/** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient + * \ingroup Sparse_Module * * \class SparseLDLT * @@ -94,17 +95,19 @@ class SparseLDLT typedef typename MatrixType::Index Index; typedef SparseMatrix CholMatrixType; - /** Creates a dummy LDLT factorization object with flags \a flags. */ - SparseLDLT(int flags = 0) + /** \deprecated the entire class is deprecated + * Creates a dummy LDLT factorization object with flags \a flags. */ + EIGEN_DEPRECATED SparseLDLT(int flags = 0) : m_flags(flags), m_status(0) { eigen_assert((MatrixType::Flags&RowMajorBit)==0); m_precision = RealScalar(0.1) * Eigen::NumTraits::dummy_precision(); } - /** Creates a LDLT object and compute the respective factorization of \a matrix using + /** \deprecated the entire class is deprecated + * Creates a LDLT object and compute the respective factorization of \a matrix using * flags \a flags. */ - SparseLDLT(const MatrixType& matrix, int flags = 0) + EIGEN_DEPRECATED SparseLDLT(const MatrixType& matrix, int flags = 0) : m_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0) { eigen_assert((MatrixType::Flags&RowMajorBit)==0); diff --git a/unsupported/Eigen/src/SparseExtra/SparseLLT.h b/unsupported/Eigen/src/SparseExtra/SparseLLT.h index ac042217b..8ae116e82 100644 --- a/unsupported/Eigen/src/SparseExtra/SparseLLT.h +++ b/unsupported/Eigen/src/SparseExtra/SparseLLT.h @@ -25,7 +25,8 @@ #ifndef EIGEN_SPARSELLT_H #define EIGEN_SPARSELLT_H -/** \ingroup Sparse_Module +/** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient + * \ingroup Sparse_Module * * \class SparseLLT * @@ -52,16 +53,18 @@ class SparseLLT typedef _MatrixType MatrixType; typedef typename MatrixType::Index Index; - /** Creates a dummy LLT factorization object with flags \a flags. */ - SparseLLT(int flags = 0) + /** \deprecated the entire class is deprecated + * Creates a dummy LLT factorization object with flags \a flags. */ + EIGEN_DEPRECATED SparseLLT(int flags = 0) : m_flags(flags), m_status(0) { m_precision = RealScalar(0.1) * Eigen::NumTraits::dummy_precision(); } - /** Creates a LLT object and compute the respective factorization of \a matrix using + /** \deprecated the entire class is deprecated + * Creates a LLT object and compute the respective factorization of \a matrix using * flags \a flags. */ - SparseLLT(const MatrixType& matrix, int flags = 0) + EIGEN_DEPRECATED SparseLLT(const MatrixType& matrix, int flags = 0) : m_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0) { m_precision = RealScalar(0.1) * Eigen::NumTraits::dummy_precision(); @@ -179,7 +182,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a) // TODO estimate the number of non zeros m_matrix.setZero(); - m_matrix.reserve(a.nonZeros()*2); + m_matrix.reserve(a.nonZeros()*10); for (Index j = 0; j < size; ++j) { Scalar x = internal::real(a.coeff(j,j)); @@ -222,7 +225,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a) for (typename AmbiVector::Iterator it(tempVector, m_precision*rx); it; ++it) { // FIXME use insertBack - m_matrix.insert(it.index(), j) = it.value() * y; + m_matrix.insertBack(it.index(), j) = it.value() * y; } } m_matrix.finalize(); diff --git a/unsupported/Eigen/src/SparseExtra/SparseLU.h b/unsupported/Eigen/src/SparseExtra/SparseLU.h index 3d10dbbee..ffcdb88e2 100644 --- a/unsupported/Eigen/src/SparseExtra/SparseLU.h +++ b/unsupported/Eigen/src/SparseExtra/SparseLU.h @@ -31,7 +31,8 @@ enum { SvAdjoint = 2 }; -/** \ingroup Sparse_Module +/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU + * \ingroup Sparse_Module * * \class SparseLU * @@ -56,16 +57,18 @@ class SparseLU public: typedef _MatrixType MatrixType; - /** Creates a dummy LU factorization object with flags \a flags. */ - SparseLU(int flags = 0) + /** \deprecated the entire class is deprecated + * Creates a dummy LU factorization object with flags \a flags. */ + EIGEN_DEPRECATED SparseLU(int flags = 0) : m_flags(flags), m_status(0) { m_precision = RealScalar(0.1) * Eigen::NumTraits::dummy_precision(); } - /** Creates a LU object and compute the respective factorization of \a matrix using + /** \deprecated the entire class is deprecated + * Creates a LU object and compute the respective factorization of \a matrix using * flags \a flags. */ - SparseLU(const _MatrixType& matrix, int flags = 0) + EIGEN_DEPRECATED SparseLU(const _MatrixType& matrix, int flags = 0) : /*m_matrix(matrix.rows(), matrix.cols()),*/ m_flags(flags), m_status(0) { m_precision = RealScalar(0.1) * Eigen::NumTraits::dummy_precision(); diff --git a/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h index e01aba4e6..e85d8d36e 100644 --- a/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h +++ b/unsupported/Eigen/src/SparseExtra/SuperLUSupportLegacy.h @@ -25,6 +25,7 @@ #ifndef EIGEN_SUPERLUSUPPORT_LEGACY_H #define EIGEN_SUPERLUSUPPORT_LEGACY_H +/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */ template class SparseLU : public SparseLU { @@ -42,12 +43,14 @@ class SparseLU : public SparseLU public: - SparseLU(int flags = NaturalOrdering) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLU(int flags = NaturalOrdering) : Base(flags) { } - SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) : Base(flags) { compute(matrix); diff --git a/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h b/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h index fa01bb338..3d30e1ed1 100644 --- a/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h +++ b/unsupported/Eigen/src/SparseExtra/UmfPackSupportLegacy.h @@ -25,7 +25,7 @@ #ifndef EIGEN_UMFPACKSUPPORT_LEGACY_H #define EIGEN_UMFPACKSUPPORT_LEGACY_H - +/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */ template class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType> { @@ -45,12 +45,14 @@ class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType> typedef _MatrixType MatrixType; typedef typename MatrixType::Index Index; - SparseLU(int flags = NaturalOrdering) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLU(int flags = NaturalOrdering) : Base(flags), m_numeric(0) { } - SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) + /** \deprecated the entire class is deprecated */ + EIGEN_DEPRECATED SparseLU(const MatrixType& matrix, int flags = NaturalOrdering) : Base(flags), m_numeric(0) { compute(matrix); diff --git a/unsupported/test/sparse_ldlt.cpp b/unsupported/test/sparse_ldlt.cpp index 4cb61bf6c..f6426b54e 100644 --- a/unsupported/test/sparse_ldlt.cpp +++ b/unsupported/test/sparse_ldlt.cpp @@ -22,6 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see . +#define EIGEN_NO_DEPRECATED_WARNING + #include "sparse.h" #include diff --git a/unsupported/test/sparse_llt.cpp b/unsupported/test/sparse_llt.cpp index 1b3b3bb9b..040681593 100644 --- a/unsupported/test/sparse_llt.cpp +++ b/unsupported/test/sparse_llt.cpp @@ -22,6 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see . +#define EIGEN_NO_DEPRECATED_WARNING + #include "sparse.h" #include diff --git a/unsupported/test/sparse_lu_legacy.cpp b/unsupported/test/sparse_lu_legacy.cpp index e7fae0682..341e9a6ea 100644 --- a/unsupported/test/sparse_lu_legacy.cpp +++ b/unsupported/test/sparse_lu_legacy.cpp @@ -22,6 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see . +#define EIGEN_NO_DEPRECATED_WARNING + #include "sparse.h" #include