#include "config.h"
#include "cf_assert.h"
#include "debug.h"
#include "canonicalform.h"
#include "cf_util.h"
#include "imm.h"
#include "cf_iter.h"
#include "NTLconvert.h"
#include "FLINTconvert.h"
#include "cf_roots.h"
Go to the source code of this file.
◆ Zp_roots()
Definition at line 25 of file cf_roots.cc.
28 #if defined(HAVE_FLINT) && (__FLINT_RELEASE >= 20503)
31 nmod_poly_factor_t fac;
32 nmod_poly_factor_init(fac);
33 nmod_poly_roots(fac,FLINT_f,0);
37 for(
int i=fac->num-1;
i>=0;
i--)
40 if (nmod_poly_length(fac->p+
i)==2)
42 res[
j]=
p-nmod_poly_get_coeff_ui(fac->p+
i,0);
49 nmod_poly_factor_clear(fac);
51 #elif defined(HAVE_NTL)
58 vec_zz_p roots= FindRoots (NTL_f);
60 res[0]=roots.length();
61 for(
int i=roots.length()-1;
i>=0;
i--)
63 res[
i+1]=to_long(rep(roots[
i]));
zz_pX convertFacCF2NTLzzpX(const CanonicalForm &f)
VAR void(* factoryError)(const char *s)
convertFacCF2nmod_poly_t(FLINTmipo, M)
nmod_poly_clear(FLINTmipo)