Hello community, here is the log from the commit of package flint for openSUSE:Factory checked in at 2015-07-05 18:03:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/flint (Old) and /work/SRC/openSUSE:Factory/.flint.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "flint" Changes: -------- --- /work/SRC/openSUSE:Factory/flint/flint.changes 2015-02-20 12:01:40.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.flint.new/flint.changes 2015-07-05 18:03:10.000000000 +0200 @@ -1,0 +2,6 @@ +Fri Jun 26 11:06:51 UTC 2015 - jengelh@inai.de + +- Update to new upstream release 2.4.5 +* fixed a severe bug in flint's fmpz_poly_gcd_heuristic + +------------------------------------------------------------------- Old: ---- flint-2.4.4.tar.gz New: ---- flint-2.4.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ flint.spec ++++++ --- /var/tmp/diff_new_pack.sDUiOK/_old 2015-07-05 18:03:11.000000000 +0200 +++ /var/tmp/diff_new_pack.sDUiOK/_new 2015-07-05 18:03:11.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package flint # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: flint %define lname libflint0 -Version: 2.4.4 +Version: 2.4.5 Release: 0 Summary: C library for doing number theory License: GPL-2.0+ ++++++ 0001-build-provide-autotools-files.patch ++++++ --- /var/tmp/diff_new_pack.sDUiOK/_old 2015-07-05 18:03:11.000000000 +0200 +++ /var/tmp/diff_new_pack.sDUiOK/_new 2015-07-05 18:03:11.000000000 +0200 @@ -37,10 +37,10 @@ create mode 100644 fmpz-conversions.h create mode 100644 m4/.gitignore -Index: flint-2.4.4/.gitignore +Index: flint-2.4.5/.gitignore =================================================================== ---- flint-2.4.4.orig/.gitignore -+++ flint-2.4.4/.gitignore +--- flint-2.4.5.orig/.gitignore ++++ flint-2.4.5/.gitignore @@ -1,19 +1,29 @@ *~ *.orig @@ -84,10 +84,10 @@ +/Mkinclude.am + +/flint-config.h -Index: flint-2.4.4/Makefile.am +Index: flint-2.4.5/Makefile.am =================================================================== --- /dev/null -+++ flint-2.4.4/Makefile.am ++++ flint-2.4.5/Makefile.am @@ -0,0 +1,37 @@ +# -*- Makefile -*- + @@ -103,7 +103,7 @@ + +SOURCES = clz_tab.c memory_manager.c version.c profiler.c + -+pkginclude_HEADERS = ${cwd_headers} ++pkginclude_HEADERS = config.h flint-config.h ${cwd_headers} + +lib_LTLIBRARIES = libflint.la +libflint_la_SOURCES = ${lib_sources} ${SOURCES} @@ -125,11 +125,11 @@ +endif + +flint-config.h: config.h -+ grep FLINT <$< >$@ -Index: flint-2.4.4/autofiles.sh ++ grep FLINT $< >$@ +Index: flint-2.4.5/autofiles.sh =================================================================== --- /dev/null -+++ flint-2.4.4/autofiles.sh ++++ flint-2.4.5/autofiles.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# @@ -174,20 +174,20 @@ +wcdir exmp_sources examples; +wcdir test_sources test; +wcdir prof_sources profile; -Index: flint-2.4.4/autogen.sh +Index: flint-2.4.5/autogen.sh =================================================================== --- /dev/null -+++ flint-2.4.4/autogen.sh ++++ flint-2.4.5/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +./autofiles.sh; +autoreconf -fi; +rm -Rf autom4te.cache; -Index: flint-2.4.4/configure.ac +Index: flint-2.4.5/configure.ac =================================================================== --- /dev/null -+++ flint-2.4.4/configure.ac ++++ flint-2.4.5/configure.ac @@ -0,0 +1,129 @@ +AC_INIT([flint], [2.3]) +AC_CONFIG_AUX_DIR([build-aux]) @@ -318,10 +318,10 @@ + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT -Index: flint-2.4.4/fft_tuning.h +Index: flint-2.4.5/fft_tuning.h =================================================================== --- /dev/null -+++ flint-2.4.4/fft_tuning.h ++++ flint-2.4.5/fft_tuning.h @@ -0,0 +1,9 @@ +/* + * Checking for "64-bit" must not depend on uname at all. @@ -332,10 +332,10 @@ +#else +# include "fft_tuning32.h" +#endif -Index: flint-2.4.4/fft_tuning32.h +Index: flint-2.4.5/fft_tuning32.h =================================================================== --- /dev/null -+++ flint-2.4.4/fft_tuning32.h ++++ flint-2.4.5/fft_tuning32.h @@ -0,0 +1,19 @@ +/* fft_tuning.h -- autogenerated by tune-fft */ + @@ -356,9 +356,9 @@ + +#endif + -Index: flint-2.4.4/fft_tuning32.in +Index: flint-2.4.5/fft_tuning32.in =================================================================== ---- flint-2.4.4.orig/fft_tuning32.in +--- flint-2.4.5.orig/fft_tuning32.in +++ /dev/null @@ -1,19 +0,0 @@ -/* fft_tuning.h -- autogenerated by tune-fft */ @@ -380,10 +380,10 @@ - -#endif - -Index: flint-2.4.4/fft_tuning64.h +Index: flint-2.4.5/fft_tuning64.h =================================================================== --- /dev/null -+++ flint-2.4.4/fft_tuning64.h ++++ flint-2.4.5/fft_tuning64.h @@ -0,0 +1,19 @@ +/* fft_tuning.h -- autogenerated by tune-fft */ + @@ -404,9 +404,9 @@ + +#endif + -Index: flint-2.4.4/fft_tuning64.in +Index: flint-2.4.5/fft_tuning64.in =================================================================== ---- flint-2.4.4.orig/fft_tuning64.in +--- flint-2.4.5.orig/fft_tuning64.in +++ /dev/null @@ -1,19 +0,0 @@ -/* fft_tuning.h -- autogenerated by tune-fft */ @@ -428,10 +428,10 @@ - -#endif - -Index: flint-2.4.4/fmpz-conversions-reentrant.h +Index: flint-2.4.5/fmpz-conversions-reentrant.h =================================================================== --- /dev/null -+++ flint-2.4.4/fmpz-conversions-reentrant.h ++++ flint-2.4.5/fmpz-conversions-reentrant.h @@ -0,0 +1,10 @@ +#ifndef FMPZ_CONVERSIONS_H +#define FMPZ_CONVERSIONS_H @@ -443,9 +443,9 @@ +#define COEFF_TO_PTR(x) ((__mpz_struct *) ((x) << 2)) + +#endif /* FMPZ_CONVERSIONS_H */ -Index: flint-2.4.4/fmpz-conversions-reentrant.in +Index: flint-2.4.5/fmpz-conversions-reentrant.in =================================================================== ---- flint-2.4.4.orig/fmpz-conversions-reentrant.in +--- flint-2.4.5.orig/fmpz-conversions-reentrant.in +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef FMPZ_CONVERSIONS_H @@ -458,10 +458,10 @@ -#define COEFF_TO_PTR(x) ((__mpz_struct *) ((x) << 2)) - -#endif /* FMPZ_CONVERSIONS_H */ -Index: flint-2.4.4/fmpz-conversions-single.h +Index: flint-2.4.5/fmpz-conversions-single.h =================================================================== --- /dev/null -+++ flint-2.4.4/fmpz-conversions-single.h ++++ flint-2.4.5/fmpz-conversions-single.h @@ -0,0 +1,10 @@ +#ifndef FMPZ_CONVERSIONS_H +#define FMPZ_CONVERSIONS_H @@ -473,9 +473,9 @@ +#define COEFF_TO_PTR(x) ((__mpz_struct *) ((x) << 2)) + +#endif /* FMPZ_CONVERSIONS_H */ -Index: flint-2.4.4/fmpz-conversions-single.in +Index: flint-2.4.5/fmpz-conversions-single.in =================================================================== ---- flint-2.4.4.orig/fmpz-conversions-single.in +--- flint-2.4.5.orig/fmpz-conversions-single.in +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef FMPZ_CONVERSIONS_H @@ -488,10 +488,10 @@ -#define COEFF_TO_PTR(x) ((__mpz_struct *) ((x) << 2)) - -#endif /* FMPZ_CONVERSIONS_H */ -Index: flint-2.4.4/fmpz-conversions.h +Index: flint-2.4.5/fmpz-conversions.h =================================================================== --- /dev/null -+++ flint-2.4.4/fmpz-conversions.h ++++ flint-2.4.5/fmpz-conversions.h @@ -0,0 +1,6 @@ +#include "flint-config.h" +#ifdef FLINT_REENTRANT @@ -499,10 +499,10 @@ +#else +# include "fmpz-conversions-single.h" +#endif -Index: flint-2.4.4/m4/.gitignore +Index: flint-2.4.5/m4/.gitignore =================================================================== --- /dev/null -+++ flint-2.4.4/m4/.gitignore ++++ flint-2.4.5/m4/.gitignore @@ -0,0 +1,2 @@ +/libtool.m4 +/lt*.m4 ++++++ flint-2.4.4.tar.gz -> flint-2.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/AUTHORS new/flint-2.4.5/AUTHORS --- old/flint-2.4.4/AUTHORS 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/AUTHORS 2015-02-17 15:56:55.000000000 +0100 @@ -106,7 +106,8 @@ Fr\'{e}d\'{e}ric Chyzak, Julien Puydt, Dana Jacobsen, Michael Jacobson Jr., Mike Stillman, Jan Englehardt, Jean-Pierre Flori, Jeroen Demeyer, Shi Bai, Qingwen Guan, Frithjof Schulze, Robert Baillie, Oleksandr Motsak, Hans -Schoenemann, Janko Boehm, Ahmed Soliman, Francois Bissey and others. +Schoenemann, Janko Boehm, Ahmed Soliman, Francois Bissey, Anton Mellit +and others. $\bullet$ In addition Michael Abshoff, William Stein and Robert Bradshaw have contributed to the build system of FLINT. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/Makefile.in new/flint-2.4.5/Makefile.in --- old/flint-2.4.4/Makefile.in 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/Makefile.in 2015-02-17 15:56:55.000000000 +0100 @@ -75,7 +75,7 @@ rm -f config.h fft_tuning.h fmpz-conversions.h Makefile fmpz/fmpz.c dist: - git archive --format tar --prefix flint-2.4.4/ flint-2.4 > ../flint-2.4.4.tar; gzip ../flint-2.4.4.tar + git archive --format tar --prefix flint-2.4.5/ flint-2.4 > ../flint-2.4.5.tar; gzip ../flint-2.4.5.tar profile: library $(PROF_SOURCES) $(EXT_PROF_SOURCES) build/profiler.o mkdir -p build/profile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/NEWS new/flint-2.4.5/NEWS --- old/flint-2.4.4/NEWS 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/NEWS 2015-02-17 15:56:55.000000000 +0100 @@ -1100,3 +1100,8 @@ * Fix a linker issue on Mac OSX. +v 2.4.4 -- fixed a severe bug in flint's primality code (n_is_prime() affecting n_factor()) + +v 2.4.5 -- fixed a severe bug in flint's fmpz_poly_gcd_heuristic, reported by + Anton Mellit. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/doc/latex/input/title.tex new/flint-2.4.5/doc/latex/input/title.tex --- old/flint-2.4.4/doc/latex/input/title.tex 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/doc/latex/input/title.tex 2015-02-17 15:56:55.000000000 +0100 @@ -11,8 +11,8 @@ {\Large\itshape Fast Library for Number Theory} \vspace{0.5\textheight} -{\large Version~2.4.4}\\[1.2\baselineskip] -{\large 17 June 2014}\\[1.2\baselineskip] +{\large Version~2.4.5}\\[1.2\baselineskip] +{\large 17 Feb 2015}\\[1.2\baselineskip] {\large William Hart${}^*$, Fredrik Johansson${}^\dag$, Sebastian Pancratz${}^\ddag$}\\[1.2\baselineskip] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/flint.h new/flint-2.4.5/flint.h --- old/flint-2.4.4/flint.h 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/flint.h 2015-02-17 15:56:55.000000000 +0100 @@ -61,8 +61,8 @@ #define __FLINT_VERSION 2 #define __FLINT_VERSION_MINOR 4 -#define __FLINT_VERSION_PATCHLEVEL 4 -#define FLINT_VERSION "2.4.4" +#define __FLINT_VERSION_PATCHLEVEL 5 +#define FLINT_VERSION "2.4.5" #define __FLINT_RELEASE (__FLINT_VERSION * 10000 + \ __FLINT_VERSION_MINOR * 100 + \ __FLINT_VERSION_PATCHLEVEL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/fmpz_poly/gcd_heuristic.c new/flint-2.4.5/fmpz_poly/gcd_heuristic.c --- old/flint-2.4.4/fmpz_poly/gcd_heuristic.c 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/fmpz_poly/gcd_heuristic.c 2015-02-17 15:56:55.000000000 +0100 @@ -85,7 +85,7 @@ _fmpz_poly_gcd_heuristic(fmpz * res, const fmpz * poly1, slong len1, const fmpz * poly2, slong len2) { - ulong bits1, bits2, max_bits, pack_bits, bound_bits, bits_G, bits_Q; + long bits1, bits2, max_bits, pack_bits, bound_bits, bits_G, bits_Q; ulong limbs1, limbs2, limbsg, pack_limbs, qlimbs; ulong log_glen, log_length; slong sign1, sign2, glen, qlen; @@ -154,9 +154,17 @@ http://arxiv.org/abs/cs/0206032v1 */ bits1 = FLINT_ABS(_fmpz_vec_max_bits(A, len1)); - bits2 = FLINT_ABS(_fmpz_vec_max_bits(B, len2)); - max_bits = FLINT_MAX(bits1, bits2); + bits2 = FLINT_ABS(_fmpz_vec_max_bits(B, len2)); + /* + always extra bit for signs whether polys are signed or not, since we don't + know if any purported gcds/quotients will be signed + */ + max_bits = FLINT_MAX(bits1, bits2) + 1; + /* + the +6 is chosen heuristically for performance; the theorem + is satisfied with +3 (including a bit for signs) + */ bound_bits = FLINT_MIN(bits1, bits2) + 6; pack_bits = FLINT_MAX(bound_bits, max_bits); /* need to pack original polys */ pack_limbs = (pack_bits - 1)/FLINT_BITS + 1; @@ -224,24 +232,26 @@ t = _fmpz_vec_init(len1 + glen); _fmpz_poly_bit_unpack(Q, qlen, q, pack_bits, 0); while (Q[qlen - 1] == 0) qlen--; - + /* divide by content */ _fmpz_vec_scalar_divexact_fmpz(G, G, glen, gc); /* check if we really need to multiply out to check for exact quotient */ bits_G = FLINT_ABS(_fmpz_vec_max_bits(G, glen)); - bits_Q = FLINT_ABS(_fmpz_vec_max_bits(Q, qlen)); - log_glen = FLINT_BIT_COUNT(glen); - log_length = FLINT_MIN(log_glen, FLINT_BIT_COUNT(qlen)); + bits_Q = FLINT_ABS(_fmpz_vec_max_bits(Q, qlen)); + log_glen = FLINT_BIT_COUNT(glen); + log_length = FLINT_MIN(log_glen, FLINT_BIT_COUNT(qlen)); - divides = (bits_G + bits_Q + log_length < pack_bits); + /* allow one bit for signs */ + divides = (bits_G + bits_Q + log_length < pack_bits); if (!divides) /* need to multiply out to check exact quotient */ divides = multiplies_out(A, len1, Q, qlen, G, glen, sign1, t); if (divides) /* quotient really was exact */ { - flint_mpn_zero(q, qlimbs); + divides = 0; + flint_mpn_zero(q, qlimbs); if (flint_mpn_divides(q, array2, limbs2, arrayg, limbsg, temp)) { @@ -250,13 +260,14 @@ qlen = FLINT_MIN(len2, (qlimbs*FLINT_BITS - 1)/pack_bits + 1); _fmpz_poly_bit_unpack(Q, qlen, q, pack_bits, 0); while (Q[qlen - 1] == 0) qlen--; - - /* check if we really need to multiply out to check for exact quotient */ + + /* check if we really need to multiply out to check for exact quotient */ bits_Q = FLINT_ABS(_fmpz_vec_max_bits(Q, qlen)); - log_length = FLINT_MIN(log_glen, FLINT_BIT_COUNT(qlen)); + log_length = FLINT_MIN(log_glen, FLINT_BIT_COUNT(qlen)); - divides = (bits_G + bits_Q + log_length < pack_bits); - + /* allow one bit for signs */ + divides = (bits_G + bits_Q + log_length < pack_bits); + if (!divides) /* we need to multiply out */ divides = multiplies_out(B, len2, Q, qlen, G, glen, sign1, t); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flint-2.4.4/fmpz_poly/test/t-gcd_heuristic.c new/flint-2.4.5/fmpz_poly/test/t-gcd_heuristic.c --- old/flint-2.4.4/fmpz_poly/test/t-gcd_heuristic.c 2014-06-19 18:33:28.000000000 +0200 +++ new/flint-2.4.5/fmpz_poly/test/t-gcd_heuristic.c 2015-02-17 15:56:55.000000000 +0100 @@ -201,6 +201,60 @@ fmpz_poly_clear(r); } + /* + Check that gcd(f, ga) divides f and ga for small generic f, g + and a small linear factor a. Exercises a bug found by Anton Mellit. + */ + for (i = 0; i < 1000 * flint_test_multiplier(); i++) + { + fmpz_poly_t a, d, f, g, q, r; + + fmpz_poly_init(d); + fmpz_poly_init(f); + fmpz_poly_init(g); + fmpz_poly_init(q); + fmpz_poly_init(r); + fmpz_poly_init(a); + fmpz_poly_randtest(f, state, n_randint(state, 10), 8); + fmpz_poly_randtest(g, state, n_randint(state, 10), 4); + + /* multiply by small linear factor */ + fmpz_poly_set_coeff_si(a, 0, n_randint(state, 2) ? 1 : -1); + fmpz_poly_set_coeff_si(a, 1, 1); + fmpz_poly_mul(g, g, a); + + d1 = fmpz_poly_gcd_heuristic(d, f, g); + + if (d1) + { + if (fmpz_poly_is_zero(d)) + result = fmpz_poly_is_zero(f) && fmpz_poly_is_zero(g); + else + { + fmpz_poly_divrem_divconquer(q, r, f, d); + result = fmpz_poly_is_zero(r); + fmpz_poly_divrem_divconquer(q, r, g, d); + result &= fmpz_poly_is_zero(r); + } + + if (!result) + { + flint_printf("FAIL (gcd(f, g) | f and g):\n"); + flint_printf("f = "), fmpz_poly_print(f), flint_printf("\n"); + flint_printf("g = "), fmpz_poly_print(g), flint_printf("\n"); + flint_printf("d = "), fmpz_poly_print(d), flint_printf("\n"); + abort(); + } + } + + fmpz_poly_clear(a); + fmpz_poly_clear(d); + fmpz_poly_clear(f); + fmpz_poly_clear(g); + fmpz_poly_clear(q); + fmpz_poly_clear(r); + } + /* Sebastian's test case */ { fmpz_poly_t a, b, d; @@ -222,6 +276,38 @@ fmpz_poly_print(d); flint_printf("\n"); abort(); } + + fmpz_poly_clear(a); + fmpz_poly_clear(b); + fmpz_poly_clear(d); + } + + /* Anton Mellit's test case */ + { + fmpz_poly_t a, b, d; + int heuristic; + + fmpz_poly_init(a); + fmpz_poly_init(b); + fmpz_poly_init(d); + + /* + b = 3*q^12 - 8*q^11 - 24*q^10 - 48*q^9 - 84*q^8 - 92*q^7 - 92*q^6 - + 70*q^5 - 50*q^4 - 27*q^3 - 13*q^2 - 4*q - 1 + a = q^13 - 2*q^12 + 2*q^10 - q^9 + */ + fmpz_poly_set_str(b, "13 -1 -4 -13 -27 -50 -70 -92 -92 -84 -48 -24 -8 3"); + fmpz_poly_set_str(a, "14 0 0 0 0 0 0 0 0 0 -1 2 0 -2 1"); + + heuristic = fmpz_poly_gcd_heuristic(d, a, b); + + result = (heuristic == 0 || (d->length == 1 && fmpz_is_one(d->coeffs))); + if (!result) + { + flint_printf("FAIL Mellit test case:\n"); + fmpz_poly_print(d); flint_printf("\n"); + abort(); + } fmpz_poly_clear(a); fmpz_poly_clear(b);