sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[LinearAlgebra] Remove unused operations on BaseMatrix

Open alxbilger opened this issue 3 years ago • 12 comments

All the op* method in BaseMatrix seem either unused, or overloaded (by RotationMatrix). And they are called only knowing that RotationMatrix is used. It makes me think that this code is not used.

This PR removes all the code in the cpp file, but it should be restored before merge for a proper deprecation mechanism. Let's first check that the CI does not fail without this code.


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

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

alxbilger avatar Sep 22 '22 14:09 alxbilger

Thanks @alxbilger for the PR.

In general I consider that removing complex and rarely used code is a direction we should go. For these function as I'm not using them I suggest to wait other's reaction/opinion on the chance and possible consequences.

Just a small question, about the use of empty function in the deprecation process. This looks like an intermediate step between the deprecated (but still working) and the disable state we currently have. I'm not at ease with the fact of have function that "do nothing"... and wonder there is some room in our workflow for std::deprecated_exception("") to be used for theses cases.

damienmarchal avatar Sep 23 '22 22:09 damienmarchal

your feedback would be good @bakpaul @courtecuisse @ziqiu-zeng

hugtalbot avatar Sep 24 '22 16:09 hugtalbot

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

alxbilger avatar Sep 26 '22 08:09 alxbilger

up @bakpaul @courtecuisse @ziqiu-zeng

hugtalbot avatar Sep 28 '22 10:09 hugtalbot

Hi,

I just read this comment. I'm not 100% sure but I think that these operations are specified for cuda. I don't really know what will be the consequences for the cuda plugins if this pr is merged, but I guess it will break the parallel implementation.

Hadrien;

courtecuisse avatar Sep 28 '22 12:09 courtecuisse

Hi all,

How could we clarify the status regarding the compatiblity with cuda ? Do we implement some transitional/compatibility layer (as we are now used to) ?

damienmarchal avatar Oct 03 '22 08:10 damienmarchal

I've tested to remove completely the functions. If used or overridden, it should fail to compile. On my setup, I don't observe a compilation failure, even with SofaCuda. Let's see if the CI does not complain.

alxbilger avatar Oct 04 '22 14:10 alxbilger

We think that we need more people to give their opinion: @JeremieA @ChristianDuriez @fjourdes Thanks !

fredroy avatar Oct 05 '22 09:10 fredroy

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

alxbilger avatar Oct 12 '22 12:10 alxbilger

up @JeremieA @ChristianDuriez @fjourdes @bakpaul @courtecuisse @ziqiu-zeng Last call before boarding next Wed.

hugtalbot avatar Oct 13 '22 21:10 hugtalbot

This op* mechanism may be "complex" but it was a reasonable attempt at implementing common matrix/vector operations generically while maintaining some efficiency (inspecting the sparsity and block size of the matrix being operated on instead of blindly doing a O(n^3) loop over all possible element combinaisons). It is useful (we do use it in a couple of places in our solver codes), even if not critical (it is more efficient to call directly the right methods with the specific types of matrix and vectors that are being used).

JeremieA avatar Oct 14 '22 16:10 JeremieA

@JeremieA Thanks for the details.

alxbilger avatar Oct 14 '22 16:10 alxbilger

Postponed

alxbilger avatar Oct 19 '22 09:10 alxbilger