mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fix memory pre-allocation when permuting inner vectors of a sparse matrix.
This commit is contained in:
parent
722916e19d
commit
da584912b6
@ -61,7 +61,7 @@ struct permut_sparsematrix_product_retval
|
|||||||
for(Index j=0; j<m_matrix.outerSize(); ++j)
|
for(Index j=0; j<m_matrix.outerSize(); ++j)
|
||||||
{
|
{
|
||||||
Index jp = m_permutation.indices().coeff(j);
|
Index jp = m_permutation.indices().coeff(j);
|
||||||
sizes[((Side==OnTheLeft) ^ Transposed) ? jp : j] = m_matrix.innerVector(((Side==OnTheRight) ^ Transposed) ? jp : j).size();
|
sizes[((Side==OnTheLeft) ^ Transposed) ? jp : j] = m_matrix.innerVector(((Side==OnTheRight) ^ Transposed) ? jp : j).nonZeros();
|
||||||
}
|
}
|
||||||
tmp.reserve(sizes);
|
tmp.reserve(sizes);
|
||||||
for(Index j=0; j<m_matrix.outerSize(); ++j)
|
for(Index j=0; j<m_matrix.outerSize(); ++j)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user