29#define Alloc(L) omAlloc(L)
30#define Free(A,L) omFreeSize(A,L)
32#define Alloc(L) malloc(L)
33#define Free(A,L) free(A)
46#ifndef __GMP_BITS_PER_MP_LIMB
47#define __GMP_BITS_PER_MP_LIMB GMP_LIMB_BITS
49#include <flint/fmpz.h>
50#include <flint/fmpq.h>
51#include <flint/fmpz_poly.h>
52#include <flint/fmpz_mod_poly.h>
53#include <flint/nmod_poly.h>
54#include <flint/fmpq_poly.h>
55#include <flint/nmod_mat.h>
56#include <flint/fmpz_mat.h>
57#if ( __FLINT_RELEASE >= 20400)
59#include <flint/fq_poly.h>
60#include <flint/fq_nmod.h>
61#include <flint/fq_nmod_poly.h>
62#include <flint/fq_nmod_mat.h>
64#if ( __FLINT_RELEASE >= 20503)
65#include <flint/fmpq_mpoly.h>
66#include <flint/fmpz_mod.h>
69#if (__FLINT_RELEASE < 20700)
74 a->mod =
ctx->modulus->mod;
78#include <flint/fq_nmod_mpoly.h>
81#if (__FLINT_RELEASE < 20700)
90#elif (__FLINT_RELEASE < 30000)
203 printf(
"convertCF2nmod_poly_t: coefficient not immediate!, char=%d\n",
303 for (
long i= 0;
i < n;
i++)
352 for (
i = 0;
i < fac->num;
i++)
359#if __FLINT_RELEASE >= 20503
373 for (
i = 0;
i < fac->num;
i++)
381#if __FLINT_RELEASE >= 20400
392 for (
i = 0;
i < fac->num;
i++)
404 #if (__FLINT_RELEASE >= 20700)
413 #if (__FLINT_RELEASE >= 20700)
428 #if (__FLINT_RELEASE >= 20700)
444#if __FLINT_RELEASE >= 20400
451 #if __FLINT_RELEASE >= 20503
462 printf(
"convertFacCF2Fq_nmod_t: coefficient not immediate!, char=%d\n",
468 #if __FLINT_RELEASE >= 20503
475 #if __FLINT_RELEASE >= 20503
554 for (
long i= 0;
i < n;
i++)
575 for (
long i= 0;
i < n;
i++)
594 for(
i=
m.rows();
i>0;
i--)
596 for(
j=
m.columns();
j>0;
j--)
606 for(
i=
res->rows();
i>0;
i--)
608 for(
j=
res->columns();
j>0;
j--)
623 for(
i=
m.rows();
i>0;
i--)
625 for(
j=
m.columns();
j>0;
j--)
627 if(!(
m(
i,
j)).isImm())
printf(
"convertFacCFMatrix2FLINTmat_zz_p: not imm.\n");
638 for(
i=
res->rows();
i>0;
i--)
640 for(
j=
res->columns();
j>0;
j--)
648#if __FLINT_RELEASE >= 20400
655 for(
i=
m.rows();
i>0;
i--)
657 for(
j=
m.columns();
j>0;
j--)
672 for(
i=
res->rows();
i>0;
i--)
674 for(
j=
res->columns();
j>0;
j--)
683#if __FLINT_RELEASE >= 20503
687 if ( !
f.inCoeffDomain() )
707 if ( !
f.inBaseDomain() )
730 if ( !
f.inBaseDomain() )
750#if __FLINT_RELEASE >= 20700
754 if ( !
f.inCoeffDomain() )
775 if (
f.isZero())
return;
787 if (
f.isZero())
return;
797 if (
f.isZero())
return;
805#if __FLINT_RELEASE >= 20700
808 if (
f.isZero())
return;
824 for(
int i=d;
i>=0;
i--)
829 for (
int i = 0;
i <
N;
i++ )
846 for(
int i=d;
i>=0;
i--)
851 for (
int i = 0;
i <
N;
i++ )
869 for(
int i=d;
i>=0;
i--)
874 for (
int i = 0;
i <
N;
i++ )
957 if (
f.inCoeffDomain() )
963 for (
i =
f;
i.hasTerms() && (!
result.isOne());
i++ )
1008#if __FLINT_RELEASE >= 20700
1030 for (
i = 0;
i < fac->num;
i++)
1049 if (
f.isZero())
return;
1068 for(
int i=d;
i>=0;
i--)
1073 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