Changeset 4946e3 in git
- Timestamp:
- Jul 3, 2020, 1:03:03 PM (3 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 175dfbe8022a34e8c7eab0e37ca15b932dbcb243
- Parents:
- f3adf3a165dd0f173fe615a55624a41ff34bdddb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_hnf.cc
rf3adf3 r4946e3 14 14 #include "config.h" 15 15 16 #include "canonicalform.h" 17 #include "cf_defs.h" 18 #include "cf_hnf.h" 16 19 17 20 #ifdef HAVE_NTL 18 21 #include "NTLconvert.h" 19 #include "canonicalform.h"20 #include "cf_defs.h"21 #include "cf_hnf.h"22 22 #include <NTL/mat_ZZ.h> 23 23 #include <NTL/HNF.h> 24 24 #include <NTL/LLL.h> 25 #endif 26 27 #ifdef HAVE_FLINT 28 #include "FLINTconvert.h" 29 #endif 25 30 26 31 /** … … 38 43 CFMatrix* cf_HNF(CFMatrix& A) 39 44 { 45 #ifdef HAVE_FLINT 46 fmpz_mat_t FLINTM; 47 convertFacCFMatrix2Fmpz_mat_t(FLINTM,A); 48 fmpz_mat_hnf(FLINTM,FLINTM); 49 CFMatrix *r=convertFmpz_mat_t2FacCFMatrix(FLINTM); 50 fmpz_mat_clear(FLINTM); 51 return r; 52 #elif defined(HAVE_NTL) 40 53 mat_ZZ *AA=convertFacCFMatrix2NTLmat_ZZ(A); 41 54 ZZ DD=convertFacCF2NTLZZ(determinant(A,A.rows())); … … 44 57 delete AA; 45 58 return convertNTLmat_ZZ2FacCFMatrix(WW); 59 #endif 46 60 } 47 61 48 62 CFMatrix* cf_LLL(CFMatrix& A) 49 63 { 64 #ifdef HAVE_FLINT 65 fmpz_mat_t FLINTM; 66 convertFacCFMatrix2Fmpz_mat_t(FLINTM,A); 67 fmpq_t delta,eta; 68 fmpq_init(delta); fmpq_set_si(delta,1,1); 69 fmpq_init(eta); fmpq_set_si(eta,3,4); 70 fmpz_mat_lll_storjohann(FLINTM,delta,eta); 71 CFMatrix *r=convertFmpz_mat_t2FacCFMatrix(FLINTM); 72 fmpz_mat_clear(FLINTM); 73 return r; 74 #elif defined(HAVE_NTL) 50 75 mat_ZZ *AA=convertFacCFMatrix2NTLmat_ZZ(A); 51 #if 052 LLL_RR(*AA);53 #else54 76 ZZ det2; 55 77 LLL(det2,*AA,0L); 56 #endif57 78 CFMatrix *r= convertNTLmat_ZZ2FacCFMatrix(*AA); 58 79 delete AA; 59 80 return r; 81 #endif 60 82 } 61 #endif -
factory/cf_hnf.h
rf3adf3 r4946e3 4 4 5 5 /*BEGINPUBLIC*/ 6 7 #ifdef HAVE_NTL8 6 9 7 /** … … 41 39 * the lattice. 42 40 * 43 * @note: uses NTL 41 * @note: uses NTL or FLINT 44 42 **/ 45 43 46 44 CFMatrix* cf_LLL(CFMatrix& A); 47 45 48 #endif49 50 46 /*ENDPUBLIC*/ 51 47 -
factory/facAbsBiFact.cc
rf3adf3 r4946e3 206 206 } 207 207 208 #ifdef HAVE_NTL 208 #ifdef HAVE_NTL // henselLiftAndEarly 209 209 //G is assumed to be bivariate, irreducible over Q, primitive wrt x and y, compressed 210 210 CFAFList absBiFactorizeMain (const CanonicalForm& G, bool full) … … 519 519 } 520 520 521 #ifdef HAVE_FLINT 522 fmpz_mat_t FLINTM; 523 convertFacCFMatrix2Fmpz_mat_t(FLINTM,*M); 524 fmpq_t delta,eta; 525 fmpq_init(delta); fmpq_set_si(delta,1,1); 526 fmpq_init(eta); fmpq_set_si(eta,3,4); 527 fmpz_mat_transpose(FLINTM,FLINTM); 528 fmpz_mat_lll_storjohann(FLINTM,delta,eta); 529 fmpz_mat_transpose(FLINTM,FLINTM); 530 delete M; 531 M=convertFmpz_mat_t2FacCFMatrix(FLINTM); 532 fmpz_mat_clear(FLINTM); 533 #elif defined(HAVE_NTL) 521 534 mat_ZZ * NTLM= convertFacCFMatrix2NTLmat_ZZ (*M); 522 535 … … 529 542 M= convertNTLmat_ZZ2FacCFMatrix (*NTLM); 530 543 delete NTLM; 544 #endif 531 545 532 546 mipo= 0; -
libpolys/polys/clapsing.cc
rf3adf3 r4946e3 1763 1763 } 1764 1764 1765 #if def HAVE_NTL /*define derived from factory*/1765 #if defined(HAVE_NTL) || defined(AHVE_FLINT) 1766 1766 matrix singntl_HNF(matrix m, const ring s ) 1767 1767 { … … 1917 1917 return mm; 1918 1918 } 1919 1919 #else 1920 matrix singntl_HNF(matrix m, const ring s ) 1921 { 1922 WerrorS("NTL/FLINT missing"); 1923 return NULL; 1924 } 1925 1926 intvec* singntl_HNF(intvec* m) 1927 { 1928 WerrorS("NTL/FLINT missing"); 1929 return NULL; 1930 } 1931 1932 matrix singntl_LLL(matrix m, const ring s ) 1933 { 1934 WerrorS("NTL/FLINT missing"); 1935 return NULL; 1936 } 1937 1938 intvec* singntl_LLL(intvec* m) 1939 { 1940 WerrorS("NTL/FLINT missing"); 1941 return NULL; 1942 } 1943 #endif 1944 1945 #ifdef HAVE_NTL 1920 1946 ideal singclap_absFactorize ( poly f, ideal & mipos, intvec ** exps, int & numFactors, const ring r) 1921 1947 { … … 1995 2021 1996 2022 #else 1997 matrix singntl_HNF(matrix m, const ring s)2023 ideal singclap_absFactorize ( poly f, ideal & mipos, intvec ** exps, int & numFactors, const ring r) 1998 2024 { 1999 2025 WerrorS("NTL missing"); … … 2001 2027 } 2002 2028 2003 intvec* singntl_HNF(intvec* m)2004 {2005 WerrorS("NTL missing");2006 return NULL;2007 }2008 2009 matrix singntl_LLL(matrix m, const ring s )2010 {2011 WerrorS("NTL missing");2012 return NULL;2013 }2014 2015 intvec* singntl_LLL(intvec* m)2016 {2017 WerrorS("NTL missing");2018 return NULL;2019 }2020 2021 ideal singclap_absFactorize ( poly f, ideal & mipos, intvec ** exps, int & numFactors, const ring r)2022 {2023 WerrorS("NTL missing");2024 return NULL;2025 }2026 2027 2029 #endif /* HAVE_NTL */ 2028 2030
Note: See TracChangeset
for help on using the changeset viewer.