I'm extending a small library using NTL and GMP. I'm using NTL for convenience (and to conform to existing APIs), but I'll be switching to GMP (and MPFR) for the really performance-critical stuff.
I'm using GMP as a long integer backend for NTL (compiled using the NTL_GMP_LIP=on
flag) and I'm hoping this means I can just access the underlying mpz_t
from an NTL::ZZ
object. However, I can't find any documentation or examples.
If someone could give me a small code snippet or explain how to convert between an NTL::ZZ
and mpz_t
I would be eternally grateful.
(Note: I know you can just use strings as an intermediate format and convert using string parsing, but I'd like something more performant.)