fix: issue 2481: LDLT produce wrong results with AutoDiffScalar
Reference issue
What does this implement/fix?
When the value of an AutoDiffScalar
is 0 (as in the minimal example), some updates in the derivative that should take place in a triangular_solve_vector<...>::run
are being skipped.
See for instance:
https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/products/TriangularSolverVector.h#L118
The error does not occur when the value of the AutoDiffScalar
is something different than 0.
Proposed fix:
- The check must take into account the value of the derivatives when checking
AutoDiffScalar
for zeroes
Additional information
Edited by Mario Rincon-Nigro