mpz reuse test takes too much time

Marc Glisse marc.glisse at inria.fr
Sat Dec 3 09:00:01 UTC 2016


On Sat, 3 Dec 2016, Niels Möller wrote:

> "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
>
>>> ! #define GCDEXT_CHECK2(i1, i2) do {					\
>>> ! 	    mpz_gcdext (res1, res2, NULL, i1, i2);			\
>>> ! 	    MPZ_CHECK_FORMAT (res1);					\
>>> ! 	    MPZ_CHECK_FORMAT (res2);					\
>>> ! 	    if (mpz_cmp (ref1, res1) != 0 || mpz_cmp (ref2, res2) != 0)	\
>>> ! 	      FAIL2 (mpz_gcdext, i1, i2, NULL);				\
>>> ! 	  } while (0)
>>
>> Should we check both mpz_gcdext (res1, res2, NULL, i1, i2); and mpz_gcdext
>> (res1, NULL, res2, i2, i1) in this macro?
>
> Hmm, you changed the code to not only allow G to be NULL, but allow NULL
> S too?

That was already the case before my patch. Since s and t may get swapped 
depending on the values of a and b, you cannot really support t==NULL 
without supporting s==NULL. You may prefer not documenting it though...


-- 
Marc Glisse


More information about the gmp-devel mailing list