Changeset c3c832 in git


Ignore:
Timestamp:
Sep 30, 2021, 11:50:24 AM (2 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
348ae69282271d1294a9b41bd9c15b897966c0ce
Parents:
4dc97bfcb251c1bcfa5ad66d1a61c6a41e7f0c86
Message:
gcd over Z via flint
Location:
libpolys/polys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/clapsing.cc

    r4dc97b rc3c832  
    7878      poly res=Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r);
    7979      res=p_Cleardenom(res,r);
     80      return res;
     81    }
     82  }
     83  else
     84  if (rField_is_Z(r))
     85  {
     86    fmpz_mpoly_ctx_t ctx;
     87    if (!convSingRFlintR(ctx,r))
     88    {
     89      // leading coef. positive, all coeffs in Z
     90      poly res=Flint_GCD_MP(f,pLength(f),g,pLength(g),ctx,r);
    8091      return res;
    8192    }
  • libpolys/polys/flint_mpoly.cc

    r4dc97b rc3c832  
    389389}
    390390
     391poly Flint_GCD_MP(poly p,int lp,poly q,int lq,fmpz_mpoly_ctx_t ctx,const ring r)
     392{
     393  fmpz_mpoly_t pp,qq,res;
     394  convSingPFlintMP(pp,ctx,p,lp,r);
     395  convSingPFlintMP(qq,ctx,q,lq,r);
     396  fmpz_mpoly_init(res,ctx);
     397  int ok=fmpz_mpoly_gcd(res,pp,qq,ctx);
     398  poly pres;
     399  if (ok)
     400  {
     401    // Singular wants a gcd defined over ZZ that is primitive and has a positive leading coeff.
     402    pres=convFlintMPSingP(res,ctx,r);
     403    p_Test(pres,r);
     404  }
     405  else
     406  {
     407    pres=p_One(r);
     408  }
     409  fmpz_mpoly_clear(res,ctx);
     410  fmpz_mpoly_clear(pp,ctx);
     411  fmpz_mpoly_clear(qq,ctx);
     412  fmpz_mpoly_ctx_clear(ctx);
     413  return pres;
     414}
     415
    391416#endif
    392417#endif
  • libpolys/polys/flint_mpoly.h

    r4dc97b rc3c832  
    3737poly Flint_GCD_MP(poly p,int lp,poly q,int lq,fmpq_mpoly_ctx_t ctx,const ring r);
    3838poly Flint_GCD_MP(poly p,int lp,poly q,int lq,nmod_mpoly_ctx_t ctx,const ring r);
     39poly Flint_GCD_MP(poly p,int lp,poly q,int lq,fmpz_mpoly_ctx_t ctx,const ring r);
    3940
    4041#endif
Note: See TracChangeset for help on using the changeset viewer.