mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #949: add static assertion for incompatible scalar types in dense end-user decompositions.
This commit is contained in:
@@ -32,6 +32,17 @@ ei_add_failtest("ref_3")
|
||||
ei_add_failtest("ref_4")
|
||||
ei_add_failtest("ref_5")
|
||||
|
||||
ei_add_failtest("partialpivlu_int")
|
||||
ei_add_failtest("fullpivlu_int")
|
||||
ei_add_failtest("llt_int")
|
||||
ei_add_failtest("ldlt_int")
|
||||
ei_add_failtest("qr_int")
|
||||
ei_add_failtest("colpivqr_int")
|
||||
ei_add_failtest("fullpivqr_int")
|
||||
ei_add_failtest("jacobisvd_int")
|
||||
ei_add_failtest("eigensolver_int")
|
||||
ei_add_failtest("eigensolver_cplx")
|
||||
|
||||
if (EIGEN_FAILTEST_FAILURE_COUNT)
|
||||
message(FATAL_ERROR
|
||||
"${EIGEN_FAILTEST_FAILURE_COUNT} out of ${EIGEN_FAILTEST_COUNT} failtests FAILED. "
|
||||
|
||||
14
failtest/colpivqr_int.cpp
Normal file
14
failtest/colpivqr_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/QR"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/eigensolver_cplx.cpp
Normal file
14
failtest/eigensolver_cplx.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/Eigenvalues"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR std::complex<double>
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
EigenSolver<Matrix<SCALAR,Dynamic,Dynamic> > eig(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/eigensolver_int.cpp
Normal file
14
failtest/eigensolver_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/Eigenvalues"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
EigenSolver<Matrix<SCALAR,Dynamic,Dynamic> > eig(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/fullpivlu_int.cpp
Normal file
14
failtest/fullpivlu_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/LU"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
FullPivLU<Matrix<SCALAR,Dynamic,Dynamic> > lu(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/fullpivqr_int.cpp
Normal file
14
failtest/fullpivqr_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/QR"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
FullPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/jacobisvd_int.cpp
Normal file
14
failtest/jacobisvd_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/SVD"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/ldlt_int.cpp
Normal file
14
failtest/ldlt_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/Cholesky"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
LDLT<Matrix<SCALAR,Dynamic,Dynamic> > ldlt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/llt_int.cpp
Normal file
14
failtest/llt_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/Cholesky"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
LLT<Matrix<SCALAR,Dynamic,Dynamic> > llt(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/partialpivlu_int.cpp
Normal file
14
failtest/partialpivlu_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/LU"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
PartialPivLU<Matrix<SCALAR,Dynamic,Dynamic> > lu(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
14
failtest/qr_int.cpp
Normal file
14
failtest/qr_int.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "../Eigen/QR"
|
||||
|
||||
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
|
||||
#define SCALAR int
|
||||
#else
|
||||
#define SCALAR float
|
||||
#endif
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
|
||||
}
|
||||
Reference in New Issue
Block a user