MPRealSupport and StableNorm
Submitted by Freddie Witherden
Assigned to Nobody
Link to original bugzilla bug (#787)
Version: 3.2
Description
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.