Workaround VS2015 bug

This commit is contained in:
Gael Guennebaud 2016-07-13 18:46:01 +02:00
parent 20f7ef2f89
commit 461cd819c2

View File

@ -333,8 +333,9 @@ GeneralizedEigenSolver<MatrixType>::compute(const MatrixType& A, const MatrixTyp
// T = [a 0]
// [0 b]
RealScalar a = matT.coeff(i, i),
b = matT(i+1, i+1); // NOTE: using operator() instead of coeff() workarounds a MSVC bug.
RealScalar a = matT.diagonal().coeff(i),
b = matT.diagonal().coeff(i+1);
// ^^ NOTE: using diagonal()(i) instead of coeff(i,i) workarounds a MSVC bug.
Matrix<RealScalar,2,2> S2 = m_matS.template block<2,2>(i,i) * Matrix<Scalar,2,1>(b,a).asDiagonal();
Scalar p = Scalar(0.5) * (S2.coeff(0,0) - S2.coeff(1,1));