Changeset f6237dd in git for factory/cfModResultant.cc
- Timestamp:
- Nov 12, 2012, 6:14:16 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 4f6d994465bf76173207af0e9c819e5b06dbc566
- Parents:
- 1e5c50f82763473c007a2714c91d4ac318709892
- git-author:
- Martin Lee <martinlee84@web.de>2012-11-12 18:14:16+01:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-11-16 13:22:07+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cfModResultant.cc
r1e5c50 rf6237dd 14 14 15 15 #include "cf_assert.h" 16 #include "timing.h" 16 17 17 18 #include "cfModResultant.h" … … 29 30 #include "FLINTconvert.h" 30 31 #endif 32 33 TIMING_DEFINE_PRINT(fac_resultant_p) 31 34 32 35 //TODO arrange by bound= deg (F,xlevel)*deg (G,i)+deg (G,xlevel)*deg (F, i) … … 327 330 return power (B, degAx); 328 331 332 if (A.isUnivariate() && B.isUnivariate() && A.level() == B.level()) 333 return uniResultant (A, B); 334 329 335 CanonicalForm F= A; 330 336 CanonicalForm G= B; … … 337 343 338 344 Variable y= Variable (2); 339 340 if (F.isUnivariate() && G.isUnivariate() && F.level() == G.level())341 return N(uniResultant (F, G));342 345 343 346 int i= -1; … … 363 366 if (H == modResult) 364 367 equalCount++; 368 else 369 equalCount= 0; 365 370 366 371 count++; … … 473 478 CanonicalForm resultModP, q (0), newResult, newQ; 474 479 CanonicalForm result; 480 int equalCount= 0; 481 CanonicalForm test, newTest; 482 int count= 0; 475 483 do 476 484 { … … 487 495 setCharacteristic (p); 488 496 497 TIMING_START (fac_resultant_p); 489 498 resultModP= resultantFp (mapinto (F), mapinto (G), X, prob); 499 TIMING_END_AND_PRINT (fac_resultant_p, "time to compute resultant mod p: "); 490 500 491 501 setCharacteristic (0); 492 502 503 count++; 493 504 if ( q.isZero() ) 494 505 { … … 501 512 q= newQ; 502 513 result= newResult; 503 if (newQ > bound) 504 { 505 result= symmetricRemainder (result, q); 514 test= symmetricRemainder (result,q); 515 if (test != newTest) 516 { 517 newTest= test; 518 equalCount= 0; 519 } 520 else 521 equalCount++; 522 if (newQ > bound || (prob && equalCount == 2)) 523 { 524 result= test; 506 525 break; 507 526 }
Note: See TracChangeset
for help on using the changeset viewer.