Skip to content

Commit 42eba2a

Browse files
committed
compress the matrix before giving it to python
1 parent b6dd289 commit 42eba2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bindings/Modules/src/SofaPython3/SofaLinearSystem/Binding_LinearSystem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ EigenSparseMatrix toEigen(sofa::linearalgebra::CompressedRowSparseMatrix<TBlock>
5151
template<>
5252
EigenSparseMatrix toEigen<SReal>(sofa::linearalgebra::CompressedRowSparseMatrix<SReal>& matrix)
5353
{
54+
matrix.compress();
5455
return EigenMatrixMap(matrix.rows(), matrix.cols(), matrix.getColsValue().size(),
5556
(EigenMatrixMap::StorageIndex*)matrix.rowBegin.data(), (EigenMatrixMap::StorageIndex*)matrix.colsIndex.data(), matrix.colsValue.data());
5657
}

0 commit comments

Comments
 (0)