Changeset 5f92d8 in git for factory/facBivar.cc
 Timestamp:
 Mar 6, 2012, 12:03:45 PM (12 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 4a0a30398a875d80f01a41e504fcf8ad0cfd7541
 Parents:
 4e6d2aac480d2946ef572d24bd5dd72906cf1e57
 gitauthor:
 Martin Lee <martinlee84@web.de>20120306 12:03:45+01:00
 gitcommitter:
 Martin Lee <martinlee84@web.de>20120404 14:42:26+02:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/facBivar.cc
r4e6d2a r5f92d8 30 30 TIMING_DEFINE_PRINT(hensel_lift12) 31 31 32 static modpk 32 // bound on coeffs of f (cf. Musser: Multivariate Polynomial Factorization, 33 // Gelfond: Transcendental and Algebraic Numbers) 34 modpk 33 35 coeffBound ( const CanonicalForm & f, int p ) 34 36 { 35 37 int * degs = degrees( f ); 36 38 int M = 0, i, k = f.level(); 39 CanonicalForm b= 1; 37 40 for ( i = 1; i <= k; i++ ) 38 M += degs[i]; 39 CanonicalForm b = 2 * maxNorm( f ) * power( CanonicalForm( 3 ), M ); 41 { 42 M += degs[i]; 43 b *= degs[i] + 1; 44 } 45 b /= power (CanonicalForm (2), k); 46 b= b.sqrt() + 1; 47 b *= 2 * maxNorm( f ) * power( CanonicalForm( 2 ), M ); 40 48 CanonicalForm B = p; 41 49 k = 1; … … 47 55 } 48 56 49 static 50 void find_good_prime(const CanonicalForm &f, int &start) 57 void findGoodPrime(const CanonicalForm &f, int &start) 51 58 { 52 59 if (! f.inBaseDomain() ) … … 57 64 if ( i.hasTerms() ) 58 65 { 59 find _good_prime(i.coeff(),start);66 findGoodPrime(i.coeff(),start); 60 67 if (0==cf_getBigPrime(start)) return; 61 68 if((i.exp()!=0) && ((i.exp() % cf_getBigPrime(start))==0)) … … 81 88 } 82 89 } 90 } 91 92 modpk 93 coeffBound ( const CanonicalForm & f, int p, const CanonicalForm& mipo ) 94 { 95 int * degs = degrees( f ); 96 int M = 0, i, k = f.level(); 97 CanonicalForm K= 1; 98 for ( i = 1; i <= k; i++ ) 99 { 100 M += degs[i]; 101 K *= degs[i] + 1; 102 } 103 K /= power (CanonicalForm (2), k); 104 K= K.sqrt()+1; 105 K *= power (CanonicalForm (2), M); 106 int N= degree (mipo); 107 CanonicalForm b; 108 b= 2*power (maxNorm (f), N)*power (maxNorm (mipo), 4*N)*K*power (CanonicalForm (2), N)*(CanonicalForm (M+1).sqrt()+1)*power (CanonicalForm (N+1).sqrt()+1, 7*N); 109 b /= power (abs (lc (mipo)), N); 110 111 ZZX NTLmipo= convertFacCF2NTLZZX (mipo); 112 ZZX NTLLcf= convertFacCF2NTLZZX (Lc (f)); 113 ZZ NTLf= resultant (NTLmipo, NTLLcf); 114 ZZ NTLD= discriminant (NTLmipo); 115 b /= abs (convertZZ2CF (NTLf))*abs (convertZZ2CF (NTLD)); 116 117 CanonicalForm B = p; 118 k = 1; 119 while ( B < b ) { 120 B *= p; 121 k++; 122 } 123 return modpk( p, k ); 83 124 } 84 125 … … 591 632 Off (SW_RATIONAL); 592 633 int i= 0; 593 find _good_prime(F,i);594 find _good_prime(Aeval,i);595 find _good_prime(A,i);634 findGoodPrime(F,i); 635 findGoodPrime(Aeval,i); 636 findGoodPrime(A,i); 596 637 if (i >= cf_getNumBigPrimes()) 597 638 printf ("out of primes\n"); //TODO exit
Note: See TracChangeset
for help on using the changeset viewer.