diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-01-24 12:50:29 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-01-24 12:50:29 +0100 |
commit | deab937d4526c4542d13aa2654e8d898aab9a28b (patch) | |
tree | cba601bfc4d737a7e0bd28bd127870a70e743dcb /Eigen | |
parent | 66f1c56aabc4ec4789405d11f544806312d49cd6 (diff) |
NVCC: fix closed-form eigenvalue decomposition, workaround gcc4.7/nvcc5.5 issue
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/Diagonal.h | 7 | ||||
-rw-r--r-- | Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index 4436c6a69..b160479ab 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -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; } diff --git a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h index 0c3425069..b8146d04d 100644 --- a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +++ b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h @@ -756,7 +756,9 @@ struct direct_selfadjoint_eigenvalues<SolverType,2,false> EIGEN_DEVICE_FUNC static inline void run(SolverType& solver, const MatrixType& mat, int options) { - using std::sqrt; + EIGEN_USING_STD_MATH(max) + EIGEN_USING_STD_MATH(sqrt); + eigen_assert(mat.cols() == 2 && mat.cols() == mat.rows()); eigen_assert((options&~(EigVecMask|GenEigMask))==0 && (options&EigVecMask)!=EigVecMask @@ -768,7 +770,7 @@ struct direct_selfadjoint_eigenvalues<SolverType,2,false> // map the matrix coefficients to [-1:1] to avoid over- and underflow. Scalar scale = mat.cwiseAbs().maxCoeff(); - scale = (std::max)(scale,Scalar(1)); + scale = (max)(scale,Scalar(1)); MatrixType scaledMat = mat / scale; // Compute the eigenvalues |