clean a bit previous patch (ctor vs static_cast and a few bits)

(transplanted from da644fb0c3e0b7fcda03ba27a02061c084809b9f)
This commit is contained in:
Gael Guennebaud
2011-05-23 13:34:04 +02:00
parent b3c3627c72
commit ee46ae9ba7
7 changed files with 24 additions and 21 deletions

View File

@@ -450,7 +450,7 @@ void EigenSolver<MatrixType>::doComputeEigenvectors()
Scalar q = m_eivalues.coeff(n).imag();
// Scalar vector
if (q == static_cast<Scalar>(0))
if (q == Scalar(0))
{
Scalar lastr=0, lastw=0;
Index l = n;
@@ -530,7 +530,7 @@ void EigenSolver<MatrixType>::doComputeEigenvectors()
else
{
l = i;
if (m_eivalues.coeff(i).imag() == static_cast<Scalar>(0))
if (m_eivalues.coeff(i).imag() == RealScalar(0))
{
std::complex<Scalar> cc = cdiv(-ra,-sa,w,q);
m_matT.coeffRef(i,n-1) = internal::real(cc);
@@ -564,7 +564,7 @@ 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)));
if ((eps * t) * t > static_cast<Scalar>(1))
if ((eps * t) * t > Scalar(1))
m_matT.block(i, n-1, size-i, 2) /= t;
}

View File

@@ -324,11 +324,11 @@ inline void RealSchur<MatrixType>::splitOffTwoRows(Index iu, bool computeU, Scal
m_matT.coeffRef(iu,iu) += exshift;
m_matT.coeffRef(iu-1,iu-1) += exshift;
if (q >= static_cast<Scalar>(0)) // Two real eigenvalues
if (q >= Scalar(0)) // Two real eigenvalues
{
Scalar z = internal::sqrt(internal::abs(q));
JacobiRotation<Scalar> rot;
if (p >= static_cast<Scalar>(0))
if (p >= Scalar(0))
rot.makeGivens(p + z, m_matT.coeff(iu, iu-1));
else
rot.makeGivens(p - z, m_matT.coeff(iu, iu-1));
@@ -369,7 +369,7 @@ inline void RealSchur<MatrixType>::computeShift(Index iu, Index iter, Scalar& ex
{
Scalar s = (shiftInfo.coeff(1) - shiftInfo.coeff(0)) / Scalar(2.0);
s = s * s + shiftInfo.coeff(2);
if (s > static_cast<Scalar>(0))
if (s > Scalar(0))
{
s = internal::sqrt(s);
if (shiftInfo.coeff(1) < shiftInfo.coeff(0))