diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-01-23 12:26:32 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-01-23 12:26:32 +0000 |
commit | 6a722602e637cc248265c13735461bd6d7cb5ced (patch) | |
tree | ea5237baf15657ce45ce2236f54964097eb69400 /test | |
parent | d3dcb04f2d9fa75b6dc8d2fb51d2a6785b17e70f (diff) |
fix a few remaining warnings
and fix commainitializer unit test with MSVC
Diffstat (limited to 'test')
-rw-r--r-- | test/commainitializer.cpp | 3 | ||||
-rw-r--r-- | test/sparse.h | 11 | ||||
-rw-r--r-- | test/sparse_basic.cpp | 4 | ||||
-rw-r--r-- | test/submatrices.cpp | 9 |
4 files changed, 18 insertions, 9 deletions
diff --git a/test/commainitializer.cpp b/test/commainitializer.cpp index a93a57d8f..503dd9be4 100644 --- a/test/commainitializer.cpp +++ b/test/commainitializer.cpp @@ -30,7 +30,10 @@ void test_commainitializer() Matrix4d m4; VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8) ); + + #ifndef _MSC_VER VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) ); + #endif double data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; Matrix3d ref = Map<Matrix<double,3,3,RowMajor> >(data); diff --git a/test/sparse.h b/test/sparse.h index d18217e0a..128b129e8 100644 --- a/test/sparse.h +++ b/test/sparse.h @@ -24,15 +24,20 @@ #ifndef EIGEN_TESTSPARSE_H -#ifdef __GNUC__ -#include <ext/hash_map> +#include "main.h" + +#if EIGEN_GNUC_AT_LEAST(4,0) +#include <tr1/unordered_map> +#define EIGEN_UNORDERED_MAP_SUPPORT +namespace std { + using std::tr1::unordered_map; +} #endif #ifdef EIGEN_GOOGLEHASH_SUPPORT #include <google/sparse_hash_map> #endif -#include "main.h" #include <Eigen/Cholesky> #include <Eigen/LU> #include <Eigen/Sparse> diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 68e35736c..93065bbde 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -167,8 +167,8 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re // VERIFY_IS_APPROX(m, refMat); VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdMapTraits> >(m,refMat,nonzeroCoords) )); - #ifdef _HASH_MAP - VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GnuHashMapTraits> >(m,refMat,nonzeroCoords) )); + #ifdef EIGEN_UNORDERED_MAP_SUPPORT + VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, StdUnorderedMapTraits> >(m,refMat,nonzeroCoords) )); #endif #ifdef _DENSE_HASH_MAP_H_ VERIFY(( test_random_setter<RandomSetter<SparseMatrixType, GoogleDenseHashMapTraits> >(m,refMat,nonzeroCoords) )); diff --git a/test/submatrices.cpp b/test/submatrices.cpp index c9552ace2..63c61baca 100644 --- a/test/submatrices.cpp +++ b/test/submatrices.cpp @@ -57,6 +57,7 @@ template<typename MatrixType> void submatrices(const MatrixType& m) Row.h Column.h Block.h Minor.h DiagonalCoeffs.h */ typedef typename MatrixType::Scalar Scalar; + typedef typename MatrixType::RealScalar RealScalar; typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType; typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType; int rows = m.rows(); @@ -140,11 +141,11 @@ template<typename MatrixType> void submatrices(const MatrixType& m) } // stress some basic stuffs with block matrices - VERIFY(ones.col(c1).sum() == Scalar(rows)); - VERIFY(ones.row(r1).sum() == Scalar(cols)); + VERIFY(ei_real(ones.col(c1).sum()) == RealScalar(rows)); + VERIFY(ei_real(ones.row(r1).sum()) == RealScalar(cols)); - VERIFY(ones.col(c1).dot(ones.col(c2)) == Scalar(rows)); - VERIFY(ones.row(r1).dot(ones.row(r2)) == Scalar(cols)); + VERIFY(ei_real(ones.col(c1).dot(ones.col(c2))) == RealScalar(rows)); + VERIFY(ei_real(ones.row(r1).dot(ones.row(r2))) == RealScalar(cols)); } void test_submatrices() |