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 ;)
This commit is contained in:
Gael Guennebaud
2011-08-19 14:18:05 +02:00
parent 5734ee6df4
commit 42e2578ef9
29 changed files with 74 additions and 59 deletions

View File

@@ -64,7 +64,7 @@ template<typename MatrixType> void lu_non_invertible()
typedef Matrix<typename MatrixType::Scalar, RowsAtCompileTime, RowsAtCompileTime>
RMatrixType;
Index rank = internal::random<Index>(1, std::min(rows, cols)-1);
Index rank = internal::random<Index>(1, (std::min)(rows, cols)-1);
// The image of the zero matrix should consist of a single (zero) column vector
VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).cols() == 1));
@@ -84,8 +84,8 @@ template<typename MatrixType> void lu_non_invertible()
MatrixType u(rows,cols);
u = lu.matrixLU().template triangularView<Upper>();
RMatrixType l = RMatrixType::Identity(rows,rows);
l.block(0,0,rows,std::min(rows,cols)).template triangularView<StrictlyLower>()
= lu.matrixLU().block(0,0,rows,std::min(rows,cols));
l.block(0,0,rows,(std::min)(rows,cols)).template triangularView<StrictlyLower>()
= lu.matrixLU().block(0,0,rows,(std::min)(rows,cols));
VERIFY_IS_APPROX(lu.permutationP() * m1 * lu.permutationQ(), l*u);