CGAL/cgal

Issue with Eigen and Gmpfr/Gmpfi

Opened this issue · 1 comments

Recently, we saw that Number_types/test/Number_types/test_eigen.cpp is failing with an Uncertain_conversion_exception being thrown. We get the assertion when using Gmpfi to compute the determinant (dim 3 being OK, only the dynamic dim).

The problem first occurs with the following commit from Eigen:

commit d0b490ee091629068e0c11953419eb089f9e6bb2
Author: Charles Schlosser <cs.schlosser@gmail.com>
Date:   Fri Jun 6 14:55:49 2025 +0000

    Optimize maxCoeff and friends

Digging a bit, I printed the value of the determinant. It is -24 in all cases (up to rounding) but -3e3 (dim 3) and -43422033463993573283839119378257965444976244249615211514796594002967423614975e-250 (dynamic) with Gmpfr (and Gmpfi).

Back to my system' Eigen (3.4.0) the values of the derterminant with Gmpfr and Gmpfi are the same strange numbers.

No idea if Eigen::NumTraits specialization we have could be the issue...

The code & comment in Interval_nt.h about scalar_score_coeff_op may be relevant for the exception.
-3e3 may be a questionable pretty print for -24=-3*2³, same as -24=-43422033463993573283839119378257965444976244249615211514796594002967423614975/2^250.