28#define Alloc(L) omAlloc(L)
29#define Free(A,L) omFreeSize(A,L)
31#define Alloc(L) malloc(L)
32#define Free(A,L) free(A)
45#ifndef __GMP_BITS_PER_MP_LIMB
46#define __GMP_BITS_PER_MP_LIMB GMP_LIMB_BITS
48#include <flint/fmpz.h>
49#include <flint/fmpq.h>
50#include <flint/fmpz_poly.h>
51#include <flint/fmpz_mod_poly.h>
52#include <flint/nmod_poly.h>
53#include <flint/fmpq_poly.h>
54#include <flint/nmod_mat.h>
55#include <flint/fmpz_mat.h>
56#if ( __FLINT_RELEASE >= 20400)
58#include <flint/fq_poly.h>
59#include <flint/fq_nmod.h>
60#include <flint/fq_nmod_poly.h>
61#include <flint/fq_nmod_mat.h>
63#if ( __FLINT_RELEASE >= 20503)
64#include <flint/fmpq_mpoly.h>
67#if (__FLINT_RELEASE < 20700)
69static void fq_nmod_get_nmod_poly(nmod_poly_t a,
const fq_nmod_t
b,
const fq_nmod_ctx_t ctx)
71 FLINT_ASSERT(
b->
mod.n == ctx->modulus->
mod.n);
72 a->mod = ctx->modulus->mod;
76#include <flint/fq_nmod_mpoly.h>
79#if (__FLINT_RELEASE < 20700)
81void fq_nmod_set_nmod_poly(fq_nmod_t a,
const nmod_poly_t
b,
const fq_nmod_ctx_t ctx)
83 FLINT_ASSERT(a->mod.n ==
b->
mod.n);
84 FLINT_ASSERT(a->mod.n == ctx->modulus->mod.n);
86 fq_nmod_reduce(a, ctx);
89void fq_nmod_set_nmod_poly(fq_nmod_t a,
const nmod_poly_t
b,
90 const fq_nmod_ctx_t ctx)
92 FLINT_ASSERT(a->mod.n ==
b->
mod.n);
93 FLINT_ASSERT(a->mod.n == ctx->modulus->mod.n);
95 if (
b->length <= 2*(ctx->modulus->length - 1))
98 fq_nmod_reduce(a, ctx);
102 nmod_poly_rem(a,
b, ctx->modulus);
125 fmpz_set_mpz (
result, gmp_val);
134 fmpz_set_si (
result,
f.intval());
140 mpz_swap(gmp_val, _fmpz_promote(
result));
157 if(!COEFF_IS_MPZ(*coefficient)
161 long coeff= fmpz_get_si (coefficient);
168 fmpz_get_mpz (gmp_val, coefficient);
179 for (
int i= 0;
i < fmpz_poly_length (poly);
i++)
181 coeff= fmpz_poly_get_coeff_ptr (poly,
i);
182 if (!fmpz_is_zero (coeff))
201 printf(
"convertCF2nmod_poly_t: coefficient not immediate!, char=%d\n",
214 for (
int i= 0;
i < nmod_poly_length (poly);
i++)
216 ulong coeff= nmod_poly_get_coeff_ui (poly,
i);
228 fmpq_set_si (
result,
f.intval(), 1);
234 fmpz_set_mpz (fmpq_numref (
result), gmp_val);
237 fmpz_set_mpz (fmpq_denref (
result), gmp_val);
244 fmpz_set_mpz (fmpq_numref (
result), gmp_val);
246 fmpz_one(fmpq_denref(
result));
250 printf(
"wrong type\n");
264 fmpz_get_mpz (nnum, fmpq_numref (q));
265 fmpz_get_mpz (nden, fmpq_denref (q));
278 else if (mpz_cmp_si(nden,1)==0)
301 for (
long i= 0;
i < n;
i++)
304 fmpq_poly_get_coeff_fmpq (coeff,
p,
i);
305 if (fmpq_is_zero (coeff))
340 const mp_limb_t leadingCoeff,
345 if (leadingCoeff != 1)
350 for (
i = 0;
i < fac->num;
i++)
352 (nmod_poly_t &)fac->p[
i],
x),
357#if __FLINT_RELEASE >= 20503
360 const fmpz_poly_factor_t fac,
371 for (
i = 0;
i < fac->num;
i++)
373 (fmpz_poly_t &)fac->p[
i],
x),
379#if __FLINT_RELEASE >= 20400
383 const fq_nmod_ctx_t
fq_con
390 for (
i = 0;
i < fac->num;
i++)
402 #if (__FLINT_RELEASE >= 20700)
404 fmpz_mod_ctx_init(ctx,
p);
411 #if (__FLINT_RELEASE >= 20700)
412 fmpz_mod_poly_set_fmpz_poly (
result,
buf, ctx);
413 fmpz_mod_ctx_clear(ctx);
415 fmpz_mod_poly_set_fmpz_poly (
result,
buf);
417 fmpz_poly_clear (
buf);
425 fmpz_poly_init (
buf);
426 #if (__FLINT_RELEASE >= 20700)
431 fmpz_mod_ctx_init(ctx,FLINTp);
433 fmpz_mod_poly_get_fmpz_poly (
buf, poly, ctx);
435 fmpz_mod_poly_get_fmpz_poly (
buf, poly);
438 fmpz_poly_clear (
buf);
442#if __FLINT_RELEASE >= 20400
445 const fq_nmod_ctx_t ctx)
449 #if __FLINT_RELEASE >= 20503
460 printf(
"convertFacCF2Fq_nmod_t: coefficient not immediate!, char=%d\n",
465 STICKYASSERT (
i.exp() <= fq_nmod_ctx_degree(ctx),
"convertFacCF2Fq_nmod_t: element is not reduced");
466 #if __FLINT_RELEASE >= 20503
467 nmod_poly_set_coeff_ui (
res,
i.exp(), c.
intval());
473 #if __FLINT_RELEASE >= 20503
489 fmpz_poly_init2 (
result, fq_ctx_degree(ctx));
490 _fmpz_poly_set_length(
result, fq_ctx_degree(ctx));
501 _fmpz_poly_normalise (
result);
522 fq_poly_set_coeff (
result,
i.exp(),
buf, ctx);
529 const fq_nmod_ctx_t ctx)
534 fq_nmod_init2 (
buf, ctx);
538 fq_nmod_poly_set_coeff (
result,
i.exp(),
buf, ctx);
539 fq_nmod_zero (
buf, ctx);
541 fq_nmod_clear (
buf, ctx);
550 long n= fq_poly_length (
p, ctx);
551 fq_init2 (coeff, ctx);
552 for (
long i= 0;
i < n;
i++)
554 fq_poly_get_coeff (coeff,
p,
i, ctx);
555 if (fq_is_zero (coeff, ctx))
558 fq_zero (coeff, ctx);
560 fq_clear (coeff, ctx);
571 long n= fq_nmod_poly_length (
p, ctx);
572 fq_nmod_init2 (coeff, ctx);
573 for (
long i= 0;
i < n;
i++)
575 fq_nmod_poly_get_coeff (coeff,
p,
i, ctx);
576 if (fq_nmod_is_zero (coeff, ctx))
579 fq_nmod_zero (coeff, ctx);
581 fq_nmod_clear (coeff, ctx);
589 fmpz_mat_init (
M, (
long)
m.rows(), (
long)
m.columns());
592 for(
i=
m.rows();
i>0;
i--)
594 for(
j=
m.columns();
j>0;
j--)
604 for(
i=
res->rows();
i>0;
i--)
606 for(
j=
res->columns();
j>0;
j--)
621 for(
i=
m.rows();
i>0;
i--)
623 for(
j=
m.columns();
j>0;
j--)
625 if(!(
m(
i,
j)).isImm()) printf(
"convertFacCFMatrix2FLINTmat_zz_p: not imm.\n");
626 nmod_mat_entry (
M,
i-1,
j-1)= (
m(
i,
j)).intval();
636 for(
i=
res->rows();
i>0;
i--)
638 for(
j=
res->columns();
j>0;
j--)
646#if __FLINT_RELEASE >= 20400
651 fq_nmod_mat_init (
M, (
long)
m.rows(), (
long)
m.columns(),
fq_con);
653 for(
i=
m.rows();
i>0;
i--)
655 for(
j=
m.columns();
j>0;
j--)
664 const fq_nmod_ctx_t&
fq_con,
668 fq_nmod_mat_ncols (
m,
fq_con));
670 for(
i=
res->rows();
i>0;
i--)
672 for(
j=
res->columns();
j>0;
j--)
681#if __FLINT_RELEASE >= 20503
682static void convFlint_RecPP (
const CanonicalForm &
f, ulong *
exp, nmod_mpoly_t
result, nmod_mpoly_ctx_t ctx,
int N )
685 if ( !
f.inCoeffDomain() )
698 nmod_mpoly_push_term_ui_ui(
result,c,
exp,ctx);
702static void convFlint_RecPP (
const CanonicalForm &
f, ulong *
exp, fmpq_mpoly_t
result, fmpq_mpoly_ctx_t ctx,
int N )
705 if ( !
f.inBaseDomain() )
720 fmpq_mpoly_push_term_fmpq_ui(
result,c,
exp,ctx);
725static void convFlint_RecPP (
const CanonicalForm &
f, ulong *
exp, fmpz_mpoly_t
result, fmpz_mpoly_ctx_t ctx,
int N )
728 if ( !
f.inBaseDomain() )
743 fmpz_mpoly_push_term_fmpz_ui(
result,c,
exp,ctx);
748#if __FLINT_RELEASE >= 20700
749static void convFlint_RecPP (
const CanonicalForm &
f, ulong *
exp, fq_nmod_mpoly_t
result,
const fq_nmod_mpoly_ctx_t ctx,
int N,
const fq_nmod_ctx_t fq_ctx )
752 if ( !
f.inCoeffDomain() )
758 convFlint_RecPP(
i.coeff(),
exp,
result, ctx,
N, fq_ctx );
766 fq_nmod_mpoly_push_term_fq_nmod_ui(
result,c,
exp,ctx);
771void convFactoryPFlintMP (
const CanonicalForm &
f, nmod_mpoly_t
res, nmod_mpoly_ctx_t ctx,
int N )
773 if (
f.isZero())
return;
774 ulong *
exp = (ulong*)
Alloc(
N*
sizeof(ulong));
775 memset(
exp,0,
N*
sizeof(ulong));
778 convFlint_RecPP(
f,
exp,
res, ctx,
N );
783void convFactoryPFlintMP (
const CanonicalForm &
f, fmpq_mpoly_t
res, fmpq_mpoly_ctx_t ctx,
int N )
785 if (
f.isZero())
return;
786 ulong *
exp = (ulong*)
Alloc(
N*
sizeof(ulong));
787 memset(
exp,0,
N*
sizeof(ulong));
788 convFlint_RecPP(
f,
exp,
res, ctx,
N );
789 fmpq_mpoly_reduce(
res,ctx);
793void convFactoryPFlintMP (
const CanonicalForm &
f, fmpz_mpoly_t
res, fmpz_mpoly_ctx_t ctx,
int N )
795 if (
f.isZero())
return;
796 ulong *
exp = (ulong*)
Alloc(
N*
sizeof(ulong));
797 memset(
exp,0,
N*
sizeof(ulong));
798 convFlint_RecPP(
f,
exp,
res, ctx,
N );
803#if __FLINT_RELEASE >= 20700
804void convFactoryPFlintMP (
const CanonicalForm &
f, fq_nmod_mpoly_t
res, fq_nmod_mpoly_ctx_t ctx,
int N, fq_nmod_ctx_t fq_ctx )
806 if (
f.isZero())
return;
807 ulong *
exp = (ulong*)
Alloc(
N*
sizeof(ulong));
808 memset(
exp,0,
N*
sizeof(ulong));
811 convFlint_RecPP(
f,
exp,
res, ctx,
N, fq_ctx );
817CanonicalForm convFlintMPFactoryP(nmod_mpoly_t
f, nmod_mpoly_ctx_t ctx,
int N)
820 int d=nmod_mpoly_length(
f,ctx)-1;
821 ulong*
exp=(ulong*)
Alloc(
N*
sizeof(ulong));
822 for(
int i=d;
i>=0;
i--)
824 ulong c=nmod_mpoly_get_term_coeff_ui(
f,
i,ctx);
825 nmod_mpoly_get_term_exp_ui(
exp,
f,
i,ctx);
827 for (
int i = 0;
i <
N;
i++ )
837CanonicalForm convFlintMPFactoryP(fmpq_mpoly_t
f, fmpq_mpoly_ctx_t ctx,
int N)
840 int d=fmpq_mpoly_length(
f,ctx)-1;
841 ulong*
exp=(ulong*)
Alloc(
N*
sizeof(ulong));
844 for(
int i=d;
i>=0;
i--)
846 fmpq_mpoly_get_term_coeff_fmpq(c,
f,
i,ctx);
847 fmpq_mpoly_get_term_exp_ui(
exp,
f,
i,ctx);
849 for (
int i = 0;
i <
N;
i++ )
860CanonicalForm convFlintMPFactoryP(fmpz_mpoly_t
f, fmpz_mpoly_ctx_t ctx,
int N)
863 int d=fmpz_mpoly_length(
f,ctx)-1;
864 ulong*
exp=(ulong*)
Alloc(
N*
sizeof(ulong));
867 for(
int i=d;
i>=0;
i--)
869 fmpz_mpoly_get_term_coeff_fmpz(c,
f,
i,ctx);
870 fmpz_mpoly_get_term_exp_ui(
exp,
f,
i,ctx);
872 for (
int i = 0;
i <
N;
i++ )
887 nmod_mpoly_ctx_t ctx;
889 nmod_mpoly_t
f,
g,
res;
890 nmod_mpoly_init3(
f,lF,bits,ctx);
891 nmod_mpoly_init3(
g,lG,bits,ctx);
892 convFactoryPFlintMP(F,
f,ctx,
N);
893 convFactoryPFlintMP(
G,
g,ctx,
N);
894 nmod_mpoly_init(
res,ctx);
895 nmod_mpoly_mul(
res,
f,
g,ctx);
896 nmod_mpoly_clear(
g,ctx);
897 nmod_mpoly_clear(
f,ctx);
899 nmod_mpoly_clear(
res,ctx);
900 nmod_mpoly_ctx_clear(ctx);
908 fmpq_mpoly_ctx_t ctx;
909 fmpq_mpoly_ctx_init(ctx,
N,ORD_LEX);
910 fmpq_mpoly_t
f,
g,
res;
911 fmpq_mpoly_init3(
f,lF,bits,ctx);
912 fmpq_mpoly_init3(
g,lG,bits,ctx);
913 convFactoryPFlintMP(F,
f,ctx,
N);
914 convFactoryPFlintMP(
G,
g,ctx,
N);
915 fmpq_mpoly_init(
res,ctx);
916 fmpq_mpoly_mul(
res,
f,
g,ctx);
917 fmpq_mpoly_clear(
g,ctx);
918 fmpq_mpoly_clear(
f,ctx);
920 fmpq_mpoly_clear(
res,ctx);
921 fmpq_mpoly_ctx_clear(ctx);
928 int lf,lg,
m=1<<MPOLY_MIN_BITS;
932 nmod_mpoly_ctx_t ctx;
934 nmod_mpoly_t
f,
g,
res;
935 nmod_mpoly_init3(
f,lf,bits,ctx);
936 nmod_mpoly_init3(
g,lg,bits,ctx);
937 convFactoryPFlintMP(F,
f,ctx,
N);
938 convFactoryPFlintMP(
G,
g,ctx,
N);
939 nmod_mpoly_init(
res,ctx);
940 int ok=nmod_mpoly_gcd(
res,
f,
g,ctx);
941 nmod_mpoly_clear(
g,ctx);
942 nmod_mpoly_clear(
f,ctx);
946 RES=convFlintMPFactoryP(
res,ctx,
N);
948 nmod_mpoly_clear(
res,ctx);
949 nmod_mpoly_ctx_clear(ctx);
955 if (
f.inCoeffDomain() )
961 for (
i =
f;
i.hasTerms() && (!
result.isOne());
i++ )
971 fmpq_mpoly_ctx_t ctx;
972 fmpq_mpoly_ctx_init(ctx,
N,ORD_LEX);
973 fmpq_mpoly_t
f,
g,
res;
974 fmpq_mpoly_init(
f,ctx);
975 fmpq_mpoly_init(
g,ctx);
976 convFactoryPFlintMP(F,
f,ctx,
N);
977 convFactoryPFlintMP(
G,
g,ctx,
N);
978 fmpq_mpoly_init(
res,ctx);
979 int ok=fmpq_mpoly_gcd(
res,
f,
g,ctx);
980 fmpq_mpoly_clear(
g,ctx);
981 fmpq_mpoly_clear(
f,ctx);
987 if (!fmpq_mpoly_is_zero(
res, ctx))
995 RES=convFlintMPFactoryP(
res,ctx,
N);
997 RES*=
bgcd(b_content(F),b_content(
G));
999 fmpq_mpoly_clear(
res,ctx);
1000 fmpq_mpoly_ctx_clear(ctx);
1006#if __FLINT_RELEASE >= 20700
1008convertFLINTFq_nmod_mpoly_factor2FacCFFList (
1009 fq_nmod_mpoly_factor_t fac,
1010 const fq_nmod_mpoly_ctx_t& ctx,
1012 const fq_nmod_ctx_t& fq_ctx,
1020 fq_nmod_init(c,fq_ctx);
1021 fq_nmod_mpoly_factor_get_constant_fq_nmod(c,fac,ctx);
1023 fq_nmod_clear(c,fq_ctx);
1026 fq_nmod_mpoly_init(
p,ctx);
1028 for (
i = 0;
i < fac->num;
i++)
1030 fq_nmod_mpoly_factor_get_base(
p,fac,
i,ctx);
1031 exp=fq_nmod_mpoly_factor_get_exp_si(fac,
i,ctx);
1035 fq_nmod_mpoly_clear(
p,ctx);
1040convertFacCF2Fq_nmod_mpoly_t (fq_nmod_mpoly_t
result,
1042 const fq_nmod_mpoly_ctx_t ctx,
1044 const fq_nmod_ctx_t fq_ctx
1047 if (
f.isZero())
return;
1048 ulong *
exp = (ulong*)
Alloc(
N*
sizeof(ulong));
1049 memset(
exp,0,
N*
sizeof(ulong));
1050 convFlint_RecPP(
f,
exp,
result, ctx,
N, fq_ctx );
1055convertFq_nmod_mpoly_t2FacCF (
const fq_nmod_mpoly_t
f,
1056 const fq_nmod_mpoly_ctx_t& ctx,
1058 const fq_nmod_ctx_t& fq_ctx,
1062 int d=fq_nmod_mpoly_length(
f,ctx)-1;
1063 ulong*
exp=(ulong*)
Alloc(
N*
sizeof(ulong));
1065 fq_nmod_init(c,fq_ctx);
1066 for(
int i=d;
i>=0;
i--)
1068 fq_nmod_mpoly_get_term_coeff_fq_nmod(c,
f,
i,ctx);
1069 fq_nmod_mpoly_get_term_exp_ui(
exp,
f,
i,ctx);
1071 for (
int i = 0;
i <
N;
i++ )
void convertFacCFMatrix2Fmpz_mat_t(fmpz_mat_t M, const CFMatrix &m)
conversion of a factory matrix over Z to a fmpz_mat_t
CanonicalForm convertFq_poly_t2FacCF(const fq_poly_t p, const Variable &x, const Variable &alpha, const fq_ctx_t ctx)
conversion of a FLINT poly over Fq (for non-word size p) to a CanonicalForm with alg....
CFMatrix * convertFmpz_mat_t2FacCFMatrix(const fmpz_mat_t m)
conversion of a FLINT matrix over Z to a factory matrix
void convertFacCF2Fq_t(fq_t result, const CanonicalForm &f, const fq_ctx_t ctx)
conversion of a factory element of F_q (for non-word size p) to a FLINT fq_t
CFMatrix * convertNmod_mat_t2FacCFMatrix(const nmod_mat_t m)
conversion of a FLINT matrix over Z/p to a factory matrix
void convertFacCFMatrix2nmod_mat_t(nmod_mat_t M, const CFMatrix &m)
conversion of a factory matrix over Z/p to a nmod_mat_t
CanonicalForm convertFq_nmod_poly_t2FacCF(const fq_nmod_poly_t p, const Variable &x, const Variable &alpha, const fq_nmod_ctx_t ctx)
conversion of a FLINT poly over Fq to a CanonicalForm with alg. variable alpha and polynomial variabl...
CanonicalForm convertFmpz2CF(const fmpz_t coefficient)
conversion of a FLINT integer to CanonicalForm
CanonicalForm convertFq_t2FacCF(const fq_t poly, const Variable &alpha)
conversion of a FLINT element of F_q with non-word size p to a CanonicalForm with alg....
void convertFacCF2Fq_nmod_t(fq_nmod_t result, const CanonicalForm &f, const fq_nmod_ctx_t ctx)
conversion of a factory element of F_q to a FLINT fq_nmod_t, does not do any memory allocation for po...
CanonicalForm convertFmpq_poly_t2FacCF(const fmpq_poly_t p, const Variable &x)
conversion of a FLINT poly over Q to CanonicalForm
void convertFacCFMatrix2Fq_nmod_mat_t(fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const CFMatrix &m)
conversion of a factory matrix over F_q to a fq_nmod_mat_t
CanonicalForm convertFmpz_mod_poly_t2FacCF(const fmpz_mod_poly_t poly, const Variable &x, const modpk &b)
conversion of a FLINT poly over Z/p (for non word size p) to a CanonicalForm over Z
void convertFacCF2Fmpz_array(fmpz *result, const CanonicalForm &f)
void convertFacCF2nmod_poly_t(nmod_poly_t result, const CanonicalForm &f)
conversion of a factory univariate polynomials over Z/p (for word size p) to nmod_poly_t
CFFList convertFLINTFq_nmod_poly_factor2FacCFFList(const fq_nmod_poly_factor_t fac, const Variable &x, const Variable &alpha, const fq_nmod_ctx_t fq_con)
conversion of a FLINT factorization over Fq (for word size p) to a CFFList
void convertCF2Fmpz(fmpz_t result, const CanonicalForm &f)
conversion of a factory integer to fmpz_t
void convertCF2Fmpq(fmpq_t result, const CanonicalForm &f)
conversion of a factory rationals to fmpq_t
CanonicalForm convertnmod_poly_t2FacCF(const nmod_poly_t poly, const Variable &x)
conversion of a FLINT poly over Z/p to CanonicalForm
void convertFacCF2Fmpz_mod_poly_t(fmpz_mod_poly_t result, const CanonicalForm &f, const fmpz_t p)
conversion of a factory univariate poly over Z to a FLINT poly over Z/p (for non word size p)
void convertFacCF2Fq_nmod_poly_t(fq_nmod_poly_t result, const CanonicalForm &f, const fq_nmod_ctx_t ctx)
conversion of a factory univariate poly over F_q to a FLINT fq_nmod_poly_t
CanonicalForm convertFmpz_poly_t2FacCF(const fmpz_poly_t poly, const Variable &x)
conversion of a FLINT poly over Z to CanonicalForm
CanonicalForm convertFq_nmod_t2FacCF(const fq_nmod_t poly, const Variable &alpha, const fq_nmod_ctx_t)
conversion of a FLINT element of F_q to a CanonicalForm with alg. variable alpha
CFFList convertFLINTnmod_poly_factor2FacCFFList(const nmod_poly_factor_t fac, const mp_limb_t leadingCoeff, const Variable &x)
conversion of a FLINT factorization over Z/p (for word size p) to a CFFList
CanonicalForm convertFmpq2CF(const fmpq_t q)
conversion of a FLINT rational to CanonicalForm
void convertFacCF2Fmpq_poly_t(fmpq_poly_t result, const CanonicalForm &f)
conversion of a factory univariate polynomials over Q to fmpq_poly_t
void convertFacCF2Fmpz_poly_t(fmpz_poly_t result, const CanonicalForm &f)
conversion of a factory univariate polynomial over Z to a fmpz_poly_t
void convertCF2initFmpz(fmpz_t result, const CanonicalForm &f)
conversion of a factory integer to fmpz_t(init.)
CFMatrix * convertFq_nmod_mat_t2FacCFMatrix(const fq_nmod_mat_t m, const fq_nmod_ctx_t &fq_con, const Variable &alpha)
conversion of a FLINT matrix over F_q to a factory matrix
void convertFacCF2Fq_poly_t(fq_poly_t result, const CanonicalForm &f, const fq_ctx_t ctx)
conversion of a factory univariate poly over F_q (for non-word size p) to a FLINT fq_poly_t
This file defines functions for conversion to FLINT (www.flintlib.org) and back.
CFFList convertFLINTfmpz_poly_factor2FacCFFList(const fmpz_poly_factor_t fac, const Variable &x)
conversion of a FLINT factorization over Z to a CFFList
const CanonicalForm CFMap CFMap & N
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
declarations of higher level algorithms.
#define STICKYASSERT(expression, message)
#define ASSERT(expression, message)
static const int SW_RATIONAL
set to 1 for computations over Q
static const int SW_SYMMETRIC_FF
set to 1 for symmetric representation over F_q
Interface to generate InternalCF's over various domains from intrinsic types or mpz_t's.
Iterators for CanonicalForm's.
static InternalCF * basic(int value)
static InternalCF * rational(long num, long den)
class to iterate through CanonicalForm's
factory's class for variables
class to do operations mod p^k for int's p and k
nmod_poly_init(FLINTmipo, getCharacteristic())
operations mod p^k and some other useful functions for factorization
utility functions for gmp
bool mpz_is_imm(const mpz_t mpi)
gmp_float exp(const gmp_float &a)
static int SI_LOG2(int v)
int status int void * buf
void gmp_denominator(const CanonicalForm &f, mpz_ptr result)
void gmp_numerator(const CanonicalForm &f, mpz_ptr result)
helper functions for conversion to and from Singular