* more MSVC warning fixes from Kenneth Riddile

* actually GCC 4.3.0 has a bug, "deprecated" placed at the end
  of a function prototype doesn't have any effect, moving them to
  the start of the function prototype makes it actually work!
* finish porting the cholesky unit-test to the new LLT/LDLT,
  after the above fix revealed a deprecated warning
This commit is contained in:
Benoit Jacob 2008-12-19 02:59:04 +00:00
parent f34a4fa335
commit 84bb868f07
5 changed files with 11 additions and 6 deletions

View File

@ -58,7 +58,7 @@ template<typename MatrixType> class Cholesky
inline bool isPositiveDefinite(void) const { return m_isPositiveDefinite; }
template<typename Derived>
typename MatrixBase<Derived>::PlainMatrixType_ColMajor solve(const MatrixBase<Derived> &b) const EIGEN_DEPRECATED;
EIGEN_DEPRECATED typename MatrixBase<Derived>::PlainMatrixType_ColMajor solve(const MatrixBase<Derived> &b) const;
template<typename RhsDerived, typename ResDerived>
bool solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const;

View File

@ -55,7 +55,7 @@ template<typename MatrixType> class CholeskyWithoutSquareRoot
inline bool isPositiveDefinite(void) const { return m_isPositiveDefinite; }
template<typename Derived>
typename Derived::Eval solve(const MatrixBase<Derived> &b) const EIGEN_DEPRECATED;
EIGEN_DEPRECATED typename Derived::Eval solve(const MatrixBase<Derived> &b) const;
template<typename RhsDerived, typename ResDerived>
bool solve(const MatrixBase<RhsDerived> &b, MatrixBase<ResDerived> *result) const;

View File

@ -495,7 +495,12 @@ template<typename Derived> class MatrixBase
* Notice that in the case of a plain matrix or vector (not an expression) this function just returns
* a const reference, in order to avoid a useless copy.
*/
EIGEN_ALWAYS_INLINE const typename ei_eval<Derived>::type eval() const
#ifdef _MSC_VER
inline // MSVC 2008 can't force-inline this method and emits a warning, so do just 'inline'
#else
EIGEN_ALWAYS_INLINE
#endif
const typename ei_eval<Derived>::type eval() const
{
return typename ei_eval<Derived>::type(derived());
}

View File

@ -3,7 +3,7 @@
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4181 4244 4127 )
#pragma warning( disable : 4181 4244 4127 4211 )
#endif
#endif // EIGEN_DISABLEMSVCWARNINGS_H

View File

@ -63,9 +63,9 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
convert<VectorType>(vecB, gVecX);
Gsl::cholesky(gMatA);
Gsl::cholesky_solve(gMatA, gVecB, gVecX);
VectorType vecX, _vecX, _vecB;
VectorType vecX(rows), _vecX, _vecB;
convert(gVecX, _vecX);
vecX.set( symm.cholesky().solve(vecB) );
symm.llt().solve(vecB, &vecX);
Gsl::prod(gSymm, gVecX, gVecB);
convert(gVecB, _vecB);
// test gsl itself !