aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/QR
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/QR
parentd4bd8bddb5e9f968ffcbdfff5936934e3d706684 (diff)
protect calls to min and max with parentheses to make Eigen compatible with default windows.h
Diffstat (limited to 'Eigen/src/QR')
-rw-r--r--Eigen/src/QR/ColPivHouseholderQR.h4
-rw-r--r--Eigen/src/QR/FullPivHouseholderQR.h14
-rw-r--r--Eigen/src/QR/HouseholderQR.h16
3 files changed, 17 insertions, 17 deletions
diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h
index 0cdcaa1cb..f04c6038d 100644
--- a/Eigen/src/QR/ColPivHouseholderQR.h
+++ b/Eigen/src/QR/ColPivHouseholderQR.h
@@ -93,7 +93,7 @@ template<typename _MatrixType> class ColPivHouseholderQR
*/
ColPivHouseholderQR(Index rows, Index cols)
: m_qr(rows, cols),
- m_hCoeffs(std::min(rows,cols)),
+ m_hCoeffs((std::min)(rows,cols)),
m_colsPermutation(cols),
m_colsTranspositions(cols),
m_temp(cols),
@@ -103,7 +103,7 @@ template<typename _MatrixType> class ColPivHouseholderQR
ColPivHouseholderQR(const MatrixType& matrix)
: m_qr(matrix.rows(), matrix.cols()),
- m_hCoeffs(std::min(matrix.rows(),matrix.cols())),
+ m_hCoeffs((std::min)(matrix.rows(),matrix.cols())),
m_colsPermutation(matrix.cols()),
m_colsTranspositions(matrix.cols()),
m_temp(matrix.cols()),
diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h
index 7f1d98c54..dde3013be 100644
--- a/Eigen/src/QR/FullPivHouseholderQR.h
+++ b/Eigen/src/QR/FullPivHouseholderQR.h
@@ -93,21 +93,21 @@ template<typename _MatrixType> class FullPivHouseholderQR
*/
FullPivHouseholderQR(Index rows, Index cols)
: m_qr(rows, cols),
- m_hCoeffs(std::min(rows,cols)),
+ m_hCoeffs((std::min)(rows,cols)),
m_rows_transpositions(rows),
m_cols_transpositions(cols),
m_cols_permutation(cols),
- m_temp(std::min(rows,cols)),
+ m_temp((std::min)(rows,cols)),
m_isInitialized(false),
m_usePrescribedThreshold(false) {}
FullPivHouseholderQR(const MatrixType& matrix)
: m_qr(matrix.rows(), matrix.cols()),
- m_hCoeffs(std::min(matrix.rows(), matrix.cols())),
+ m_hCoeffs((std::min)(matrix.rows(), matrix.cols())),
m_rows_transpositions(matrix.rows()),
m_cols_transpositions(matrix.cols()),
m_cols_permutation(matrix.cols()),
- m_temp(std::min(matrix.rows(), matrix.cols())),
+ m_temp((std::min)(matrix.rows(), matrix.cols())),
m_isInitialized(false),
m_usePrescribedThreshold(false)
{
@@ -379,7 +379,7 @@ FullPivHouseholderQR<MatrixType>& FullPivHouseholderQR<MatrixType>::compute(cons
{
Index rows = matrix.rows();
Index cols = matrix.cols();
- Index size = std::min(rows,cols);
+ Index size = (std::min)(rows,cols);
m_qr = matrix;
m_hCoeffs.resize(size);
@@ -493,7 +493,7 @@ struct solve_retval<FullPivHouseholderQR<_MatrixType>, Rhs>
RealScalar biggest_in_upper_part_of_c = c.topRows( dec().rank() ).cwiseAbs().maxCoeff();
RealScalar biggest_in_lower_part_of_c = c.bottomRows(rows-dec().rank()).cwiseAbs().maxCoeff();
// FIXME brain dead
- const RealScalar m_precision = NumTraits<Scalar>::epsilon() * std::min(rows,cols);
+ const RealScalar m_precision = NumTraits<Scalar>::epsilon() * (std::min)(rows,cols);
// this internal:: prefix is needed by at least gcc 3.4 and ICC
if(!internal::isMuchSmallerThan(biggest_in_lower_part_of_c, biggest_in_upper_part_of_c, m_precision))
return;
@@ -520,7 +520,7 @@ typename FullPivHouseholderQR<MatrixType>::MatrixQType FullPivHouseholderQR<Matr
// and v_k is the k-th Householder vector [1,m_qr(k+1,k), m_qr(k+2,k), ...]
Index rows = m_qr.rows();
Index cols = m_qr.cols();
- Index size = std::min(rows,cols);
+ Index size = (std::min)(rows,cols);
MatrixQType res = MatrixQType::Identity(rows, rows);
Matrix<Scalar,1,MatrixType::RowsAtCompileTime> temp(rows);
for (Index k = size-1; k >= 0; k--)
diff --git a/Eigen/src/QR/HouseholderQR.h b/Eigen/src/QR/HouseholderQR.h
index 0d2b74893..c8a4b17e7 100644
--- a/Eigen/src/QR/HouseholderQR.h
+++ b/Eigen/src/QR/HouseholderQR.h
@@ -88,13 +88,13 @@ template<typename _MatrixType> class HouseholderQR
*/
HouseholderQR(Index rows, Index cols)
: m_qr(rows, cols),
- m_hCoeffs(std::min(rows,cols)),
+ m_hCoeffs((std::min)(rows,cols)),
m_temp(cols),
m_isInitialized(false) {}
HouseholderQR(const MatrixType& matrix)
: m_qr(matrix.rows(), matrix.cols()),
- m_hCoeffs(std::min(matrix.rows(),matrix.cols())),
+ m_hCoeffs((std::min)(matrix.rows(),matrix.cols())),
m_temp(matrix.cols()),
m_isInitialized(false)
{
@@ -210,7 +210,7 @@ void householder_qr_inplace_unblocked(MatrixQR& mat, HCoeffs& hCoeffs, typename
typedef typename MatrixQR::RealScalar RealScalar;
Index rows = mat.rows();
Index cols = mat.cols();
- Index size = std::min(rows,cols);
+ Index size = (std::min)(rows,cols);
eigen_assert(hCoeffs.size() == size);
@@ -250,7 +250,7 @@ void householder_qr_inplace_blocked(MatrixQR& mat, HCoeffs& hCoeffs,
Index rows = mat.rows();
Index cols = mat.cols();
- Index size = std::min(rows, cols);
+ Index size = (std::min)(rows, cols);
typedef Matrix<Scalar,Dynamic,1,ColMajor,MatrixQR::MaxColsAtCompileTime,1> TempType;
TempType tempVector;
@@ -260,12 +260,12 @@ void householder_qr_inplace_blocked(MatrixQR& mat, HCoeffs& hCoeffs,
tempData = tempVector.data();
}
- Index blockSize = std::min(maxBlockSize,size);
+ Index blockSize = (std::min)(maxBlockSize,size);
int k = 0;
for (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 tcols = cols - k - bs; // trailing columns
Index brows = rows-k; // rows of the block
@@ -299,7 +299,7 @@ struct solve_retval<HouseholderQR<_MatrixType>, Rhs>
template<typename Dest> void evalTo(Dest& dst) const
{
const Index rows = dec().rows(), cols = dec().cols();
- const Index rank = std::min(rows, cols);
+ const Index rank = (std::min)(rows, cols);
eigen_assert(rhs().rows() == rows);
typename Rhs::PlainObject c(rhs());
@@ -327,7 +327,7 @@ HouseholderQR<MatrixType>& HouseholderQR<MatrixType>::compute(const MatrixType&
{
Index rows = matrix.rows();
Index cols = matrix.cols();
- Index size = std::min(rows,cols);
+ Index size = (std::min)(rows,cols);
m_qr = matrix;
m_hCoeffs.resize(size);