Clean up EIGEN_STATIC_ASSERT to only use standard c++11 static_assert.

This commit is contained in:
Rasmus Munk Larsen
2021-09-16 20:43:54 +00:00
parent 7b975acb1f
commit 6cadab6896
48 changed files with 269 additions and 663 deletions

View File

@@ -238,12 +238,9 @@ template<typename MatrixType_> class ComplexEigenSolver
}
protected:
static void check_template_parameters()
{
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
}
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
EigenvectorType m_eivec;
EigenvalueType m_eivalues;
ComplexSchur<MatrixType> m_schur;
@@ -262,8 +259,6 @@ template<typename InputType>
ComplexEigenSolver<MatrixType>&
ComplexEigenSolver<MatrixType>::compute(const EigenBase<InputType>& matrix, bool computeEigenvectors)
{
check_template_parameters();
// this code is inspired from Jampack
eigen_assert(matrix.cols() == matrix.rows());

View File

@@ -269,13 +269,10 @@ template<typename MatrixType_> class GeneralizedEigenSolver
}
protected:
static void check_template_parameters()
{
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsComplex, NUMERIC_TYPE_MUST_BE_REAL);
}
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsComplex, NUMERIC_TYPE_MUST_BE_REAL)
EigenvectorsType m_eivec;
ComplexVectorType m_alphas;
VectorType m_betas;
@@ -288,8 +285,6 @@ template<typename MatrixType>
GeneralizedEigenSolver<MatrixType>&
GeneralizedEigenSolver<MatrixType>::compute(const MatrixType& A, const MatrixType& B, bool computeEigenvectors)
{
check_template_parameters();
using std::sqrt;
using std::abs;
eigen_assert(A.cols() == A.rows() && B.cols() == A.rows() && B.cols() == B.rows());

View File

@@ -374,12 +374,8 @@ template<typename MatrixType_> class SelfAdjointEigenSolver
static const int m_maxIterations = 30;
protected:
static EIGEN_DEVICE_FUNC
void check_template_parameters()
{
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar);
}
EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
EigenvectorsType m_eivec;
RealVectorType m_eivalues;
typename TridiagonalizationType::SubDiagonalType m_subdiag;
@@ -421,10 +417,8 @@ EIGEN_DEVICE_FUNC
SelfAdjointEigenSolver<MatrixType>& SelfAdjointEigenSolver<MatrixType>
::compute(const EigenBase<InputType>& a_matrix, int options)
{
check_template_parameters();
const InputType &matrix(a_matrix.derived());
EIGEN_USING_STD(abs);
eigen_assert(matrix.cols() == matrix.rows());
eigen_assert((options&~(EigVecMask|GenEigMask))==0