aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/LU
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-07-21 11:19:36 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-07-21 11:19:36 +0200
commit22bff949c898e7c340a415d771145c0bd22317d6 (patch)
treebe0fc956a220db15d4d7622fc580777f563ea643 /Eigen/src/LU
parentd4bd8bddb5e9f968ffcbdfff5936934e3d706684 (diff)
protect calls to min and max with parentheses to make Eigen compatible with default windows.h
Diffstat (limited to 'Eigen/src/LU')
-rw-r--r--Eigen/src/LU/FullPivLU.h4
-rw-r--r--Eigen/src/LU/PartialPivLU.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/Eigen/src/LU/FullPivLU.h b/Eigen/src/LU/FullPivLU.h
index 339d7845c..633fb23fd 100644
--- a/Eigen/src/LU/FullPivLU.h
+++ b/Eigen/src/LU/FullPivLU.h
@@ -533,7 +533,7 @@ template<typename MatrixType>
MatrixType FullPivLU<MatrixType>::reconstructedMatrix() const
{
eigen_assert(m_isInitialized && "LU is not initialized.");
- const Index smalldim = std::min(m_lu.rows(), m_lu.cols());
+ const Index smalldim = (std::min)(m_lu.rows(), m_lu.cols());
// LU
MatrixType res(m_lu.rows(),m_lu.cols());
// FIXME the .toDenseMatrix() should not be needed...
@@ -695,7 +695,7 @@ struct solve_retval<FullPivLU<_MatrixType>, Rhs>
const Index rows = dec().rows(), cols = dec().cols(),
nonzero_pivots = dec().nonzeroPivots();
eigen_assert(rhs().rows() == rows);
- const Index smalldim = std::min(rows, cols);
+ const Index smalldim = (std::min)(rows, cols);
if(nonzero_pivots == 0)
{
diff --git a/Eigen/src/LU/PartialPivLU.h b/Eigen/src/LU/PartialPivLU.h
index 4cae510b0..09394b01f 100644
--- a/Eigen/src/LU/PartialPivLU.h
+++ b/Eigen/src/LU/PartialPivLU.h
@@ -253,7 +253,7 @@ struct partial_lu_impl
{
const Index rows = lu.rows();
const Index cols = lu.cols();
- const Index size = std::min(rows,cols);
+ const Index size = (std::min)(rows,cols);
nb_transpositions = 0;
int first_zero_pivot = -1;
for(Index k = 0; k < size; ++k)
@@ -313,7 +313,7 @@ struct partial_lu_impl
MapLU lu1(lu_data,StorageOrder==RowMajor?rows:luStride,StorageOrder==RowMajor?luStride:cols);
MatrixType lu(lu1,0,0,rows,cols);
- const Index size = std::min(rows,cols);
+ const Index size = (std::min)(rows,cols);
// if the matrix is too small, no blocking:
if(size<=16)
@@ -327,14 +327,14 @@ struct partial_lu_impl
{
blockSize = size/8;
blockSize = (blockSize/16)*16;
- blockSize = std::min(std::max(blockSize,Index(8)), maxBlockSize);
+ blockSize = (std::min)((std::max)(blockSize,Index(8)), maxBlockSize);
}
nb_transpositions = 0;
int first_zero_pivot = -1;
for(Index k = 0; k < size; k+=blockSize)
{
- Index bs = std::min(size-k,blockSize); // actual size of the block
+ Index bs = (std::min)(size-k,blockSize); // actual size of the block
Index trows = rows - k - bs; // trailing rows
Index tsize = size - k - bs; // trailing size