This PR shows how to replace sofa::type::Mat with Eigen::Matrix. The goal was to minimize the amount of code change in the code base.
Several difficulties arise:
sofa::type::Mat initializes the values, but Eigen::Matrix don't
sofa::type::Mat relies on the [] operators from fixed_array. I tried to add the [] operators in Eigen::Matrix, but too much cases makes it difficult. Maybe not impossible.
sofa::type::Vec must also be a Eigen::Vector, but Eigen::Vector is a Eigen::Matrix, so all the methods we add in Eigen::Matrix are also available in Eigen::Vector, but sometimes it does not make sense. So conditions must be added on the availability of those methods.
Because of those difficulties, the replacement is not simple. This PR is not finished. It just show how (at least the first step).
This PR shows how to replace sofa::type::Mat with Eigen::Matrix. The goal was to minimize the amount of code change in the code base.
Several difficulties arise:
sofa::type::Mat
initializes the values, butEigen::Matrix
don'tsofa::type::Mat
relies on the [] operators fromfixed_array
. I tried to add the [] operators inEigen::Matrix
, but too much cases makes it difficult. Maybe not impossible.sofa::type::Vec
must also be aEigen::Vector
, butEigen::Vector
is aEigen::Matrix
, so all the methods we add inEigen::Matrix
are also available inEigen::Vector
, but sometimes it does not make sense. So conditions must be added on the availability of those methods.Because of those difficulties, the replacement is not simple. This PR is not finished. It just show how (at least the first step).
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