NVCC: fix closed-form eigenvalue decomposition, workaround gcc4.7/nvcc5.5 issue

This commit is contained in:
Gael Guennebaud
2014-01-24 12:50:29 +01:00
parent 66f1c56aab
commit deab937d45
3 changed files with 36 additions and 8 deletions

View File

@@ -77,7 +77,12 @@ template<typename MatrixType, int _DiagIndex> class Diagonal
EIGEN_DEVICE_FUNC
inline Index rows() const
{ return m_index.value()<0 ? (std::min<Index>)(m_matrix.cols(),m_matrix.rows()+m_index.value()) : (std::min<Index>)(m_matrix.rows(),m_matrix.cols()-m_index.value()); }
{
EIGEN_USING_STD_MATH(min);
return m_index.value()<0 ? (min)(Index(m_matrix.cols()),Index(m_matrix.rows()+m_index.value()))
: (min)(Index(m_matrix.rows()),Index(m_matrix.cols()-m_index.value()));
}
EIGEN_DEVICE_FUNC
inline Index cols() const { return 1; }