The mpfr::mpreal type defines the std::numeric_limits<>::digits field to be a function as opposed to a constant. This is an unfortunate -- albeit necessary -- violation of the C++ standard.
The stable norm kernel, however, is incompatible with this. Specifically:
it = std::numeric_limits<RealScalar>::digits; // number of base-beta digits in mantissa
It also appears as if the kernel itself is not set-up to handle types whose precisions can change at runtime (due to the use of a static initialized marker).
Therefore it may be worth defining a specialization of stable norm specifically for mpfr::mpreal that takes into account the quirks associated with the type.
Since the issue is not yet solved, I've submitted a PullRequest that adresses this problem.
Basic idea: Add a member to `NumTraits` for `digits()`. There is already a `digits10()` member, that is specialized for `mpfr::mpreal`, but not yet the digits member.
The implementation is a straight forward copy of `digits10`, but w.r.t. basis 2. Then, a specialization of `NumTraits<mpfr::mpreal>` is added, that calls the corresponding `std::numeric_limits<mpfr::mpreal>::digits()` method.
In `StableNorm` the call for `std::numeric_limits<T>::digits` is replaced by `NumTraits<T>::digits()` that has a fall-back to the former one.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/787.