Changeset 273a2f in git for libpolys


Ignore:
Timestamp:
Dec 2, 2021, 3:56:49 PM (2 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
Children:
18bb792edcc6d3f65af0111f93ed61118123ffd1
Parents:
c31a71c38969321615ad9607978783ca23b0edbb
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2021-12-02 15:56:49+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2021-12-02 15:59:38+01:00
Message:
experimental: fq_nmod_mat_rref
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/flintconv.cc

    rc31a71 r273a2f  
    1414#ifdef HAVE_FLINT
    1515#if __FLINT_RELEASE >= 20500
     16
    1617#include "coeffs/coeffs.h"
    1718#include "coeffs/longrat.h"
     
    281282}
    282283
     284void convSingPFlintnmod_poly_t(nmod_poly_t result, const poly p, const ring r)
     285{
     286  // assume univariate
     287  nmod_poly_init2 (result,rChar(r),p_Deg(p,r));
     288  poly h=p;
     289  while(h!=NULL)
     290  {
     291    nmod_poly_set_coeff_ui(result,p_GetExp(h,1,r),n_Int(pGetCoeff(h),r->cf));
     292    pIter(h);
     293  }
     294}
     295
     296void convSingMFlintFq_nmod_mat(matrix m, fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const ring r)
     297{
     298  fq_nmod_mat_init (M, (long)MATROWS(m), (long) MATCOLS(m), fq_con);
     299  int i,j;
     300  for(i=MATROWS(m);i>0;i--)
     301  {
     302    for(j=MATCOLS(m);j>0;j--)
     303    {
     304      convSingPFlintnmod_poly_t (M->rows[i-1]+j-1, MATELEM(m,i,j),r);
     305    }
     306  }
     307}
     308
     309poly convFlintFq_nmodSingP(const fq_nmod_t Fp, const fq_nmod_ctx_t ctx, const ring r)
     310{
     311  poly p=NULL;
     312  poly h;
     313  for (int i= 0; i < nmod_poly_length (Fp); i++)
     314  {
     315    ulong coeff= nmod_poly_get_coeff_ui (Fp, i);
     316    if (coeff != 0)
     317    h=p_NSet(n_Init(coeff,r->cf),r);
     318    p_SetExp(h,1,i,r);
     319    p_Setm(h,r);
     320    p=p_Add_q(p,h,r);
     321  }
     322  return p;
     323}
     324
     325matrix convFlintFq_nmod_matSingM(fq_nmod_mat_t m, const fq_nmod_ctx_t fq_con, const ring r)
     326{
     327  matrix M=mpNew(fq_nmod_mat_nrows (m, fq_con),fq_nmod_mat_ncols (m, fq_con));
     328   int i,j;
     329  for(i=MATROWS(M);i>0;i--)
     330  {
     331    for(j=MATCOLS(M);j>0;j--)
     332    {
     333      MATELEM(M,i,j)=convFlintFq_nmodSingP(fq_nmod_mat_entry (m, i-1, j-1),
     334                                          fq_con, r);
     335    }
     336  }
     337  return M;
     338}
     339
    283340bigintmat* singflint_LLL(bigintmat*  m, bigintmat* T)
    284341{
  • libpolys/polys/flintconv.h

    rc31a71 r273a2f  
    3737#if __FLINT_RELEASE >= 20500
    3838#include <flint/fmpz_lll.h>
     39#include <flint/fq.h>
     40#include <flint/fq_poly.h>
     41#include <flint/fq_nmod.h>
     42#include <flint/fq_nmod_poly.h>
     43#include <flint/fq_nmod_mat.h>
    3944#endif
    4045
     
    5762bigintmat*  singflint_LLL(bigintmat* A, bigintmat* T);
    5863intvec* singflint_LLL(intvec* A, intvec* T);
     64
     65#if __FLINT_RELEASE >= 20500
     66void convSingPFlintnmod_poly_t(nmod_poly_t result, const poly p, const ring r);
     67void convSingMFlintFq_nmod_mat(matrix m, fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const ring r);
     68poly convFlintFq_nmodSingP(const fq_nmod_t Fp, const fq_nmod_ctx_t ctx, const ring r);
     69matrix convFlintFq_nmod_matSingM(fq_nmod_mat_t m, const fq_nmod_ctx_t fq_con, const ring r);
     70#endif
    5971#endif
    6072#endif
Note: See TracChangeset for help on using the changeset viewer.