| 725 | #ifndef EIGEN_SPARSE_TEST_INCLUDED_FROM_SPARSE_EXTRA |
| 726 | |
| 727 | EIGEN_DECLARE_TEST(sparse_basic) |
| 728 | { |
| 729 | g_dense_op_sparse_count = 0; // Suppresses compiler warning. |
| 730 | for(int i = 0; i < g_repeat; i++) { |
| 731 | int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200); |
| 732 | if(Eigen::internal::random<int>(0,4) == 0) { |
| 733 | r = c; // check square matrices in 25% of tries |
| 734 | } |
| 735 | EIGEN_UNUSED_VARIABLE(r+c); |
| 736 | CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(1, 1)) )); |
| 737 | CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(8, 8)) )); |
| 738 | CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, ColMajor>(r, c)) )); |
| 739 | CALL_SUBTEST_2(( sparse_basic(SparseMatrix<std::complex<double>, RowMajor>(r, c)) )); |
| 740 | CALL_SUBTEST_1(( sparse_basic(SparseMatrix<double>(r, c)) )); |
| 741 | CALL_SUBTEST_5(( sparse_basic(SparseMatrix<double,ColMajor,long int>(r, c)) )); |
| 742 | CALL_SUBTEST_5(( sparse_basic(SparseMatrix<double,RowMajor,long int>(r, c)) )); |
| 743 | |
| 744 | r = Eigen::internal::random<int>(1,100); |
| 745 | c = Eigen::internal::random<int>(1,100); |
| 746 | if(Eigen::internal::random<int>(0,4) == 0) { |
| 747 | r = c; // check square matrices in 25% of tries |
| 748 | } |
| 749 | |
| 750 | CALL_SUBTEST_6(( sparse_basic(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) )); |
| 751 | CALL_SUBTEST_6(( sparse_basic(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) )); |
| 752 | } |
| 753 | |
| 754 | // Regression test for bug 900: (manually insert higher values here, if you have enough RAM): |
| 755 | CALL_SUBTEST_3((big_sparse_triplet<SparseMatrix<float, RowMajor, int> >(10000, 10000, 0.125))); |
| 756 | CALL_SUBTEST_4((big_sparse_triplet<SparseMatrix<double, ColMajor, long int> >(10000, 10000, 0.125))); |
| 757 | |
| 758 | CALL_SUBTEST_7( bug1105<0>() ); |
| 759 | } |
| 760 | #endif |
nothing calls this directly
no test coverage detected