mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 03:39:01 +08:00
RandomSetter: turns the matrix into compressed form before the filling
This commit is contained in:
parent
c0e36516f3
commit
950eeab4d7
@ -227,6 +227,7 @@ class RandomSetter
|
|||||||
if (!SwapStorage) // also means the map is sorted
|
if (!SwapStorage) // also means the map is sorted
|
||||||
{
|
{
|
||||||
mp_target->setZero();
|
mp_target->setZero();
|
||||||
|
mp_target->makeCompressed();
|
||||||
mp_target->reserve(nonZeros());
|
mp_target->reserve(nonZeros());
|
||||||
Index prevOuter = -1;
|
Index prevOuter = -1;
|
||||||
for (Index k=0; k<m_outerPackets; ++k)
|
for (Index k=0; k<m_outerPackets; ++k)
|
||||||
@ -271,6 +272,7 @@ class RandomSetter
|
|||||||
positions[j] = count;
|
positions[j] = count;
|
||||||
count += tmp;
|
count += tmp;
|
||||||
}
|
}
|
||||||
|
mp_target->makeCompressed();
|
||||||
mp_target->_outerIndexPtr()[mp_target->outerSize()] = count;
|
mp_target->_outerIndexPtr()[mp_target->outerSize()] = count;
|
||||||
mp_target->resizeNonZeros(count);
|
mp_target->resizeNonZeros(count);
|
||||||
// pass 2
|
// pass 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user