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>
65#include <flint/fmpz_mod.h>
68#if (__FLINT_RELEASE < 20700)
73 a->mod =
ctx->modulus->mod;
77#include <flint/fq_nmod_mpoly.h>
80#if (__FLINT_RELEASE < 20700)
202 printf(
"convertCF2nmod_poly_t: coefficient not immediate!, char=%d\n",
302 for (
long i= 0;
i < n;
i++)
351 for (
i = 0;
i < fac->num;
i++)
358#if __FLINT_RELEASE >= 20503
372 for (
i = 0;
i < fac->num;
i++)
380#if __FLINT_RELEASE >= 20400
391 for (
i = 0;
i < fac->num;
i++)
403 #if (__FLINT_RELEASE >= 20700)
412 #if (__FLINT_RELEASE >= 20700)
427 #if (__FLINT_RELEASE >= 20700)
443#if __FLINT_RELEASE >= 20400
450 #if __FLINT_RELEASE >= 20503
461 printf(
"convertFacCF2Fq_nmod_t: coefficient not immediate!, char=%d\n",
467 #if __FLINT_RELEASE >= 20503
474 #if __FLINT_RELEASE >= 20503
553 for (
long i= 0;
i < n;
i++)
574 for (
long i= 0;
i < n;
i++)
593 for(
i=
m.rows();
i>0;
i--)
595 for(
j=
m.columns();
j>0;
j--)
605 for(
i=
res->rows();
i>0;
i--)
607 for(
j=
res->columns();
j>0;
j--)
622 for(
i=
m.rows();
i>0;
i--)
624 for(
j=
m.columns();
j>0;
j--)
626 if(!(
m(
i,
j)).isImm())
printf(
"convertFacCFMatrix2FLINTmat_zz_p: not imm.\n");
637 for(
i=
res->rows();
i>0;
i--)
639 for(
j=
res->columns();
j>0;
j--)
647#if __FLINT_RELEASE >= 20400
654 for(
i=
m.rows();
i>0;
i--)
656 for(
j=
m.columns();
j>0;
j--)
671 for(
i=
res->rows();
i>0;
i--)
673 for(
j=
res->columns();
j>0;
j--)
682#if __FLINT_RELEASE >= 20503
686 if ( !
f.inCoeffDomain() )
706 if ( !
f.inBaseDomain() )
729 if ( !
f.inBaseDomain() )
749#if __FLINT_RELEASE >= 20700
753 if ( !
f.inCoeffDomain() )
774 if (
f.isZero())
return;
786 if (
f.isZero())
return;
796 if (
f.isZero())
return;
804#if __FLINT_RELEASE >= 20700
807 if (
f.isZero())
return;
823 for(
int i=d;
i>=0;
i--)
828 for (
int i = 0;
i <
N;
i++ )
845 for(
int i=d;
i>=0;
i--)
850 for (
int i = 0;
i <
N;
i++ )
868 for(
int i=d;
i>=0;
i--)
873 for (
int i = 0;
i <
N;
i++ )
956 if (
f.inCoeffDomain() )
962 for (
i =
f;
i.hasTerms() && (!
result.isOne());
i++ )
1007#if __FLINT_RELEASE >= 20700
1029 for (
i = 0;
i < fac->num;
i++)
1048 if (
f.isZero())
return;
1067 for(
int i=d;
i>=0;
i--)
1072 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
void FACTORY_PUBLIC gmp_numerator(const CanonicalForm &f, mpz_ptr result)
void FACTORY_PUBLIC gmp_denominator(const CanonicalForm &f, mpz_ptr result)
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
helper functions for conversion to and from Singular