summaryrefslogtreecommitdiffhomepage
path: root/eigen/failtest
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-25 14:17:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-25 14:17:07 +0100
commit35f7829af10c61e33dd2e2a7a015058e11a11ea0 (patch)
tree7135010dcf8fd0a49f3020d52112709bcb883bd6 /eigen/failtest
parent6e8724193e40a932faf9064b664b529e7301c578 (diff)
update
Diffstat (limited to 'eigen/failtest')
-rw-r--r--eigen/failtest/CMakeLists.txt21
-rw-r--r--eigen/failtest/bdcsvd_int.cpp14
-rw-r--r--eigen/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp15
-rw-r--r--eigen/failtest/cwiseunaryview_on_const_type_actually_const.cpp16
-rw-r--r--eigen/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp15
-rw-r--r--eigen/failtest/selfadjointview_on_const_type_actually_const.cpp16
-rw-r--r--eigen/failtest/sparse_ref_1.cpp18
-rw-r--r--eigen/failtest/sparse_ref_2.cpp15
-rw-r--r--eigen/failtest/sparse_ref_3.cpp15
-rw-r--r--eigen/failtest/sparse_ref_4.cpp15
-rw-r--r--eigen/failtest/sparse_ref_5.cpp16
-rw-r--r--eigen/failtest/sparse_storage_mismatch.cpp16
-rw-r--r--eigen/failtest/swap_1.cpp14
-rw-r--r--eigen/failtest/swap_2.cpp14
-rw-r--r--eigen/failtest/ternary_1.cpp13
-rw-r--r--eigen/failtest/ternary_2.cpp13
-rw-r--r--eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp15
-rw-r--r--eigen/failtest/triangularview_on_const_type_actually_const.cpp16
18 files changed, 277 insertions, 0 deletions
diff --git a/eigen/failtest/CMakeLists.txt b/eigen/failtest/CMakeLists.txt
index cadc6a2..1a73f05 100644
--- a/eigen/failtest/CMakeLists.txt
+++ b/eigen/failtest/CMakeLists.txt
@@ -7,6 +7,9 @@ ei_add_failtest("block_nonconst_ctor_on_const_xpr_1")
ei_add_failtest("block_nonconst_ctor_on_const_xpr_2")
ei_add_failtest("transpose_nonconst_ctor_on_const_xpr")
ei_add_failtest("diagonal_nonconst_ctor_on_const_xpr")
+ei_add_failtest("cwiseunaryview_nonconst_ctor_on_const_xpr")
+ei_add_failtest("triangularview_nonconst_ctor_on_const_xpr")
+ei_add_failtest("selfadjointview_nonconst_ctor_on_const_xpr")
ei_add_failtest("const_qualified_block_method_retval_0")
ei_add_failtest("const_qualified_block_method_retval_1")
@@ -25,6 +28,9 @@ ei_add_failtest("block_on_const_type_actually_const_0")
ei_add_failtest("block_on_const_type_actually_const_1")
ei_add_failtest("transpose_on_const_type_actually_const")
ei_add_failtest("diagonal_on_const_type_actually_const")
+ei_add_failtest("cwiseunaryview_on_const_type_actually_const")
+ei_add_failtest("triangularview_on_const_type_actually_const")
+ei_add_failtest("selfadjointview_on_const_type_actually_const")
ei_add_failtest("ref_1")
ei_add_failtest("ref_2")
@@ -32,6 +38,20 @@ ei_add_failtest("ref_3")
ei_add_failtest("ref_4")
ei_add_failtest("ref_5")
+ei_add_failtest("swap_1")
+ei_add_failtest("swap_2")
+
+ei_add_failtest("ternary_1")
+ei_add_failtest("ternary_2")
+
+ei_add_failtest("sparse_ref_1")
+ei_add_failtest("sparse_ref_2")
+ei_add_failtest("sparse_ref_3")
+ei_add_failtest("sparse_ref_4")
+ei_add_failtest("sparse_ref_5")
+
+ei_add_failtest("sparse_storage_mismatch")
+
ei_add_failtest("partialpivlu_int")
ei_add_failtest("fullpivlu_int")
ei_add_failtest("llt_int")
@@ -40,6 +60,7 @@ ei_add_failtest("qr_int")
ei_add_failtest("colpivqr_int")
ei_add_failtest("fullpivqr_int")
ei_add_failtest("jacobisvd_int")
+ei_add_failtest("bdcsvd_int")
ei_add_failtest("eigensolver_int")
ei_add_failtest("eigensolver_cplx")
diff --git a/eigen/failtest/bdcsvd_int.cpp b/eigen/failtest/bdcsvd_int.cpp
new file mode 100644
index 0000000..670752c
--- /dev/null
+++ b/eigen/failtest/bdcsvd_int.cpp
@@ -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()
+{
+ BDCSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
+}
diff --git a/eigen/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp b/eigen/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp
new file mode 100644
index 0000000..e23cf8f
--- /dev/null
+++ b/eigen/failtest/cwiseunaryview_nonconst_ctor_on_const_xpr.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ CwiseUnaryView<internal::scalar_real_ref_op<double>,Matrix3d> t(m);
+}
+
+int main() {}
diff --git a/eigen/failtest/cwiseunaryview_on_const_type_actually_const.cpp b/eigen/failtest/cwiseunaryview_on_const_type_actually_const.cpp
new file mode 100644
index 0000000..fcd41df
--- /dev/null
+++ b/eigen/failtest/cwiseunaryview_on_const_type_actually_const.cpp
@@ -0,0 +1,16 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(){
+ MatrixXf m;
+ CwiseUnaryView<internal::scalar_real_ref_op<double>,CV_QUALIFIER MatrixXf>(m).coeffRef(0, 0) = 1.0f;
+}
+
+int main() {}
diff --git a/eigen/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp b/eigen/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp
new file mode 100644
index 0000000..a240f81
--- /dev/null
+++ b/eigen/failtest/selfadjointview_nonconst_ctor_on_const_xpr.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ SelfAdjointView<Matrix3d,Upper> t(m);
+}
+
+int main() {}
diff --git a/eigen/failtest/selfadjointview_on_const_type_actually_const.cpp b/eigen/failtest/selfadjointview_on_const_type_actually_const.cpp
new file mode 100644
index 0000000..19aaad6
--- /dev/null
+++ b/eigen/failtest/selfadjointview_on_const_type_actually_const.cpp
@@ -0,0 +1,16 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(){
+ MatrixXf m;
+ SelfAdjointView<CV_QUALIFIER MatrixXf,Upper>(m).coeffRef(0, 0) = 1.0f;
+}
+
+int main() {}
diff --git a/eigen/failtest/sparse_ref_1.cpp b/eigen/failtest/sparse_ref_1.cpp
new file mode 100644
index 0000000..d78d1f9
--- /dev/null
+++ b/eigen/failtest/sparse_ref_1.cpp
@@ -0,0 +1,18 @@
+#include "../Eigen/Sparse"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void call_ref(Ref<SparseMatrix<float> > a) { }
+
+int main()
+{
+ SparseMatrix<float> a(10,10);
+ CV_QUALIFIER SparseMatrix<float>& ac(a);
+ call_ref(ac);
+}
diff --git a/eigen/failtest/sparse_ref_2.cpp b/eigen/failtest/sparse_ref_2.cpp
new file mode 100644
index 0000000..46c9440
--- /dev/null
+++ b/eigen/failtest/sparse_ref_2.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Sparse"
+
+using namespace Eigen;
+
+void call_ref(Ref<SparseMatrix<float> > a) { }
+
+int main()
+{
+ SparseMatrix<float> A(10,10);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ call_ref(A.row(3));
+#else
+ call_ref(A.col(3));
+#endif
+}
diff --git a/eigen/failtest/sparse_ref_3.cpp b/eigen/failtest/sparse_ref_3.cpp
new file mode 100644
index 0000000..a9949b5
--- /dev/null
+++ b/eigen/failtest/sparse_ref_3.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Sparse"
+
+using namespace Eigen;
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+void call_ref(Ref<SparseMatrix<float> > a) { }
+#else
+void call_ref(const Ref<const SparseMatrix<float> > &a) { }
+#endif
+
+int main()
+{
+ SparseMatrix<float> a(10,10);
+ call_ref(a+a);
+}
diff --git a/eigen/failtest/sparse_ref_4.cpp b/eigen/failtest/sparse_ref_4.cpp
new file mode 100644
index 0000000..57bb6a1
--- /dev/null
+++ b/eigen/failtest/sparse_ref_4.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Sparse"
+
+using namespace Eigen;
+
+void call_ref(Ref<SparseMatrix<float> > a) {}
+
+int main()
+{
+ SparseMatrix<float> A(10,10);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ call_ref(A.transpose());
+#else
+ call_ref(A);
+#endif
+}
diff --git a/eigen/failtest/sparse_ref_5.cpp b/eigen/failtest/sparse_ref_5.cpp
new file mode 100644
index 0000000..4478f6f
--- /dev/null
+++ b/eigen/failtest/sparse_ref_5.cpp
@@ -0,0 +1,16 @@
+#include "../Eigen/Sparse"
+
+using namespace Eigen;
+
+void call_ref(Ref<SparseMatrix<float> > a) { }
+
+int main()
+{
+ SparseMatrix<float> a(10,10);
+ SparseMatrixBase<SparseMatrix<float> > &ac(a);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ call_ref(ac);
+#else
+ call_ref(ac.derived());
+#endif
+}
diff --git a/eigen/failtest/sparse_storage_mismatch.cpp b/eigen/failtest/sparse_storage_mismatch.cpp
new file mode 100644
index 0000000..51840d4
--- /dev/null
+++ b/eigen/failtest/sparse_storage_mismatch.cpp
@@ -0,0 +1,16 @@
+#include "../Eigen/Sparse"
+using namespace Eigen;
+
+typedef SparseMatrix<double,ColMajor> Mat1;
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+typedef SparseMatrix<double,RowMajor> Mat2;
+#else
+typedef SparseMatrix<double,ColMajor> Mat2;
+#endif
+
+int main()
+{
+ Mat1 a(10,10);
+ Mat2 b(10,10);
+ a += b;
+}
diff --git a/eigen/failtest/swap_1.cpp b/eigen/failtest/swap_1.cpp
new file mode 100644
index 0000000..1063797
--- /dev/null
+++ b/eigen/failtest/swap_1.cpp
@@ -0,0 +1,14 @@
+#include "../Eigen/Core"
+
+using namespace Eigen;
+
+int main()
+{
+ VectorXf a(10), b(10);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ const DenseBase<VectorXf> &ac(a);
+#else
+ DenseBase<VectorXf> &ac(a);
+#endif
+ b.swap(ac);
+}
diff --git a/eigen/failtest/swap_2.cpp b/eigen/failtest/swap_2.cpp
new file mode 100644
index 0000000..c130ba6
--- /dev/null
+++ b/eigen/failtest/swap_2.cpp
@@ -0,0 +1,14 @@
+#include "../Eigen/Core"
+
+using namespace Eigen;
+
+int main()
+{
+ VectorXf a(10), b(10);
+ VectorXf const &ac(a);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ b.swap(ac);
+#else
+ b.swap(ac.const_cast_derived());
+#endif
+} \ No newline at end of file
diff --git a/eigen/failtest/ternary_1.cpp b/eigen/failtest/ternary_1.cpp
new file mode 100644
index 0000000..b40bcb0
--- /dev/null
+++ b/eigen/failtest/ternary_1.cpp
@@ -0,0 +1,13 @@
+#include "../Eigen/Core"
+
+using namespace Eigen;
+
+int main(int argc,char **)
+{
+ VectorXf a(10), b(10);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ b = argc>1 ? 2*a : -a;
+#else
+ b = argc>1 ? 2*a : VectorXf(-a);
+#endif
+}
diff --git a/eigen/failtest/ternary_2.cpp b/eigen/failtest/ternary_2.cpp
new file mode 100644
index 0000000..a46b12b
--- /dev/null
+++ b/eigen/failtest/ternary_2.cpp
@@ -0,0 +1,13 @@
+#include "../Eigen/Core"
+
+using namespace Eigen;
+
+int main(int argc,char **)
+{
+ VectorXf a(10), b(10);
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+ b = argc>1 ? 2*a : a+a;
+#else
+ b = argc>1 ? VectorXf(2*a) : VectorXf(a+a);
+#endif
+}
diff --git a/eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp b/eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp
new file mode 100644
index 0000000..807447e
--- /dev/null
+++ b/eigen/failtest/triangularview_nonconst_ctor_on_const_xpr.cpp
@@ -0,0 +1,15 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(CV_QUALIFIER Matrix3d &m){
+ TriangularView<Matrix3d,Upper> t(m);
+}
+
+int main() {}
diff --git a/eigen/failtest/triangularview_on_const_type_actually_const.cpp b/eigen/failtest/triangularview_on_const_type_actually_const.cpp
new file mode 100644
index 0000000..0a381a6
--- /dev/null
+++ b/eigen/failtest/triangularview_on_const_type_actually_const.cpp
@@ -0,0 +1,16 @@
+#include "../Eigen/Core"
+
+#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
+#define CV_QUALIFIER const
+#else
+#define CV_QUALIFIER
+#endif
+
+using namespace Eigen;
+
+void foo(){
+ MatrixXf m;
+ TriangularView<CV_QUALIFIER MatrixXf,Upper>(m).coeffRef(0, 0) = 1.0f;
+}
+
+int main() {}