mark deprecated sparse solvers as so.

This commit is contained in:
Gael Guennebaud 2011-10-24 09:51:02 +02:00
parent 39d4585bff
commit a997dacc67
9 changed files with 47 additions and 24 deletions

View File

@ -121,6 +121,7 @@ MappedSparseMatrix<Scalar,Flags,Index> map_cholmod_sparse_to_eigen(cholmod_spars
} // namespace internal } // namespace internal
/** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient */
template<typename _MatrixType> template<typename _MatrixType>
class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType> class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType>
{ {
@ -139,13 +140,15 @@ class SparseLLT<_MatrixType, Cholmod> : public SparseLLT<_MatrixType>
typedef _MatrixType MatrixType; typedef _MatrixType MatrixType;
typedef typename MatrixType::Index Index; 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) : Base(flags), m_cholmodFactor(0)
{ {
cholmod_start(&m_cholmod); 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) : Base(flags), m_cholmodFactor(0)
{ {
cholmod_start(&m_cholmod); cholmod_start(&m_cholmod);

View File

@ -63,7 +63,8 @@ LDL License:
#ifndef EIGEN_SPARSELDLT_LEGACY_H #ifndef EIGEN_SPARSELDLT_LEGACY_H
#define 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 * \class SparseLDLT
* *
@ -94,17 +95,19 @@ class SparseLDLT
typedef typename MatrixType::Index Index; typedef typename MatrixType::Index Index;
typedef SparseMatrix<Scalar,ColMajor,Index> CholMatrixType; typedef SparseMatrix<Scalar,ColMajor,Index> CholMatrixType;
/** Creates a dummy LDLT factorization object with flags \a flags. */ /** \deprecated the entire class is deprecated
SparseLDLT(int flags = 0) * Creates a dummy LDLT factorization object with flags \a flags. */
EIGEN_DEPRECATED SparseLDLT(int flags = 0)
: m_flags(flags), m_status(0) : m_flags(flags), m_status(0)
{ {
eigen_assert((MatrixType::Flags&RowMajorBit)==0); eigen_assert((MatrixType::Flags&RowMajorBit)==0);
m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision(); m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::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. */ * 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) : m_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0)
{ {
eigen_assert((MatrixType::Flags&RowMajorBit)==0); eigen_assert((MatrixType::Flags&RowMajorBit)==0);

View File

@ -25,7 +25,8 @@
#ifndef EIGEN_SPARSELLT_H #ifndef EIGEN_SPARSELLT_H
#define EIGEN_SPARSELLT_H #define EIGEN_SPARSELLT_H
/** \ingroup Sparse_Module /** \deprecated use class SimplicialLDLT, or class SimplicialLLT, class ConjugateGradient
* \ingroup Sparse_Module
* *
* \class SparseLLT * \class SparseLLT
* *
@ -52,16 +53,18 @@ class SparseLLT
typedef _MatrixType MatrixType; typedef _MatrixType MatrixType;
typedef typename MatrixType::Index Index; typedef typename MatrixType::Index Index;
/** Creates a dummy LLT factorization object with flags \a flags. */ /** \deprecated the entire class is deprecated
SparseLLT(int flags = 0) * Creates a dummy LLT factorization object with flags \a flags. */
EIGEN_DEPRECATED SparseLLT(int flags = 0)
: m_flags(flags), m_status(0) : m_flags(flags), m_status(0)
{ {
m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision(); m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::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. */ * 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_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0)
{ {
m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision(); m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision();
@ -179,7 +182,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a)
// TODO estimate the number of non zeros // TODO estimate the number of non zeros
m_matrix.setZero(); m_matrix.setZero();
m_matrix.reserve(a.nonZeros()*2); m_matrix.reserve(a.nonZeros()*10);
for (Index j = 0; j < size; ++j) for (Index j = 0; j < size; ++j)
{ {
Scalar x = internal::real(a.coeff(j,j)); Scalar x = internal::real(a.coeff(j,j));
@ -222,7 +225,7 @@ void SparseLLT<_MatrixType,Backend>::compute(const _MatrixType& a)
for (typename AmbiVector<Scalar,Index>::Iterator it(tempVector, m_precision*rx); it; ++it) for (typename AmbiVector<Scalar,Index>::Iterator it(tempVector, m_precision*rx); it; ++it)
{ {
// FIXME use insertBack // FIXME use insertBack
m_matrix.insert(it.index(), j) = it.value() * y; m_matrix.insertBack(it.index(), j) = it.value() * y;
} }
} }
m_matrix.finalize(); m_matrix.finalize();

View File

@ -31,7 +31,8 @@ enum {
SvAdjoint = 2 SvAdjoint = 2
}; };
/** \ingroup Sparse_Module /** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU
* \ingroup Sparse_Module
* *
* \class SparseLU * \class SparseLU
* *
@ -56,16 +57,18 @@ class SparseLU
public: public:
typedef _MatrixType MatrixType; typedef _MatrixType MatrixType;
/** Creates a dummy LU factorization object with flags \a flags. */ /** \deprecated the entire class is deprecated
SparseLU(int flags = 0) * Creates a dummy LU factorization object with flags \a flags. */
EIGEN_DEPRECATED SparseLU(int flags = 0)
: m_flags(flags), m_status(0) : m_flags(flags), m_status(0)
{ {
m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision(); m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::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. */ * 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_matrix(matrix.rows(), matrix.cols()),*/ m_flags(flags), m_status(0)
{ {
m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision(); m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision();

View File

@ -25,6 +25,7 @@
#ifndef EIGEN_SUPERLUSUPPORT_LEGACY_H #ifndef EIGEN_SUPERLUSUPPORT_LEGACY_H
#define EIGEN_SUPERLUSUPPORT_LEGACY_H #define EIGEN_SUPERLUSUPPORT_LEGACY_H
/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */
template<typename MatrixType> template<typename MatrixType>
class SparseLU<MatrixType,SuperLULegacy> : public SparseLU<MatrixType> class SparseLU<MatrixType,SuperLULegacy> : public SparseLU<MatrixType>
{ {
@ -42,12 +43,14 @@ class SparseLU<MatrixType,SuperLULegacy> : public SparseLU<MatrixType>
public: public:
SparseLU(int flags = NaturalOrdering) /** \deprecated the entire class is deprecated */
EIGEN_DEPRECATED SparseLU(int flags = NaturalOrdering)
: Base(flags) : 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) : Base(flags)
{ {
compute(matrix); compute(matrix);

View File

@ -25,7 +25,7 @@
#ifndef EIGEN_UMFPACKSUPPORT_LEGACY_H #ifndef EIGEN_UMFPACKSUPPORT_LEGACY_H
#define EIGEN_UMFPACKSUPPORT_LEGACY_H #define EIGEN_UMFPACKSUPPORT_LEGACY_H
/** \deprecated use class BiCGSTAB, class SuperLU, or class UmfPackLU */
template<typename _MatrixType> template<typename _MatrixType>
class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType> class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType>
{ {
@ -45,12 +45,14 @@ class SparseLU<_MatrixType,UmfPack> : public SparseLU<_MatrixType>
typedef _MatrixType MatrixType; typedef _MatrixType MatrixType;
typedef typename MatrixType::Index Index; 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) : 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) : Base(flags), m_numeric(0)
{ {
compute(matrix); compute(matrix);

View File

@ -22,6 +22,8 @@
// License and a copy of the GNU General Public License along with // License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#define EIGEN_NO_DEPRECATED_WARNING
#include "sparse.h" #include "sparse.h"
#include <Eigen/SparseExtra> #include <Eigen/SparseExtra>

View File

@ -22,6 +22,8 @@
// License and a copy of the GNU General Public License along with // License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#define EIGEN_NO_DEPRECATED_WARNING
#include "sparse.h" #include "sparse.h"
#include <Eigen/SparseExtra> #include <Eigen/SparseExtra>

View File

@ -22,6 +22,8 @@
// License and a copy of the GNU General Public License along with // License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#define EIGEN_NO_DEPRECATED_WARNING
#include "sparse.h" #include "sparse.h"
#include <Eigen/SparseExtra> #include <Eigen/SparseExtra>