Changeset c1b52b in git
- Timestamp:
- Jul 9, 2020, 4:54:28 PM (3 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 22f43fd13906a985efeddb80031ed3478830660e412d19ec6555b98b2f553cc1ea8cf1b7115c830e
- Parents:
- afa77551770f2019ad99556a95d1327e8a25c616
- Location:
- factory
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/Makefile.am
rafa7755 rc1b52b 65 65 fac_sqrfree.cc \ 66 66 fac_util.cc \ 67 fac_berlekamp.cc \ 68 fac_cantzass.cc \ 67 69 facFqBivar.cc \ 68 70 facFqBivarUtil.cc \ … … 145 147 fac_sqrfree.h \ 146 148 fac_util.h \ 149 fac_berlekamp.h \ 150 fac_cantzass.h \ 147 151 facFqBivar.h \ 148 152 facFqBivarUtil.h \ -
factory/cf_defs.h
rafa7755 rc1b52b 46 46 /// set to 1 to use Flints gcd over Q/Z 47 47 static const int SW_USE_FL_GCD_0=9; 48 /// set to 1 to use Factorys Berlekamp alg. 49 static const int SW_BERLEKAMP=10; 48 50 49 51 /*ENDPUBLIC*/ -
factory/cf_factor.cc
rafa7755 rc1b52b 31 31 #include "singext.h" 32 32 #include "cf_util.h" 33 #include "fac_berlekamp.h" 34 #include "fac_cantzass.h" 33 35 34 36 #include "int_int.h" … … 439 441 #endif 440 442 { 441 // use FLINT 443 // use FLINT: char p, univariate 442 444 nmod_poly_t f1; 443 445 convertFacCF2nmod_poly_t (f1, f); … … 453 455 #endif 454 456 #ifdef HAVE_NTL 455 { 457 { // NTL char 2, univariate 456 458 if (getCharacteristic()==2) 457 459 { … … 478 480 #ifdef HAVE_NTL 479 481 { 480 // use NTL 482 // use NTL char p, univariate 481 483 if (fac_NTL_char != getCharacteristic()) 482 484 { … … 503 505 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 504 506 // Use Factory without NTL 505 factoryError ("univariate factorization depends on FLINT/NTL(missing)"); 506 return CFFList (CFFactor (f, 1)); 507 { // Use Factory without NTL 508 if ( isOn( SW_BERLEKAMP ) ) 509 F=FpFactorizeUnivariateB( f, issqrfree ); 510 else 511 F=FpFactorizeUnivariateCZ( f, issqrfree, 0, Variable(), Variable() ); 512 return F; 513 } 507 514 #endif 508 515 } -
factory/cf_switches.h
rafa7755 rc1b52b 20 20 * 21 21 **/ 22 const int CFSwitchesMax = 1 0;22 const int CFSwitchesMax = 11; 23 23 24 24 /** class CFSwitches -
factory/fac_sqrfree.cc
rafa7755 rc1b52b 150 150 } 151 151 152 #if !defined(HAVE_NTL) && !defined(HAVE_FLINT) 153 static int divexp = 1; 154 155 static void divexpfunc ( CanonicalForm &, int & e ) 156 { 157 e /= divexp; 158 } 159 160 CFFList sqrFreeFp ( const CanonicalForm & f ) 161 { 162 CanonicalForm t0 = f, t, v, w, h; 163 CanonicalForm leadcf = t0.lc(); 164 Variable x = f.mvar(); 165 CFFList F; 166 int p = getCharacteristic(); 167 int k, e = 1; 168 169 if ( ! leadcf.isOne() ) 170 t0 /= leadcf; 171 172 divexp = p; 173 while ( t0.degree(x) > 0 ) 174 { 175 t = gcd( t0, t0.deriv() ); 176 v = t0 / t; 177 k = 0; 178 while ( v.degree(x) > 0 ) 179 { 180 k = k+1; 181 if ( k % p == 0 ) 182 { 183 t /= v; 184 k = k+1; 185 } 186 w = gcd( t, v ); 187 h = v / w; 188 v = w; 189 t /= v; 190 if ( h.degree(x) > 0 ) 191 F.append( CFFactor( h/h.lc(), e*k ) ); 192 } 193 t0 = apply( t, divexpfunc ); 194 e = p * e; 195 } 196 if ( ! leadcf.isOne() ) 197 { 198 if ( !F.isEmpty() && (F.getFirst().exp() == 1) ) 199 { 200 leadcf = F.getFirst().factor() * leadcf; 201 F.removeFirst(); 202 } 203 F.insert( CFFactor( leadcf, 1 ) ); 204 } 205 return F; 206 } 207 #endif -
factory/fac_sqrfree.h
rafa7755 rc1b52b 22 22 ); 23 23 24 CFFList sqrFreeFp ( const CanonicalForm & f ); 24 25 #endif /* ! INCL_FAC_SQRFREE_H */
Note: See TracChangeset
for help on using the changeset viewer.