Changeset 4abcd2 in git
- Timestamp:
- Jun 29, 2019, 3:08:10 PM (5 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- 03bb93fba98bf9a4940362065c868e03f40d30490c8bd5e3c25fc9eee3515f8acf944ee5ebe1696b38f64f390d4436be348da6ef47e2af0b9b28e73bd9ee4473fdf11f08fe02b858ed26cfb2acacddb7
- Parents:
- 6fe48efa5355b153c6b4c1888a39b03726d3ca4c
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-06-29 15:08:10+02:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-06-29 15:08:45+02:00
- Location:
- libpolys/polys
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/clapsing.cc
r6fe48e r4abcd2 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)) 62 { 63 nmod_mpoly_ctx_t ctx; 64 if (!convSingRFlintR(ctx,r)) 65 { 66 return Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r); 67 } 68 } 69 else if (rField_is_Q(r)) 70 { 71 fmpq_mpoly_ctx_t ctx; 72 if (!convSingRFlintR(ctx,r)) 73 { 74 // printf("FlintQ\n"); 75 poly res=Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r); 76 res=p_Cleardenom(res,r); 77 } 78 } 79 #endif 80 #endif 58 81 Off(SW_RATIONAL); 59 82 if (rField_is_Q(r) || rField_is_Zp(r) || rField_is_Z(r) … … 63 86 CanonicalForm F( convSingPFactoryP( f,r ) ), G( convSingPFactoryP( g, r ) ); 64 87 res=convFactoryPSingP( gcd( F, G ) , r); 65 if ( rField_is_Zp(r)) p_Norm(res,r);88 if ( rField_is_Zp(r)) p_Norm(res,r); 66 89 } 67 90 // and over Q(a) / Fp(a) -
libpolys/polys/flint_mpoly.cc
r6fe48e r4abcd2 195 195 return pres; 196 196 } 197 poly Flint_GCD_MP(poly p,int lp,poly q,int lq,nmod_mpoly_ctx_t ctx,const ring r) 198 { 199 nmod_mpoly_t pp,qq,res; 200 convSingPFlintMP(pp,ctx,p,lp,r); 201 convSingPFlintMP(qq,ctx,q,lq,r); 202 int bits=SI_LOG2(r->bitmask); 203 nmod_mpoly_init3(res,lp*lq,bits,ctx); 204 int ok=nmod_mpoly_gcd(res,pp,qq,ctx); 205 poly pres; 206 if (ok) 207 { 208 pres=convFlintMPSingP(res,ctx,r); 209 p_Test(pres,r); 210 } 211 else 212 { 213 pres=p_One(r); 214 } 215 nmod_mpoly_clear(res,ctx); 216 nmod_mpoly_clear(pp,ctx); 217 nmod_mpoly_clear(qq,ctx); 218 nmod_mpoly_ctx_clear(ctx); 219 return pres; 220 } 221 222 poly Flint_GCD_MP(poly p,int lp,poly q,int lq,fmpq_mpoly_ctx_t ctx,const ring r) 223 { 224 fmpq_mpoly_t pp,qq,res; 225 convSingPFlintMP(pp,ctx,p,lp,r); 226 convSingPFlintMP(qq,ctx,q,lq,r); 227 int bits=SI_LOG2(r->bitmask); 228 fmpq_mpoly_init3(res,lp*lq,bits,ctx); 229 int ok=fmpq_mpoly_gcd(res,pp,qq,ctx); 230 poly pres; 231 if (ok) 232 { 233 pres=convFlintMPSingP(res,ctx,r); 234 p_Test(pres,r); 235 } 236 else 237 { 238 pres=p_One(r); 239 } 240 fmpq_mpoly_clear(res,ctx); 241 fmpq_mpoly_clear(pp,ctx); 242 fmpq_mpoly_clear(qq,ctx); 243 fmpq_mpoly_ctx_clear(ctx); 244 return pres; 245 } 197 246 #endif 198 247 #endif -
libpolys/polys/flint_mpoly.h
r6fe48e r4abcd2 13 13 14 14 #if __FLINT_RELEASE >= 20503 15 #include <flint/fmpz.h>16 15 #include <flint/fmpq.h> 17 #include <flint/fmpz_poly.h>18 16 #include <flint/fmpq_poly.h> 19 17 #include <flint/fmpq_mpoly.h> … … 27 25 poly convFlintMPSingP(nmod_mpoly_t p, nmod_mpoly_ctx_t ctx, const ring r); 28 26 poly Flint_Mult_MP(poly p,int lp,poly q,int lq,nmod_mpoly_ctx_t ctx, const ring r); 27 poly Flint_GCD_MP(poly p,int lp,poly q,int lq,nmod_mpoly_ctx_t ctx,const ring r); 28 poly Flint_GCD_MP(poly p,int lp,poly q,int lq,fmpq_mpoly_ctx_t ctx,const ring r); 29 29 #endif 30 30 #endif
Note: See TracChangeset
for help on using the changeset viewer.