mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix serialization for non-compressed matrices.
This commit is contained in:
@@ -30,7 +30,7 @@ struct RandomImpl<Eigen::SparseMatrix<Scalar, Options, DenseIndex>> {
|
||||
double density = 0.1;
|
||||
|
||||
// Reserve some space along each inner dim.
|
||||
int nnz = static_cast<int>(density * 1.5 * M.innerSize());
|
||||
int nnz = static_cast<int>(std::ceil(density * 1.5 * M.innerSize()));
|
||||
M.reserve(Eigen::VectorXi::Constant(M.outerSize(), nnz));
|
||||
|
||||
for (int j = 0; j < M.outerSize(); j++) {
|
||||
|
||||
Reference in New Issue
Block a user