From 0a502d3da399f919e51974751c3d38779c9b1df1 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Thu, 18 Jul 2024 11:13:08 +0200 Subject: [PATCH] factory: 4.4.0 --- Formula/factory.rb | 388 +-------------------------------------------- 1 file changed, 2 insertions(+), 386 deletions(-) diff --git a/Formula/factory.rb b/Formula/factory.rb index a9e6090..4ffdf53 100644 --- a/Formula/factory.rb +++ b/Formula/factory.rb @@ -1,9 +1,8 @@ class Factory < Formula desc "C++ class library for recursive representation of multivariate polynomial data" homepage "https://github.com/Singular/Singular/blob/spielwiese/factory/README" - url "https://www.singular.uni-kl.de/ftp/pub/Math/Factory/factory-4.3.0.tar.gz" - version "4.3.2p15-151235c5" - sha256 "f1e25b566a8c06d0e98b9795741c6d12b5a34c5c0c61c078d9346d8bbc82f09f" + url "https://www.singular.uni-kl.de/ftp/pub/Math/Factory/factory-4.4.0.tar.gz" + sha256 "baf31159578463e26bf18ec68ec901228d79a819866dd96c02d85c73dfbaf030" license any_of: ["GPL-2.0-only", "GPL-3.0-only"] bottle do @@ -22,9 +21,6 @@ class Factory < Formula depends_on "gmp" depends_on "ntl" - # diff of Release-4-3-0..151235c5 - patch :DATA - def install ENV.cxx11 args = %W[ @@ -94,383 +90,3 @@ def install system "./test" end end - -__END__ - -diff --git a/COPYING b/COPYING -index 142252eef..6f77e94bf 100644 ---- a/COPYING -+++ b/COPYING -@@ -7,7 +7,7 @@ - - Authors: G.-M. Greuel, R. Stobbe, J. Schmidt, M. Lee, - G. Pfister, H. Schoenemann -- Copyright (C) 1991-2022 -+ Copyright (C) 1991-2023 - - Characteristic sets and factorization over algebraic function fields: - Michael Messollen -diff --git a/FLINTconvert.cc b/FLINTconvert.cc -index d103d3f36..ac5f8dcbb 100644 ---- a/FLINTconvert.cc -+++ b/FLINTconvert.cc -@@ -15,6 +15,7 @@ - - #include - -+#include - - #include "canonicalform.h" - #include "fac_util.h" -@@ -62,6 +63,7 @@ extern "C" - #endif - #if ( __FLINT_RELEASE >= 20503) - #include -+#include - - // planed, but not yet in FLINT: - #if (__FLINT_RELEASE < 20700) -@@ -85,7 +87,7 @@ void fq_nmod_set_nmod_poly(fq_nmod_t a, const nmod_poly_t b, const fq_nmod_ctx_t - nmod_poly_set(a, b); - fq_nmod_reduce(a, ctx); - } --#else -+#elif (__FLINT_RELEASE < 30000) - void fq_nmod_set_nmod_poly(fq_nmod_t a, const nmod_poly_t b, - const fq_nmod_ctx_t ctx) - { -diff --git a/FLINTconvert.h b/FLINTconvert.h -index bed483b97..3908d77fc 100644 ---- a/FLINTconvert.h -+++ b/FLINTconvert.h -@@ -45,6 +45,12 @@ extern "C" - #endif - #if ( __FLINT_RELEASE >= 20700) - #include -+#include -+#endif -+#if ( __FLINT_RELEASE >= 30000) -+#include -+#include -+#include - #endif - #endif - -diff --git a/NTLconvert.cc b/NTLconvert.cc -index 6dec6be89..eedb70b67 100644 ---- a/NTLconvert.cc -+++ b/NTLconvert.cc -@@ -43,7 +43,7 @@ - void out_cf(const char *s1,const CanonicalForm &f,const char *s2); - - --VAR long fac_NTL_char = -1; // the current characterstic for NTL calls -+VAR long fac_NTL_char = -1; // the current characteristic for NTL calls - // -1: undefined - #ifdef NTL_CLIENT // in : using of name space NTL - NTL_CLIENT -diff --git a/README b/README -index 440791c14..5cd808206 100644 ---- a/README -+++ b/README -@@ -204,7 +204,7 @@ example applications for Factory. - ================================= - Algorithms for manipulation of polynomial ideals via the characteristic set - methods (e.g., calculating the characteristic set and the irreducible --characteristic series) are now incorpareted into factory. -+characteristic series) are now incorporated into factory. - If you want to learn about characteristic sets, the next is a good point - to start with: - Dongming Wang: -diff --git a/cfModGcd.cc b/cfModGcd.cc -index 435a66336..482f55898 100644 ---- a/cfModGcd.cc -+++ b/cfModGcd.cc -@@ -22,6 +22,7 @@ - - #include "config.h" - -+#include - - #include "cf_assert.h" - #include "debug.h" -@@ -1805,7 +1806,11 @@ gaussianElimFq (CFMatrix& M, CFArray& L, const Variable& alpha) - fq_nmod_mat_t FLINTN; - convertFacCFMatrix2Fq_nmod_mat_t (FLINTN, ctx, *N); - // rank -+ #if __FLINT_RELEASE >= 30100 -+ long rk= fq_nmod_mat_rref (FLINTN,FLINTN,ctx); -+ #else - long rk= fq_nmod_mat_rref (FLINTN,ctx); -+ #endif - // clean up - fq_nmod_mat_clear (FLINTN,ctx); - fq_nmod_ctx_clear(ctx); -@@ -1825,7 +1830,6 @@ gaussianElimFq (CFMatrix& M, CFArray& L, const Variable& alpha) - #else - factoryError("NTL/FLINT missing: gaussianElimFq"); - #endif -- delete N; - - M= (*N) (1, M.rows(), 1, M.columns()); - L= CFArray (M.rows()); -@@ -1912,7 +1916,11 @@ solveSystemFq (const CFMatrix& M, const CFArray& L, const Variable& alpha) - fq_nmod_mat_t FLINTN; - convertFacCFMatrix2Fq_nmod_mat_t (FLINTN, ctx, *N); - // rank -+ #if __FLINT_RELEASE >= 30100 -+ long rk= fq_nmod_mat_rref (FLINTN,FLINTN,ctx); -+ #else - long rk= fq_nmod_mat_rref (FLINTN,ctx); -+ #endif - #elif defined(HAVE_NTL) - int p= getCharacteristic (); - if (fac_NTL_char != p) -diff --git a/cfModResultant.cc b/cfModResultant.cc -index 601a15394..c1060b612 100644 ---- a/cfModResultant.cc -+++ b/cfModResultant.cc -@@ -13,6 +13,7 @@ - - #include "config.h" - -+#include - - #include "cf_assert.h" - #include "timing.h" -diff --git a/cf_factor.cc b/cf_factor.cc -index 6b240994b..0e937c5d6 100644 ---- a/cf_factor.cc -+++ b/cf_factor.cc -@@ -47,6 +47,10 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - #endif - #endif - -diff --git a/cf_map_ext.cc b/cf_map_ext.cc -index e735a9a87..2b0388fc9 100644 ---- a/cf_map_ext.cc -+++ b/cf_map_ext.cc -@@ -30,6 +30,7 @@ - - #ifdef HAVE_FLINT - #include "FLINTconvert.h" -+#include - #endif - - // cyclotomoic polys: -diff --git a/cf_ops.cc b/cf_ops.cc -index a9513938d..28b76ac19 100644 ---- a/cf_ops.cc -+++ b/cf_ops.cc -@@ -394,7 +394,7 @@ getVars ( const CanonicalForm & f ) - if ( i > 0 ) i--; - } - ~~~~~~~~~~~~~~~~~~~~~ -- * Then apply( f, diff ) is differentation of f with respect to the -+ * Then apply( f, diff ) is differentiation of f with respect to the - * main variable of f. - * - **/ -diff --git a/cf_roots.cc b/cf_roots.cc -index fb627ce60..b57038263 100644 ---- a/cf_roots.cc -+++ b/cf_roots.cc -@@ -18,6 +18,7 @@ - - #ifdef HAVE_FLINT - #include "FLINTconvert.h" -+#include "flint/nmod_poly_factor.h" - #endif - - #include "cf_roots.h" -diff --git a/configure.ac b/configure.ac -index dd5ab8d24..72d5b426b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -12,11 +12,11 @@ dnl # - # - # - initialisation. - # --AC_INIT([factory], [4.3.0]) -+AC_INIT([factory], [4.3.2]) - AC_CONFIG_SRCDIR(canonicalform.cc) - AC_CONFIG_MACRO_DIR([m4]) - AC_CONFIG_AUX_DIR([.]) --AC_CONFIG_HEADER([_config.h]) -+AC_CONFIG_HEADERS([_config.h]) - - AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules - m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -diff --git a/facAbsBiFact.cc b/facAbsBiFact.cc -index 32ce09602..717e76ed9 100644 ---- a/facAbsBiFact.cc -+++ b/facAbsBiFact.cc -@@ -23,6 +23,7 @@ - #include "cf_algorithm.h" - #ifdef HAVE_FLINT - #include "FLINTconvert.h" -+#include "flint/nmod_poly_factor.h" - #include - #endif - #ifdef HAVE_NTL -diff --git a/facAlgFunc.cc b/facAlgFunc.cc -index 6d745556f..b3f6b4b12 100644 ---- a/facAlgFunc.cc -+++ b/facAlgFunc.cc -@@ -763,7 +763,7 @@ SteelTrager (const CanonicalForm & f, const CFList & AS) - CFListIterator i, ii; - - bool derivZeroF= false; -- int j, expF= 0, tmpExp; -+ int j, expF=0, tmpExp=0; - CFFList varsMapLevel, tmp; - CFFListIterator iter; - -diff --git a/facBivar.cc b/facBivar.cc -index 43b065a17..bd088958e 100644 ---- a/facBivar.cc -+++ b/facBivar.cc -@@ -329,7 +329,7 @@ CFList biFactorize (const CanonicalForm& F, const Variable& v) - int subCheck1= substituteCheck (A, x); - int subCheck2= substituteCheck (A, y); - buf= swapvar (A,x,y); -- int evaluation, evaluation2, bufEvaluation= 0, bufEvaluation2= 0; -+ int evaluation, evaluation2=0, bufEvaluation= 0, bufEvaluation2= 0; - for (int i= 0; i < factorNums; i++) - { - bufAeval= A; -diff --git a/facFqBivar.cc b/facFqBivar.cc -index 0d4429c53..7d3ae8438 100644 ---- a/facFqBivar.cc -+++ b/facFqBivar.cc -@@ -19,6 +19,7 @@ - - #include "config.h" - -+#include - - #include "cf_assert.h" - #include "cf_util.h" -@@ -43,6 +44,8 @@ - - #ifdef HAVE_FLINT - #include "FLINTconvert.h" -+#include "flint/nmod_poly_factor.h" -+#include "flint/fq_nmod_poly_factor.h" - #endif - - TIMING_DEFINE_PRINT(fac_fq_uni_factorizer) -diff --git a/facFqBivarUtil.cc b/facFqBivarUtil.cc -index c2bf04fe0..8cc7675ad 100644 ---- a/facFqBivarUtil.cc -+++ b/facFqBivarUtil.cc -@@ -229,7 +229,7 @@ void appendTestMapDown (CFList& factors, const CanonicalForm& f, - CanonicalForm delta= info.getDelta(); - CanonicalForm gamma= info.getGamma(); - CanonicalForm g= f; -- int degMipoBeta; -+ int degMipoBeta=0; - if (!k && beta.level() == 1) - degMipoBeta= 1; - else if (!k && beta.level() != 1) -diff --git a/facFqFactorize.cc b/facFqFactorize.cc -index 6b35b6409..6cb91fd53 100644 ---- a/facFqFactorize.cc -+++ b/facFqFactorize.cc -@@ -18,6 +18,7 @@ - - #include "config.h" - -+#include - - #include "cf_assert.h" - #include "debug.h" -diff --git a/facMul.cc b/facMul.cc -index 1b734f701..08d09ccdf 100644 ---- a/facMul.cc -+++ b/facMul.cc -@@ -22,6 +22,7 @@ - - #include "config.h" - -+#include - - #include "canonicalform.h" - #include "facMul.h" -@@ -37,6 +38,10 @@ - - #ifdef HAVE_FLINT - #include "FLINTconvert.h" -+#include "flint/fq_nmod_vec.h" -+#if __FLINT_RELEASE >= 20503 -+#include "flint/fmpz_mod.h" -+#endif - #endif - - // univariate polys -diff --git a/gfops.cc b/gfops.cc -index f231a9bba..4538c4746 100644 ---- a/gfops.cc -+++ b/gfops.cc -@@ -92,7 +92,7 @@ static void gf_get_table ( int p, int n ) - FILE * inputfile; - if (gftable_dir) - { -- sprintf( buffer, "gftables/%d", q); -+ snprintf( buffer, gf_maxbuffer, "gftables/%d", q); - gffilename = (char *)malloc(strlen(gftable_dir) + strlen(buffer) + 1); - STICKYASSERT(gffilename,"out of memory"); - strcpy(gffilename,gftable_dir); -@@ -101,7 +101,7 @@ static void gf_get_table ( int p, int n ) - } - else - { -- sprintf( buffer, "gftables/%d", q ); -+ snprintf( buffer, gf_maxbuffer, "gftables/%d", q ); - gffilename = buffer; - #ifndef SINGULAR - inputfile = fopen( buffer, "r" ); -diff --git a/int_poly.cc b/int_poly.cc -index 9bf191b23..195d13703 100644 ---- a/int_poly.cc -+++ b/int_poly.cc -@@ -999,21 +999,23 @@ InternalPoly::comparesame ( InternalCF * acoeff ) - termList cursor1 = firstTerm; - termList cursor2 = apoly->firstTerm; - for ( ; cursor1 && cursor2; cursor1 = cursor1->next, cursor2 = cursor2->next ) -+ { - // we test on inequality of coefficients at this - // point instead of testing on "less than" at the - // last `else' in the enclosed `if' statement since a -- // test on inequaltiy in general is cheaper -- if ( (cursor1->exp != cursor2->exp) || (cursor1->coeff != cursor2->coeff) ) -- { -- if ( cursor1->exp > cursor2->exp ) -- return 1; -- else if ( cursor1->exp < cursor2->exp ) -- return -1; -- else if ( cursor1->coeff > cursor2->coeff ) -+ // test on inequality in general is cheaper -+ if ( cursor1->exp > cursor2->exp ) -+ return 1; -+ else if ( cursor1->exp < cursor2->exp ) -+ return -1; -+ if ( (cursor1->coeff != cursor2->coeff) ) -+ { -+ if ( cursor1->coeff > cursor2->coeff ) - return 1; - else - return -1; -- } -+ } -+ } - // check trailing terms - if ( cursor1 == cursor2 ) - return 0;