Changeset 57bd83 in git


Ignore:
Timestamp:
Mar 18, 2019, 12:38:54 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c854b9a4ef6bb168095febb6c5bb20cf579a7ff4
Parents:
4188f03ab0bc2bf245e4e875fb777183ee3802ce
Message:
add: fmpq_poly_t conversions
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/flintconv.cc

    r4188f03 r57bd83  
    9696}
    9797
     98void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
     99{
     100  int d=p_GetExp(p,1,r);
     101  fmpq_poly_init2(res,d+1);
     102  _fmpq_poly_set_length (res, d + 1);
     103  while(p!=NULL)
     104  {
     105    number n=pGetCoeff(p);
     106    fmpq_t c;
     107    convSingNFlintN(c,n);
     108    fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
     109    fmpq_clear(c);
     110    pIter(p);
     111  }
     112}
     113
     114poly convFlintPSingP(fmpq_poly_t f, const ring r)
     115{
     116  int d=fmpq_poly_length(f);
     117  poly p=NULL;
     118  for(int i=0; i<=d; i++)
     119  {
     120    fmpq_t c;
     121    fmpq_poly_get_coeff_fmpq(c,f,i);
     122    number n=convFlintNSingN(c);
     123    poly pp=p_Init(r);
     124    pSetCoeff0(pp,n);
     125    p_SetExp(pp,1,i,r);
     126    p_Setm(pp,r);
     127    p=p_Add_q(p,pp,r);
     128  }
     129  return p;
     130}
    98131
    99132bigintmat* singflint_LLL(bigintmat*  m, bigintmat* T)
  • libpolys/polys/flintconv.h

    r4188f03 r57bd83  
    3434#include <flint/fmpq.h>
    3535#include <flint/fmpz_poly.h>
     36#include <flint/fmpq_poly.h>
    3637#include <flint/fmpz_poly_mat.h>
    3738#include <flint/fmpz_lll.h>
     
    4546number convFlintNSingN (fmpz_t f);
    4647number convFlintNSingN (fmpq_t f);
     48void convSingPFlintP(fmpq_poly_t res, poly p, const ring r);
     49poly convFlintPSingP(fmpq_poly_t f, const ring r);
    4750
    4851bigintmat*  singflint_LLL(bigintmat* A, bigintmat* T);
Note: See TracChangeset for help on using the changeset viewer.