From 22bff949c898e7c340a415d771145c0bd22317d6 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 21 Jul 2011 11:19:36 +0200 Subject: protect calls to min and max with parentheses to make Eigen compatible with default windows.h (transplanted from 49b6e9143e1d74441924c0c313536e263e12a55c ) --- Eigen/src/Core/BandMatrix.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Eigen/src/Core/BandMatrix.h') diff --git a/Eigen/src/Core/BandMatrix.h b/Eigen/src/Core/BandMatrix.h index e7139d015..2570d7b55 100644 --- a/Eigen/src/Core/BandMatrix.h +++ b/Eigen/src/Core/BandMatrix.h @@ -87,7 +87,7 @@ class BandMatrixBase : public EigenBase if (i<=supers()) { start = supers()-i; - len = std::min(rows(),std::max(0,coeffs().rows() - (supers()-i))); + len = (std::min)(rows(),std::max(0,coeffs().rows() - (supers()-i))); } else if (i>=rows()-subs()) len = std::max(0,coeffs().rows() - (i + 1 - rows() + subs())); @@ -96,11 +96,11 @@ class BandMatrixBase : public EigenBase /** \returns a vector expression of the main diagonal */ inline Block diagonal() - { return Block(coeffs(),supers(),0,1,std::min(rows(),cols())); } + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } /** \returns a vector expression of the main diagonal (const version) */ inline const Block diagonal() const - { return Block(coeffs(),supers(),0,1,std::min(rows(),cols())); } + { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } template struct DiagonalIntReturnType { enum { @@ -122,13 +122,13 @@ class BandMatrixBase : public EigenBase /** \returns a vector expression of the \a N -th sub or super diagonal */ template inline typename DiagonalIntReturnType::Type diagonal() { - return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, std::max(0,N), 1, diagonalLength(N)); + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); } /** \returns a vector expression of the \a N -th sub or super diagonal */ template inline const typename DiagonalIntReturnType::Type diagonal() const { - return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, std::max(0,N), 1, diagonalLength(N)); + return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); } /** \returns a vector expression of the \a i -th sub or super diagonal */ @@ -166,7 +166,7 @@ class BandMatrixBase : public EigenBase protected: inline Index diagonalLength(Index i) const - { return i<0 ? std::min(cols(),rows()+i) : std::min(rows(),cols()-i); } + { return i<0 ? (std::min)(cols(),rows()+i) : (std::min)(rows(),cols()-i); } }; /** -- cgit v1.2.3