diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 272f1d7b4..91bada40f 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1221,7 +1221,7 @@ typename SparseMatrix<_Scalar,_Options,_Index>::Scalar& SparseMatrix<_Scalar,_Op { // make sure the matrix is compatible to random un-compressed insertion: m_data.resize(m_data.allocatedSize()); - this->reserveInnerVectors(Array::Constant(2*m_outerSize, convert_index(m_outerSize))); + this->reserveInnerVectors(Array::Constant(m_outerSize, 2)); } return insertUncompressed(row,col); 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 >(10000, 10000, 0.125))); CALL_SUBTEST_4((big_sparse_triplet >(10000, 10000, 0.125))); + + // Regression test for bug 1105 +#ifdef EIGEN_TEST_PART_6 + { + int n = Eigen::internal::random(200,600); + SparseMatrix,0, long> mat(n, n); + std::complex val; + + for(int i=0; i