Changeset df497a in git
- Timestamp:
- Feb 17, 2006, 12:28:43 PM (18 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- e4e1c2a662f1cc939b50e44a501ff016ef4d1e16
- Parents:
- ad6ad248b17525d3c24a305a72c5bc48027f3a32
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_gcd.cc
rad6ad2 rdf497a 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_gcd.cc,v 1.3 8 2006-02-01 09:37:07 pohlExp $ */2 /* $Id: cf_gcd.cc,v 1.39 2006-02-17 11:28:43 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 44 44 lcg = LC( g, Variable(1) ); 45 45 } 46 while ( ( e( lcf ).isZero() || e( lcg ).isZero() ) && count < 100 ) { 46 #define TEST_ONE_MAX 50 47 while ( ( e( lcf ).isZero() || e( lcg ).isZero() ) && count < TEST_ONE_MAX ) 48 { 47 49 e.nextpoint(); 48 50 count++; 49 51 } 50 if ( count == 100)52 if ( count == TEST_ONE_MAX ) 51 53 return false; 52 54 CanonicalForm F, G; … … 357 359 gcd_poly1( const CanonicalForm & f, const CanonicalForm & g, bool modularflag ) 358 360 { 359 CanonicalForm C, Ci, Ci1, Hi, bi, pi, pi1, pi2; 361 CanonicalForm pi, pi1; 362 Variable v = f.mvar(); 363 364 if ( f.degree( v ) >= g.degree( v ) ) 365 { 366 pi = f; pi1 = g; 367 } 368 else 369 { 370 pi = g; pi1 = f; 371 } 372 CanonicalForm C, Ci, Ci1, Hi, bi, pi2; 360 373 int delta; 361 Variable v = f.mvar();362 363 if ( f.degree( v ) >= g.degree( v ) ) {364 pi = f; pi1 = g;365 }366 else {367 pi = g; pi1 = f;368 }369 374 Ci = content( pi ); Ci1 = content( pi1 ); 375 pi1 = pi1 / Ci1; pi = pi / Ci; 370 376 C = gcd( Ci, Ci1 ); 371 pi1 = pi1 / Ci1; pi = pi / Ci;372 377 if ( pi.isUnivariate() && pi1.isUnivariate() ) 373 378 { 374 379 #ifdef HAVE_NTL 375 if ((isOn(SW_USE_NTL_GCD_P)||isOn(SW_USE_NTL_GCD_0)) 376 && isPurePoly(pi) && isPurePoly(pi1)) 377 return gcd_poly_univar0(f, g, true); 378 #endif 380 if (( modularflag) || 381 ((isOn(SW_USE_NTL_GCD_P)||isOn(SW_USE_NTL_GCD_0)) 382 && isPurePoly(pi) && isPurePoly(pi1))) 383 return gcd_poly_univar0(pi, pi1, true) * C; 384 #else 379 385 if ( modularflag) 380 386 return gcd_poly_univar0( pi, pi1, true ) * C; 387 #endif 381 388 } 382 389 else if ( gcd_test_one( pi1, pi, true ) ) … … 403 410 if ( degree( pi1, v ) == 0 ) 404 411 return C; 405 else {412 else 406 413 return C * pp( pi ); 407 }408 414 } 409 415
Note: See TracChangeset
for help on using the changeset viewer.