Simplify the use of custom scalar types, the rule is to never directly call a standard math function using std:: but rather put a using std::foo before and simply call foo:

using std::max;
max(a,b);
This commit is contained in:
Gael Guennebaud
2011-05-25 08:41:45 +02:00
parent 5541bcb769
commit 87ac09daa8
10 changed files with 73 additions and 40 deletions

View File

@@ -563,7 +563,8 @@ void EigenSolver<MatrixType>::doComputeEigenvectors()
}
// Overflow control
Scalar t = std::max(internal::abs(m_matT.coeff(i,n-1)),internal::abs(m_matT.coeff(i,n)));
using std::max;
Scalar t = max(internal::abs(m_matT.coeff(i,n-1)),internal::abs(m_matT.coeff(i,n)));
if ((eps * t) * t > Scalar(1))
m_matT.block(i, n-1, size-i, 2) /= t;