Changeset 8d8fef in git for libpolys/polys/clapsing.cc
- Timestamp:
- Jul 29, 2019, 11:36:09 PM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- feed60bef09898f675e0f8605ed0ac0eaa8bed5a
- Parents:
- da1ec3de158a4f05384b9a83be86fc4c1942ec5fc1b9ababa50e8059dd847da0957f50aea901e6a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/clapsing.cc
rda1ec3 r8d8fef 20 20 #include "monomials/ring.h" 21 21 #include "simpleideals.h" 22 #include "polys/flintconv.h" 23 #include "polys/flint_mpoly.h" 22 24 23 25 … … 55 57 return p_GcdMon(g,f,r); 56 58 } 57 59 #ifdef HAVE_FLINT 60 #if __FLINT_RELEASE >= 20503 61 if (rField_is_Zp(r) && (r->cf->ch>500)) 62 { 63 nmod_mpoly_ctx_t ctx; 64 if (!convSingRFlintR(ctx,r)) 65 { 66 // leading coef. 1 67 return Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r); 68 } 69 } 70 else 71 if (rField_is_Q(r)) 72 { 73 fmpq_mpoly_ctx_t ctx; 74 if (!convSingRFlintR(ctx,r)) 75 { 76 // leading coef. positive, all coeffs in Z 77 poly res=Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r); 78 res=p_Cleardenom(res,r); 79 return res; 80 } 81 } 82 #endif 83 #endif 58 84 Off(SW_RATIONAL); 59 85 if (rField_is_Q(r) || rField_is_Zp(r) || rField_is_Z(r) … … 63 89 CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g, r ) ); 64 90 res=convFactoryPSingP( gcd( F, G ) , r); 91 if ( rField_is_Zp(r)) 92 p_Norm(res,r); // leading coef. 1 93 else if (rField_is_Q(r) && (!n_GreaterZero(pGetCoeff(res),r->cf))) 94 res = p_Neg(res,r); // leading coef. positive, all coeffs in Z 65 95 } 66 96 // and over Q(a) / Fp(a) … … 81 111 prune (a); 82 112 if (!b1) Off(SW_USE_QGCD); 113 if ( rField_is_Zp_a(r)) p_Norm(res,r); // leading coef. 1 83 114 } 84 115 else … … 559 590 { 560 591 poly res=NULL; 592 593 #ifdef HAVE_FLINT 594 #if __FLINT_RELEASE >= 20503 595 /* 596 If the division is not exact, control will pass to factory where the 597 polynomials can be divided using the ordering that factory chooses. 598 */ 599 if (rField_is_Zp(r)) 600 { 601 nmod_mpoly_ctx_t ctx; 602 if (!convSingRFlintR(ctx,r)) 603 { 604 res = Flint_Divide_MP(f,pLength(f),g,pLength(g),ctx,r); 605 if (res != NULL) 606 return res; 607 } 608 } 609 else 610 if (rField_is_Q(r)) 611 { 612 fmpq_mpoly_ctx_t ctx; 613 if (!convSingRFlintR(ctx,r)) 614 { 615 res = Flint_Divide_MP(f,pLength(f),g,pLength(g),ctx,r); 616 if (res != NULL) 617 return res; 618 } 619 } 620 #endif 621 #endif 622 561 623 On(SW_RATIONAL); 562 624 if (rField_is_Zp(r) || rField_is_Q(r)
Note: See TracChangeset
for help on using the changeset viewer.