Changeset e73082 in git
- Timestamp:
- Jul 10, 2020, 10:59:54 AM (4 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 92ca340b57708a644bf8460eb08f23f4c5a25c1e
- Parents:
- 8ef929c017bd275741976e337ce6a61e6fec53d9
- Location:
- factory
- Files:
-
- 5 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
factory/Makefile.am
r8ef929 re73082 67 67 fac_berlekamp.cc \ 68 68 fac_cantzass.cc \ 69 fac_univar.cc \ 69 70 facFqBivar.cc \ 70 71 facFqBivarUtil.cc \ … … 86 87 int_poly.cc \ 87 88 int_rat.cc \ 89 int_pp.cc \ 88 90 variable.cc \ 89 91 NTLconvert.cc \ … … 149 151 fac_berlekamp.h \ 150 152 fac_cantzass.h \ 153 fac_univar.h \ 151 154 facFqBivar.h \ 152 155 facFqBivarUtil.h \ … … 168 171 int_poly.h \ 169 172 int_rat.h \ 173 int_pp.h \ 170 174 timing.h \ 171 175 variable.h \ -
factory/cf_char.cc
r8ef929 re73082 17 17 #include "cf_primes.h" 18 18 #include "cf_util.h" 19 #include "int_pp.h" 19 20 20 21 STATIC_VAR int theCharacteristic = 0; … … 43 44 } 44 45 46 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 47 void setCharacteristic( int c, int n ) 48 { 49 ASSERT( c > 1 && n > 0, "illegal characteristic" ); 50 setCharacteristic( c ); 51 InternalPrimePower::setPrimePower( c, n ); 52 CFFactory::settype( PrimePowerDomain ); 53 } 54 #endif 55 56 45 57 void setCharacteristic( int c, int n, char name ) 46 58 { -
factory/cf_defs.h
r8ef929 re73082 21 21 22 22 #define UndefinedDomain 32000 23 #define PrimePowerDomain 5 23 24 #define GaloisFieldDomain 4 24 25 #define FiniteFieldDomain 3 … … 49 50 static const int SW_BERLEKAMP=10; 50 51 52 static const int SW_FAC_QUADRATICLIFT=11; 51 53 /*ENDPUBLIC*/ 52 54 -
factory/cf_factor.cc
r8ef929 re73082 33 33 #include "fac_berlekamp.h" 34 34 #include "fac_cantzass.h" 35 #include "fac_univar.h" 35 36 36 37 #include "int_int.h" … … 504 505 #endif 505 506 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 506 // Use Factory without NTL 507 { // Use Factory without NTL507 // Use Factory without NTL: char p, univariate 508 { 508 509 if ( isOn( SW_BERLEKAMP ) ) 509 510 F=FpFactorizeUnivariateB( f, issqrfree ); … … 601 602 goto end_char0; 602 603 #else 603 factoryError ("univariate factorization over Z depends on NTL/FLINT(missing)"); 604 return CFFList (CFFactor (f, 1)); 604 { 605 //Use Factory without NTL: char 0, univariate 606 F = ZFactorizeUnivariate( fz, issqrfree ); 607 goto end_char0; 608 } 605 609 #endif 606 610 } -
factory/cf_switches.h
r8ef929 re73082 20 20 * 21 21 **/ 22 const int CFSwitchesMax = 1 1;22 const int CFSwitchesMax = 12; 23 23 24 24 /** class CFSwitches -
factory/fac_univar.cc
r8ef929 re73082 18 18 #include "cf_primes.h" 19 19 #include "fac_sqrfree.h" 20 20 #include "cfUnivarGcd.h" 21 22 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 21 23 TIMING_DEFINE_PRINT(fac_choosePrimes) 22 24 TIMING_DEFINE_PRINT(fac_facModPrimes) … … 215 217 } 216 218 219 bool isSqrFreeZ ( const CanonicalForm & f ) 220 { 221 return gcd( f, f.deriv() ).degree() == 0; 222 } 223 224 bool isSqrFreeFp( const CanonicalForm & f ) 225 { 226 CFFList F = sqrFreeFp( f ); 227 return ( F.length() == 1 && F.getFirst().exp() == 1 ); 228 } 229 230 bool isSqrFree ( const CanonicalForm & f ) 231 { 232 // ASSERT( f.isUnivariate(), "multivariate factorization not implemented" ); 233 if ( getCharacteristic() == 0 ) 234 return isSqrFreeZ( f ); 235 else 236 return isSqrFreeFp( f ); 237 } 238 217 239 218 240 static int choosePrimes ( int * p, const CanonicalForm & f ) … … 249 271 int i, j, save; 250 272 int p = pk.getp(), k = pk.getk(); 251 int no_iter = (int)(log( (double)k )/log(2.0)+2);273 int no_iter = SI_LOG2(k)+2; 252 274 int * kvals = new int[no_iter]; 253 275 … … 278 300 { 279 301 j--; 280 setCharacteristic( p, kvals[j+1] 302 setCharacteristic( p, kvals[j+1]); 281 303 DEBOUTLN( cerr, "lifting from p^" << kvals[j+1] << " to p^" << kvals[j] ); 282 304 c = mapinto( c ); … … 542 564 return ZF; 543 565 } 566 #endif -
factory/int_pp.cc
r8ef929 re73082 13 13 #include "imm.h" 14 14 15 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 15 16 mpz_t InternalPrimePower::primepow; 16 17 mpz_t InternalPrimePower::primepowhalf; … … 408 409 } 409 410 //}}} 411 #endif
Note: See TracChangeset
for help on using the changeset viewer.