Changeset dc89d7 in git


Ignore:
Timestamp:
Mar 27, 2019, 1:36:45 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
3f34dc89054e843e5e05cc00a73dba2270ad5886
Parents:
a0351f4ddb55f888234786beb265c2d73504e810
Message:
fix: FLINT >2.5.2
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/flintconv.cc

    ra0351f4 rdc89d7  
    5555number convFlintNSingN (fmpq_t f, const coeffs cf)
    5656{
     57#if __FLINT_RELEASE > 20502
    5758  number z;
    5859  if (nCoeff_is_Q(cf))
     
    7778    n_Delete(&na,cf);
    7879    n_Delete(&nb,cf);
     80    mpz_clear(a);
     81    mpz_clear(b);
    7982  }
    8083  n_Normalize(z,cf);
    8184  return z;
     85#else
     86  WerrorS("not implemented");
     87  return NULL;
     88#endif
    8289}
    8390
     
    128135}
    129136
     137void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
     138{
     139  number n_2=n_RePart(n,cf);
     140  convSingNFlintN(re,n_2,cf);
     141  n_Delete(&n_2,cf);
     142  n_2=n_ImPart(n,cf);
     143  convSingNFlintN(im,n_2,cf);
     144  n_Delete(&n_2,cf);
     145}
     146
    130147void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
    131148{
     
    140157    fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
    141158    fmpq_clear(c);
     159    pIter(p);
     160  }
     161}
     162
     163void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
     164{
     165  int d=p_GetExp(p,1,r);
     166  fmpq_poly_init2(res,d+1);
     167  _fmpq_poly_set_length (res, d + 1);
     168  while(p!=NULL)
     169  {
     170    number n=n_ImPart(pGetCoeff(p),r->cf);
     171    fmpq_t c;
     172    convSingNFlintN(c,n,r->cf);
     173    fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
     174    fmpq_clear(c);
     175    n_Delete(&n,r->cf);
    142176    pIter(p);
    143177  }
  • libpolys/polys/flintconv.h

    ra0351f4 rdc89d7  
    4444void convSingNFlintN(fmpz_t f, number n);
    4545void convSingNFlintN(fmpq_t f, number n, const coeffs cf);
     46void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf);
    4647number convFlintNSingN (fmpz_t f);
    4748number convFlintNSingN (fmpq_t f, const coeffs cf);
    4849void convSingPFlintP(fmpq_poly_t res, poly p, const ring r);
     50void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r);
    4951poly convFlintPSingP(fmpq_poly_t f, const ring r);
    5052
Note: See TracChangeset for help on using the changeset viewer.