Changeset 4946e3 in git for factory/cf_hnf.cc
- Timestamp:
- Jul 3, 2020, 1:03:03 PM (3 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 175dfbe8022a34e8c7eab0e37ca15b932dbcb243
- Parents:
- f3adf3a165dd0f173fe615a55624a41ff34bdddb
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.