Changeset 2878a0 in git
- Timestamp:
- Jan 25, 2021, 1:42:29 PM (2 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- a4240a2134ce068c6a739e2f0dbc245af4ad8497
- Parents:
- d854d7ee2faa25bc4e7476b6668602d7f4f39384
- git-author:
- Daniel Schultz <tthsqe12@gmail.com>2021-01-25 13:42:29+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2021-01-26 11:36:58+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facHensel.cc
rd854d7 r2878a0 161 161 CanonicalForm inv, leadingCoeff= Lc (F); 162 162 CFListIterator i= bufFactors; 163 164 result = CFList(); // empty the list before writing into it?! 165 163 166 if (bufFactors.getFirst().inCoeffDomain()) 164 167 { … … 789 792 CFList recResult; 790 793 CanonicalForm modMipo, mipo; 794 #if HAVE_NTL 795 // no variables for ntl 796 #else 797 fmpz_t bigpk; 798 fq_ctx_t fqctx; 799 fq_poly_t FLINTS, FLINTT, FLINTbuf3, FLINTbuf1, FLINTbuf2; 800 fq_t fcheck; 801 #endif 802 791 803 //here SW_RATIONAL is off 792 804 On (SW_RATIONAL); … … 810 822 if (fail) 811 823 { 824 next_prime: 812 825 int i= 0; 813 while (cf_getBigPrime (i) < p)826 while (cf_getBigPrime (i) <= p) 814 827 i++; 815 828 findGoodPrime (F, i); … … 874 887 result.append (b (convertNTLZZ_pEX2CF (NTLS, x, gamma))); 875 888 result.append (b (convertNTLZZ_pEX2CF (NTLT, x, gamma))); 876 #else // flint 877 fmpz_t bigpk; 878 fq_ctx_t fqctx; 879 fmpz_mod_poly_t FLINTmipo; 880 fq_poly_t FLINTS, FLINTT, FLINTbuf3, FLINTbuf1, FLINTbuf2; 881 fq_t fcheck; 889 #else // HAVE_FLINT 882 890 883 891 fmpz_init(bigpk); // does convert expect an initalized object? 884 892 convertCF2Fmpz(bigpk, b.getpk()); 885 893 fmpz_mod_poly_t FLINTmipo; 886 894 convertFacCF2Fmpz_mod_poly_t(FLINTmipo, getMipo(gamma), bigpk); 887 888 895 #if __FLINT_RELEASE >= 20700 889 896 fmpz_mod_ctx_t bigpk_ctx; … … 891 898 fq_ctx_init_modulus(fqctx, FLINTmipo, bigpk_ctx, "Z"); 892 899 fmpz_mod_ctx_clear(bigpk_ctx); 900 fmpz_mod_poly_clear(FLINTmipo, bigpk_ctx); 893 901 #else 894 902 fq_ctx_init_modulus(fqctx, FLINTmipo, "Z"); 903 fmpz_mod_poly_clear(FLINTmipo); 895 904 #endif 896 905 … … 908 917 if (!fq_is_one(fcheck, fqctx)) 909 918 { 910 printf("factory error: non-invertible element encountered\n"); 911 abort(); 919 fmpz_clear(bigpk); 920 fq_clear(fcheck, fqctx); 921 fq_poly_clear(FLINTS, fqctx); 922 fq_poly_clear(FLINTT, fqctx); 923 fq_poly_clear(FLINTbuf3, fqctx); 924 fq_poly_clear(FLINTbuf1, fqctx); 925 fq_poly_clear(FLINTbuf2, fqctx); 926 fq_ctx_clear(fqctx); 927 setReduce (alpha, false); 928 fail = true; 929 goto next_prime; 912 930 } 913 931 … … 928 946 XGCD (NTLbuf3, NTLS, NTLT, NTLbuf3, convertFacCF2NTLZZ_pEX (buf1, NTLmipo)); 929 947 S= convertNTLZZ_pEX2CF (NTLS, x, gamma); 930 #else // HAVE_FLINT948 #else 931 949 fq_poly_clear(FLINTbuf1, fqctx); //convert expects uninitialized! 932 950 convertFacCF2Fq_poly_t(FLINTbuf1, buf1, fqctx); … … 935 953 if (!fq_is_one(fcheck, fqctx)) 936 954 { 937 printf("factory error: non-invertible element encountered\n"); 938 abort(); 955 fmpz_clear(bigpk); 956 fq_clear(fcheck, fqctx); 957 fq_poly_clear(FLINTS, fqctx); 958 fq_poly_clear(FLINTT, fqctx); 959 fq_poly_clear(FLINTbuf3, fqctx); 960 fq_poly_clear(FLINTbuf1, fqctx); 961 fq_poly_clear(FLINTbuf2, fqctx); 962 fq_ctx_clear(fqctx); 963 setReduce (alpha, false); 964 fail = true; 965 goto next_prime; 939 966 } 940 967
Note: See TracChangeset
for help on using the changeset viewer.