diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-11-06 15:05:37 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-11-06 15:05:37 +0100 |
commit | bfd6ee64f39340b42a1ee21e4b04ff15433e829d (patch) | |
tree | bdd1bedb1c032db86fb9d11a1952f6d0fcdea65f /test/sparse_basic.cpp | |
parent | 29038b982d4e8028b69211ef09e3fc3c7e6dfb69 (diff) |
bug #1105: fix default preallocation when moving from compressed to uncompressed mode
Diffstat (limited to 'test/sparse_basic.cpp')
-rw-r--r-- | test/sparse_basic.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 2d0f5819f..d803e7dae 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -513,4 +513,19 @@ void test_sparse_basic() // Regression test for bug 900: (manually insert higher values here, if you have enough RAM): CALL_SUBTEST_3((big_sparse_triplet<SparseMatrix<float, RowMajor, int> >(10000, 10000, 0.125))); CALL_SUBTEST_4((big_sparse_triplet<SparseMatrix<double, ColMajor, long int> >(10000, 10000, 0.125))); + + // Regression test for bug 1105 +#ifdef EIGEN_TEST_PART_6 + { + int n = Eigen::internal::random<int>(200,600); + SparseMatrix<std::complex<double>,0, long> mat(n, n); + std::complex<double> val; + + for(int i=0; i<n; ++i) + { + mat.coeffRef(i, i%(n/10)) = val; + VERIFY(mat.data().allocatedSize()<20*n); + } + } +#endif } |