diff --git a/src/sparse/static_sparse_matrix.h b/src/sparse/static_sparse_matrix.h index 83a46872a..b3b3f71b5 100644 --- a/src/sparse/static_sparse_matrix.h +++ b/src/sparse/static_sparse_matrix.h @@ -197,7 +197,7 @@ class StaticSparseMatrix { Eigen::SparseMatrix toEigenSparseMatrix() { typedef Eigen::Triplet ETd; std::vector tripletList; - triplets.reserve(non_zero_entry_count + row_count); + tripletList.reserve(non_zero_entry_count + row_count); uint_fast32_t row_start; uint_fast32_t row_end; @@ -210,10 +210,10 @@ class StaticSparseMatrix { } } for (uint_fast32_t i = 1; i <= row_count; ++i) { - tripletList .push_back(ETd(i, i, diagonal_storage[i])); + tripletList.push_back(ETd(i, i, diagonal_storage[i])); } - SparseMatrixType mat(row_count, row_count); + Eigen::SparseMatrix mat(row_count, row_count); mat.setFromTriplets(tripletList.begin(), tripletList.end()); mat.makeCompressed();