diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-08-19 14:18:05 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-08-19 14:18:05 +0200 |
commit | 42e2578ef9fcbb62ad6e07933ccf531f6f7cd1b3 (patch) | |
tree | 90cef174284cad35f0d13d4b991db83335554caf /test/redux.cpp | |
parent | 5734ee6df42991e59609ffd26aaeb3c7aacd61e2 (diff) |
the min/max macros to detect unprotected min/max were undefined by some std header,
so let's declare them after and do the respective fixes ;)
Diffstat (limited to 'test/redux.cpp')
-rw-r--r-- | test/redux.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/redux.cpp b/test/redux.cpp index 3e16797fd..daa219690 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -43,8 +43,8 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m) { s += m1(i,j); p *= m1(i,j); - minc = std::min(internal::real(minc), internal::real(m1(i,j))); - maxc = std::max(internal::real(maxc), internal::real(m1(i,j))); + minc = (std::min)(internal::real(minc), internal::real(m1(i,j))); + maxc = (std::max)(internal::real(maxc), internal::real(m1(i,j))); } const Scalar mean = s/Scalar(RealScalar(rows*cols)); @@ -86,8 +86,8 @@ template<typename VectorType> void vectorRedux(const VectorType& w) { s += v[j]; p *= v[j]; - minc = std::min(minc, internal::real(v[j])); - maxc = std::max(maxc, internal::real(v[j])); + minc = (std::min)(minc, internal::real(v[j])); + maxc = (std::max)(maxc, internal::real(v[j])); } VERIFY_IS_MUCH_SMALLER_THAN(internal::abs(s - v.head(i).sum()), Scalar(1)); VERIFY_IS_APPROX(p, v.head(i).prod()); @@ -103,8 +103,8 @@ template<typename VectorType> void vectorRedux(const VectorType& w) { s += v[j]; p *= v[j]; - minc = std::min(minc, internal::real(v[j])); - maxc = std::max(maxc, internal::real(v[j])); + minc = (std::min)(minc, internal::real(v[j])); + maxc = (std::max)(maxc, internal::real(v[j])); } VERIFY_IS_MUCH_SMALLER_THAN(internal::abs(s - v.tail(size-i).sum()), Scalar(1)); VERIFY_IS_APPROX(p, v.tail(size-i).prod()); @@ -120,8 +120,8 @@ template<typename VectorType> void vectorRedux(const VectorType& w) { s += v[j]; p *= v[j]; - minc = std::min(minc, internal::real(v[j])); - maxc = std::max(maxc, internal::real(v[j])); + minc = (std::min)(minc, internal::real(v[j])); + maxc = (std::max)(maxc, internal::real(v[j])); } VERIFY_IS_MUCH_SMALLER_THAN(internal::abs(s - v.segment(i, size-2*i).sum()), Scalar(1)); VERIFY_IS_APPROX(p, v.segment(i, size-2*i).prod()); @@ -140,7 +140,7 @@ template<typename VectorType> void vectorRedux(const VectorType& w) void test_redux() { // the max size cannot be too large, otherwise reduxion operations obviously generate large errors. - int maxsize = std::min(100,EIGEN_TEST_MAX_SIZE); + int maxsize = (std::min)(100,EIGEN_TEST_MAX_SIZE); EIGEN_UNUSED_VARIABLE(maxsize); for(int i = 0; i < g_repeat; i++) { CALL_SUBTEST_1( matrixRedux(Matrix<float, 1, 1>()) ); |