sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
871 stars 297 forks source link

[LinearAlgebra] Refactor sparse matrix product #4547

Closed alxbilger closed 2 months ago

alxbilger commented 2 months ago
  1. All types of Eigen::SparseMatrix are now supported. For that, the implementation relies completely on the Eigen matrix product to compute the intersection. The trick is to flag the non-zero values with its index position in the array. The matrix product will implicitly keep track of all the operations thanks to the newly introduced scalar types.
  2. Because of the new method, SparseMatrixStorageOrder is no longer useful. It can be removed later
  3. Unit tests are extensive. They test all possible configuration of storage of LHS, RHS and Result. They are required because a condition on the storage type is required to swap the indices after the matrix product.
  4. A parallel version of the algorithm is introduced
  5. Benchmarks: https://github.com/alxbilger/SofaBenchmark/pull/39

Analysis of the results of the benchmarks:


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

alxbilger commented 2 months ago

[ci-build][with-all-tests]

alxbilger commented 2 months ago

Formatted spreadsheet of the benchmark result sparsematrixproductBenchmark.ods