Workaround weird MSVC bug

(grafted from 4b2cebade8
)
This commit is contained in:
Gael Guennebaud
2018-11-21 15:53:37 +01:00
parent 40ddac243e
commit a2d6c106a4
2 changed files with 18 additions and 1 deletions

View File

@@ -180,8 +180,10 @@ public:
RealScalar threshold() const
{
eigen_assert(m_isInitialized || m_usePrescribedThreshold);
// this temporary is needed to workaround a MSVC issue
Index diagSize = (std::max<Index>)(1,m_diagSize);
return m_usePrescribedThreshold ? m_prescribedThreshold
: (std::max<Index>)(1,m_diagSize)*NumTraits<Scalar>::epsilon();
: diagSize*NumTraits<Scalar>::epsilon();
}
/** \returns true if \a U (full or thin) is asked for in this SVD decomposition */