diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-12-03 17:35:21 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-12-03 17:35:21 +0100 |
commit | 950eeab4d764c15605c13fd0277084019f863b6f (patch) | |
tree | c2fa1e16bed6785750ff4d2adc701613233ec1fa /unsupported/Eigen/src/SparseExtra | |
parent | c0e36516f3b81da46c1d5afb7afbb23614074809 (diff) |
RandomSetter: turns the matrix into compressed form before the filling
Diffstat (limited to 'unsupported/Eigen/src/SparseExtra')
-rw-r--r-- | unsupported/Eigen/src/SparseExtra/RandomSetter.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unsupported/Eigen/src/SparseExtra/RandomSetter.h b/unsupported/Eigen/src/SparseExtra/RandomSetter.h index 4ea41af85..e1cbae086 100644 --- a/unsupported/Eigen/src/SparseExtra/RandomSetter.h +++ b/unsupported/Eigen/src/SparseExtra/RandomSetter.h @@ -227,6 +227,7 @@ class RandomSetter if (!SwapStorage) // also means the map is sorted { mp_target->setZero(); + mp_target->makeCompressed(); mp_target->reserve(nonZeros()); Index prevOuter = -1; for (Index k=0; k<m_outerPackets; ++k) @@ -271,6 +272,7 @@ class RandomSetter positions[j] = count; count += tmp; } + mp_target->makeCompressed(); mp_target->_outerIndexPtr()[mp_target->outerSize()] = count; mp_target->resizeNonZeros(count); // pass 2 |