Changeset 865b20 in git
- Timestamp:
- Aug 15, 2012, 7:55:06 PM (11 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 0beffdffc2fb65355384c180d0a9d06b7b0312cf
- Parents:
- 6caad65fe9bcc8eacbc315b1b090770683668e8e
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-08-15 19:55:06+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-08-15 19:59:03+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/ext_fields/algext.cc
r6caad65 r865b20 394 394 if (a == NULL) return NULL; 395 395 poly bInverse = (poly)naInvers(b, cf); 396 poly aDivB = p_Mult_q(p_Copy((poly)a, naRing), bInverse, naRing); 397 definiteReduce(aDivB, naMinpoly, cf); 398 return (number)aDivB; 396 if(bInverse != NULL) // b is non-zero divisor! 397 { 398 poly aDivB = p_Mult_q(p_Copy((poly)a, naRing), bInverse, naRing); 399 definiteReduce(aDivB, naMinpoly, cf); 400 return (number)aDivB; 401 } 402 return NULL; 399 403 } 400 404 … … 655 659 naTest(a); 656 660 if (a == NULL) WerrorS(nDivBy0); 661 657 662 poly aFactor = NULL; poly mFactor = NULL; 658 663 poly theGcd = p_ExtGcd((poly)a, aFactor, naMinpoly, mFactor, naRing); 664 659 665 naTest((number)theGcd); naTest((number)aFactor); naTest((number)mFactor); 660 /* the gcd must be 1 since naMinpoly is irreducible and a != NULL: */ 661 assume(naIsOne((number)theGcd, cf)); 666 p_Delete(&mFactor, naRing); 667 668 // /* the gcd must be 1 since naMinpoly is irreducible and a != NULL: */ 669 // assume(naIsOne((number)theGcd, cf)); 670 671 if( !naIsOne((number)theGcd, cf) ) 672 { 673 WerrorS("zero divisor found - your minpoly is not irreducible"); 674 p_Delete(&aFactor, naRing); aFactor = NULL; 675 } 662 676 p_Delete(&theGcd, naRing); 663 p_Delete(&mFactor, naRing); 677 664 678 return (number)(aFactor); 665 679 }
Note: See TracChangeset
for help on using the changeset viewer.