mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fix SparseMatrix::insert/coeffRef for non-empty compressed matrix
This commit is contained in:
parent
85afb61417
commit
ac6b2266b9
@ -1132,6 +1132,14 @@ typename SparseMatrix<_Scalar,_Options,_Index>::Scalar& SparseMatrix<_Scalar,_Op
|
|||||||
for(Index j=1; j<=m_outerSize; ++j)
|
for(Index j=1; j<=m_outerSize; ++j)
|
||||||
m_outerIndex[j] = end;
|
m_outerIndex[j] = end;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// turn the matrix into non-compressed mode
|
||||||
|
m_innerNonZeros = static_cast<StorageIndex*>(std::malloc(m_outerSize * sizeof(StorageIndex)));
|
||||||
|
if(!m_innerNonZeros) internal::throw_std_bad_alloc();
|
||||||
|
for(Index j=0; j<m_outerSize; ++j)
|
||||||
|
m_innerNonZeros[j] = m_outerIndex[j+1]-m_outerIndex[j];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check whether we can do a fast "push back" insertion
|
// check whether we can do a fast "push back" insertion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user