Comparing boost::multiprecision cpp_int and mpz_int
cpp_int is more convenient but mpz_int is faster especially for long
numbers? What say benchmarks? For mpz_int I must install GMP on Linux or
build MPIR on WIndows (build lib_mpir_core2) ?
I want make sample benchmark test but I can't convert cpp_it to mpz_int nor
iport bits, whereas for cpp_int I can import_bits(x, xBytes.begin(),
xBytes.end()) where vector
On 05/11/2019 07:47, Andy via Boost-users wrote:
cpp_int is more convenient but mpz_int is faster especially for long numbers?
Probably quite a slower for small numbers, and a lot faster for large ones.
What say benchmarks?
Out of date, but these may give some clue: https://www.boost.org/doc/libs/1_71_0/libs/multiprecision/doc/html/boost_mul...
For mpz_int I must install GMP on Linux or build MPIR on WIndows (build lib_mpir_core2) ? Yes. I want make sample benchmark test but I can't convert cpp_it to mpz_int nor iport bits, whereas for cpp_int I can import_bits(x, xBytes.begin(), xBytes.end()) where vector
xBytes; Question: is possible import byte array to mpz_int?
No, but the 2 types are explicitly convertible to each other, ie this works: cpp_int i(2); mpz_int j(i); i = cpp_int(j); John. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
participants (2)
-
Andy
-
John Maddock