From 42e2578ef9fcbb62ad6e07933ccf531f6f7cd1b3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 19 Aug 2011 14:18:05 +0200 Subject: 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 ;) --- test/redux.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/redux.cpp') 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 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 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 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 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 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()) ); -- cgit v1.2.3