Loading...
Searching...
No Matches
flintconv.cc
Go to the documentation of this file.
// emacs edit mode for this file is -*- C++ -*-
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: convert data between Singular and Flint
*/
#include "misc/auxiliary.h"
#include "flintconv.h"
#ifdef HAVE_FLINT
#if __FLINT_RELEASE >= 20500
#include "coeffs/coeffs.h"
#include "coeffs/longrat.h"
#include "coeffs/rintegers.h"
#include "polys/monomials/p_polys.h"
#include "polys/sbuckets.h"
//#include "polys/clapconv.h"
#include "simpleideals.h"
int convFlintISingI (fmpz_t f)
{
//return fmpz_get_si(f);
return (int)*f;
}
void convSingIFlintI(fmpz_t f, int p)
{
fmpz_init(f);
*f=p;
//fmpz_set_si(f,p);
return;
}
void convFlintNSingN (mpz_t z, fmpz_t f)
{
mpz_init(z);
fmpz_get_mpz(z,f);
}
number convFlintNSingN (fmpz_t f)
{
#if __FLINT_RELEASE > 20502
number z;
if(COEFF_IS_MPZ(*f))
nlMPZ(COEFF_TO_PTR(*f),z,NULL);
else
{
mpz_t a;
mpz_init(a);
fmpz_get_mpz(a,f);
nlMPZ(a,z,NULL);
mpz_clear(a);
}
return z;
#else
WerrorS("not implemented");
return NULL;
#endif
}
number convFlintNSingN (fmpq_t f, const coeffs cf)
{
#if __FLINT_RELEASE > 20502
if (getCoeffType(cf)==n_Q) /* QQ, bigint */
{
return convFlintNSingN_QQ(f,cf);
}
else
{
number z;
mpz_t a,b;
mpz_init(a);
mpz_init(b);
fmpq_get_mpz_frac(a,b,f);
if (mpz_cmp_si(b,1L)!=0)
{
number na=n_InitMPZ(a,cf);
number nb=n_InitMPZ(b,cf);
z=n_Div(na,nb,cf);
n_Delete(&nb,cf);
n_Delete(&na,cf);
n_Normalize(z,cf);
}
else
{
z=n_InitMPZ(a,cf);
}
mpz_clear(a);
mpz_clear(b);
n_Test(z,cf);
return z;
}
#else
WerrorS("not implemented");
return NULL;
#endif
}
number convFlintNSingN (fmpz_t f, const coeffs cf)
{
#if __FLINT_RELEASE > 20502
number z;
if(COEFF_IS_MPZ(*f))
z=n_InitMPZ(COEFF_TO_PTR(*f),cf);
else if (cf->rep==n_rep_gmp)
{
z=nrzInit(1,NULL); // alloc and initialization
fmpz_get_mpz((mpz_ptr)z,f);
}
else
{
if (fmpz_fits_si(f))
{
long i=fmpz_get_si(f);
z=n_Init(i,cf);
}
else
{
mpz_t a;
mpz_init(a);
fmpz_get_mpz(a,f);
z=n_InitMPZ(a,cf);
mpz_clear(a);
}
}
return z;
#else
WerrorS("not implemented");
return NULL;
#endif
}
number convFlintNSingN_QQ (fmpq_t f, const coeffs cf)
{
#if __FLINT_RELEASE > 20502
if (fmpz_is_one(fmpq_denref(f)))
{
if (fmpz_fits_si(fmpq_numref(f)))
{
long i=fmpz_get_si(fmpq_numref(f));
return n_Init(i,cf);
}
}
number z=ALLOC_RNUMBER();
#if defined(LDEBUG)
z->debug=123456;
#endif
mpz_init(z->z);
if (fmpz_is_one(fmpq_denref(f)))
{
z->s=3;
fmpz_get_mpz(z->z,fmpq_numref(f));
}
else
{
z->s=0;
mpz_init(z->n);
fmpq_get_mpz_frac(z->z,z->n,f);
}
return z;
#else
WerrorS("not implemented");
return NULL;
#endif
}
void convSingNFlintN(fmpz_t f, mpz_t n)
{
fmpz_init(f);
fmpz_set_mpz(f,n);
}
void convSingNFlintN(fmpz_t f, number n)
{
fmpz_init(f);
fmpz_set_mpz(f,(mpz_ptr)n);
}
void convSingNFlintN(fmpq_t f, number n, const coeffs cf)
{
if (LIKELY(getCoeffType(cf)==n_Q)) /* QQ, bigint */
{
fmpq_init(f);
if (SR_HDL(n)&SR_INT)
fmpq_set_si(f,SR_TO_INT(n),1);
else if (n->s<3)
{
fmpz_set_mpz(fmpq_numref(f), n->z);
fmpz_set_mpz(fmpq_denref(f), n->n);
}
else
{
fmpz_set_mpz(fmpq_numref(f), n->z);
fmpz_set_si(fmpq_denref(f), 1);
}
}
else
{
coeffs QQ=nInitChar(n_Q,NULL);
nMapFunc nMap=n_SetMap(cf,QQ);
if (nMap!=NULL)
{
number nn=nMap(n,cf,QQ);
convSingNFlintN(f,nn,QQ);
}
nKillChar(QQ);
}
}
void convSingNFlintN_QQ(fmpq_t f, number n)
{
fmpq_init(f);
if (SR_HDL(n)&SR_INT)
fmpq_set_si(f,SR_TO_INT(n),1);
else if (n->s<3)
{
fmpz_set_mpz(fmpq_numref(f), n->z);
fmpz_set_mpz(fmpq_denref(f), n->n);
}
else
{
mpz_t one;
mpz_init_set_si(one,1);
fmpz_set_mpz(fmpq_numref(f), n->z);
fmpz_set_mpz(fmpq_denref(f), one);
mpz_clear(one);
}
}
void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
{
number n_2=n_RePart(n,cf);
convSingNFlintN(re,n_2,cf);
n_Delete(&n_2,cf);
n_2=n_ImPart(n,cf);
convSingNFlintN(im,n_2,cf);
n_Delete(&n_2,cf);
}
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
{
if (p==NULL)
{
fmpq_poly_init(res);
return;
}
int d=p_GetExp(p,1,r);
fmpq_poly_init2(res,d+1);
_fmpq_poly_set_length (res, d + 1);
while(p!=NULL)
{
number n=pGetCoeff(p);
fmpq_t c;
convSingNFlintN(c,n,r->cf);
fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
fmpq_clear(c);
pIter(p);
}
}
void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
{
int d=p_GetExp(p,1,r);
fmpq_poly_init2(res,d+1);
_fmpq_poly_set_length (res, d + 1);
while(p!=NULL)
{
number n=n_ImPart(pGetCoeff(p),r->cf);
fmpq_t c;
convSingNFlintN(c,n,r->cf);
fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
fmpq_clear(c);
n_Delete(&n,r->cf);
pIter(p);
}
}
poly convFlintPSingP(fmpq_poly_t f, const ring r)
{
if (fmpq_poly_is_zero(f)) return NULL;
int d=fmpq_poly_length(f);
poly p=NULL;
fmpq_t c;
fmpq_init(c);
for(int i=0; i<=d; i++)
{
fmpq_poly_get_coeff_fmpq(c,f,i);
number n=convFlintNSingN(c,r->cf);
if(!n_IsZero(n,r->cf))
{
poly pp=p_Init(r);
pSetCoeff0(pp,n);
p_SetExp(pp,1,i,r);
p_Setm(pp,r);
p=p_Add_q(p,pp,r);
}
}
fmpq_clear(c);
p_Test(p,r);
return p;
}
void convSingPFlintnmod_poly_t(nmod_poly_t result, const poly p, const ring r)
{
// assume univariate, r->cf=Z/p
nmod_poly_init2 (result,rChar(r),p_Deg(p,r));
poly h=p;
while(h!=NULL)
{
if (h==NULL)
nmod_poly_set_coeff_ui(result,0,0);
else
nmod_poly_set_coeff_ui(result,p_GetExp(h,1,r),n_Int(pGetCoeff(h),r->cf)+rChar(r));
pIter(h);
}
}
void convSingMFlintFq_nmod_mat(matrix m, fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const ring r)
{
fq_nmod_mat_init (M, (long)MATROWS(m), (long) MATCOLS(m), fq_con);
int i,j;
for(i=MATROWS(m);i>0;i--)
{
for(j=MATCOLS(m);j>0;j--)
{
convSingPFlintnmod_poly_t (fq_nmod_mat_entry(M, i-1, j-1), MATELEM(m,i,j),r);
}
}
}
poly convFlintFq_nmodSingP(const fq_nmod_t Fp, const fq_nmod_ctx_t ctx, const ring r)
{
poly p=NULL;
poly h;
for (int i= 0; i < nmod_poly_length (Fp); i++)
{
ulong coeff= nmod_poly_get_coeff_ui (Fp, i);
if (coeff != 0)
h=p_NSet(n_Init(coeff,r->cf),r);
if (h!=NULL)
{
p_SetExp(h,1,i,r);
p_Setm(h,r);
p=p_Add_q(p,h,r);
}
}
return p;
}
matrix convFlintFq_nmod_matSingM(fq_nmod_mat_t m, const fq_nmod_ctx_t fq_con, const ring r)
{
matrix M=mpNew(fq_nmod_mat_nrows (m, fq_con),fq_nmod_mat_ncols (m, fq_con));
int i,j;
for(i=MATROWS(M);i>0;i--)
{
for(j=MATCOLS(M);j>0;j--)
{
MATELEM(M,i,j)=convFlintFq_nmodSingP(fq_nmod_mat_entry (m, i-1, j-1),
fq_con, r);
}
}
return M;
}
void convSingMFlintNmod_mat(matrix m, nmod_mat_t M, const ring r)
{
nmod_mat_init (M, (long)MATROWS(m), (long) MATCOLS(m), rChar(r));
int i,j;
for(i=MATROWS(m);i>0;i--)
{
for(j=MATCOLS(m);j>0;j--)
{
poly h=MATELEM(m,i,j);
if (h!=NULL)
nmod_mat_entry(M,i-1,j-1)=(long)pGetCoeff(h);
}
}
}
matrix convFlintNmod_matSingM(nmod_mat_t m, const ring r)
{
matrix M=mpNew(nmod_mat_nrows (m),nmod_mat_ncols (m));
int i,j;
for(i=MATROWS(M);i>0;i--)
{
for(j=MATCOLS(M);j>0;j--)
{
MATELEM(M,i,j)=p_ISet(nmod_mat_entry (m, i-1, j-1),r);
}
}
return M;
}
matrix singflint_rref(matrix m, const ring R)
{
int r=m->rows();
int c=m->cols();
int i,j;
matrix M=NULL;
if (rField_is_Q(R))
{
fmpq_mat_t FLINTM;
fmpq_mat_init(FLINTM,r,c);
M=mpNew(r,c);
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
poly h=MATELEM(m,i,j);
if (h!=NULL)
{
if (p_Totaldegree(h,R)==0)
convSingNFlintN(fmpq_mat_entry(FLINTM,i-1,j-1),pGetCoeff(h),R->cf);
else
{
WerrorS("matrix for rref is not constant");
return M;
}
}
}
}
fmpq_mat_rref(FLINTM,FLINTM);
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
number n=convFlintNSingN(fmpq_mat_entry(FLINTM,i-1,j-1),R->cf);
MATELEM(M,i,j)=p_NSet(n,R);
}
}
fmpq_mat_clear(FLINTM);
}
else if (rField_is_Zp(R))
{
nmod_mat_t FLINTM;
// convert matrix
convSingMFlintNmod_mat(m,FLINTM,R);
// rank
long rk= nmod_mat_rref (FLINTM);
M=convFlintNmod_matSingM(FLINTM,R);
// clean up
nmod_mat_clear(FLINTM);
}
else
{
WerrorS("not implemented for these coefficients");
}
return M;
}
ideal singflint_rref(ideal m, const ring R) /*assume smatrix m*/
{
int r=m->rank;
int c=m->ncols;
int i,j;
ideal M=idInit(c,r);
if (rField_is_Q(R))
{
fmpq_mat_t FLINTM;
fmpq_mat_init(FLINTM,r,c);
for(j=c-1;j>=0;j--)
{
poly h=m->m[j];
while(h!=NULL)
{
i=p_GetComp(h,R);
if (p_Totaldegree(h,R)==0)
convSingNFlintN(fmpq_mat_entry(FLINTM,i-1,j),p_GetCoeff(h,R),R->cf);
else
{
WerrorS("smatrix for rref is not constant");
return M;
}
pIter(h);
}
}
fmpq_mat_rref(FLINTM,FLINTM);
for(i=r;i>0;i--)
{
for(j=c-1;j>=0;j--)
{
number n=convFlintNSingN(fmpq_mat_entry(FLINTM,i-1,j),R->cf);
if(!n_IsZero(n,R->cf))
{
poly p=p_NSet(n,R);
p_SetComp(p,i,R);
M->m[j]=p_Add_q(M->m[j],p,R);
}
}
}
fmpq_mat_clear(FLINTM);
}
else if (rField_is_Zp(R))
{
nmod_mat_t FLINTM;
nmod_mat_init(FLINTM,r,c,rChar(R));
for(j=c-1;j>=0;j--)
{
poly h=m->m[j];
while(h!=NULL)
{
i=p_GetComp(h,R);
if (p_Totaldegree(h,R)==0)
nmod_mat_entry(FLINTM,i-1,j)=(long)p_GetCoeff(h,R);
else
{
WerrorS("smatrix for rref is not constant");
return M;
}
pIter(h);
}
}
nmod_mat_rref(FLINTM);
for(i=r;i>0;i--)
{
for(j=c-1;j>=0;j--)
{
number n=n_Init(nmod_mat_entry(FLINTM,i-1,j),R->cf);
if(!n_IsZero(n,R->cf))
{
poly p=p_NSet(n,R);
p_SetComp(p,i,R);
M->m[j]=p_Add_q(M->m[j],p,R);
}
}
}
nmod_mat_clear(FLINTM);
}
else
{
WerrorS("not implemented for these coefficients");
}
return M;
}
matrix singflint_kernel(matrix m, const ring R)
{
matrix M=NULL;
if (rField_is_Zp(R))
{
nmod_mat_t FLINTM;
nmod_mat_t FLINTX;
nmod_mat_init (FLINTX, (long)MATROWS(m), (long) MATCOLS(m), rChar(R));
// convert matrix
convSingMFlintNmod_mat(m,FLINTM,R);
// rank
long rk= nmod_mat_nullspace(FLINTX,FLINTM);
nmod_mat_clear(FLINTM);
M=convFlintNmod_matSingM(FLINTX,R);
// clean up
nmod_mat_clear(FLINTX);
}
else
{
WerrorS("not implemented for these coefficients");
}
return M;
}
ideal singflint_kernel(ideal m, const ring R) /*assume smatrix m*/
{
int r=m->rank;
int c=m->ncols;
int i,j;
ideal M=idInit(c,r);
if (rField_is_Zp(R))
{
nmod_mat_t FLINTM;
nmod_mat_t FLINTX;
nmod_mat_init(FLINTM,r,c,rChar(R));
nmod_mat_init(FLINTX,r,c,rChar(R));
for(j=c-1;j>=0;j--)
{
poly h=m->m[j];
while(h!=NULL)
{
i=p_GetComp(h,R);
if (p_Totaldegree(h,R)==0)
nmod_mat_entry(FLINTM,i-1,j)=(long)p_GetCoeff(h,R);
else
{
WerrorS("smatrix for rref is not constant");
return M;
}
pIter(h);
}
}
nmod_mat_nullspace(FLINTX,FLINTM);
nmod_mat_clear(FLINTM);
for(i=r;i>0;i--)
{
for(j=c-1;j>=0;j--)
{
number n=n_Init(nmod_mat_entry(FLINTX,i-1,j),R->cf);
if(!n_IsZero(n,R->cf))
{
poly p=p_NSet(n,R);
p_SetComp(p,i,R);
M->m[j]=p_Add_q(M->m[j],p,R);
}
}
}
nmod_mat_clear(FLINTX);
}
else
{
WerrorS("not implemented for these coefficients");
}
return M;
}
bigintmat* singflint_LLL(bigintmat* m, bigintmat* T)
{
int r=m->rows();
int c=m->cols();
bigintmat* res=new bigintmat(r,c,m->basecoeffs());
fmpz_mat_t M, Transf;
fmpz_mat_init(M, r, c);
if(T != NULL)
{
fmpz_mat_init(Transf, T->rows(), T->rows());
}
fmpz_t dummy;
mpz_t n;
int i,j;
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
n_MPZ(n, BIMATELEM(*m, i, j),m->basecoeffs());
convSingNFlintN(dummy,n);
mpz_clear(n);
fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
fmpz_clear(dummy);
}
}
if(T != NULL)
{
for(i=T->rows();i>0;i--)
{
for(j=T->rows();j>0;j--)
{
n_MPZ(n, BIMATELEM(*T, i, j),T->basecoeffs());
convSingNFlintN(dummy,n);
mpz_clear(n);
fmpz_set(fmpz_mat_entry(Transf, i-1, j-1), dummy);
fmpz_clear(dummy);
}
}
}
fmpz_lll_t fl;
fmpz_lll_context_init_default(fl);
if(T != NULL)
fmpz_lll(M, Transf, fl);
else
fmpz_lll(M, NULL, fl);
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
convFlintNSingN(n, fmpz_mat_entry(M, i-1, j-1));
n_Delete(&(BIMATELEM(*res,i,j)),res->basecoeffs());
BIMATELEM(*res,i,j)=n_InitMPZ(n,res->basecoeffs());
mpz_clear(n);
}
}
if(T != NULL)
{
for(i=T->rows();i>0;i--)
{
for(j=T->cols();j>0;j--)
{
convFlintNSingN(n, fmpz_mat_entry(Transf, i-1, j-1));
n_Delete(&(BIMATELEM(*T,i,j)),T->basecoeffs());
BIMATELEM(*T,i,j)=n_InitMPZ(n,T->basecoeffs());
mpz_clear(n);
}
}
}
return res;
}
intvec* singflint_LLL(intvec* m, intvec* T)
{
int r=m->rows();
int c=m->cols();
intvec* res = new intvec(r,c,(int)0);
fmpz_mat_t M,Transf;
fmpz_mat_init(M, r, c);
if(T != NULL)
fmpz_mat_init(Transf, r, r);
fmpz_t dummy;
int i,j;
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
convSingIFlintI(dummy,IMATELEM(*m,i,j));
fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
fmpz_clear(dummy);
}
}
if(T != NULL)
{
for(i=T->rows();i>0;i--)
{
for(j=T->rows();j>0;j--)
{
convSingIFlintI(dummy,IMATELEM(*T,i,j));
fmpz_set(fmpz_mat_entry(Transf, i-1, j-1), dummy);
fmpz_clear(dummy);
}
}
}
fmpz_lll_t fl;
fmpz_lll_context_init_default(fl);
if(T != NULL)
fmpz_lll(M, Transf, fl);
else
fmpz_lll(M, NULL, fl);
for(i=r;i>0;i--)
{
for(j=c;j>0;j--)
{
IMATELEM(*res,i,j)=convFlintISingI(fmpz_mat_entry(M, i-1, j-1));
}
}
if(T != NULL)
{
for(i=Transf->r;i>0;i--)
{
for(j=Transf->r;j>0;j--)
{
IMATELEM(*T,i,j)=convFlintISingI(fmpz_mat_entry(Transf, i-1, j-1));
}
}
}
return res;
}
#endif
#endif
auxiliary.h
All the auxiliary stuff.
LIKELY
#define LIKELY(X)
Definition auxiliary.h:404
BIMATELEM
#define BIMATELEM(M, I, J)
Definition bigintmat.h:133
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
b
CanonicalForm b
Definition cfModGcd.cc:4111
f
FILE * f
Definition checklibs.c:9
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
intvec
Definition intvec.h:24
coeffs.h
Coefficient rings, fields and other domains suitable for Singular polynomials.
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition coeffs.h:550
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition coeffs.h:715
n_Q
@ n_Q
rational (GMP) numbers
Definition coeffs.h:30
n_MPZ
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
Definition coeffs.h:554
n_SetMap
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition coeffs.h:703
n_Div
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition coeffs.h:618
n_RePart
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
Definition coeffs.h:785
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:412
ALLOC_RNUMBER
#define ALLOC_RNUMBER()
Definition coeffs.h:94
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
getCoeffType
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:431
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_InitMPZ
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
Definition coeffs.h:545
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
n_rep_gmp
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
Definition coeffs.h:122
n_ImPart
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
Definition coeffs.h:788
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
n_Normalize
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition coeffs.h:581
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:563
result
return result
Definition facAbsBiFact.cc:76
res
CanonicalForm res
Definition facAbsFact.cc:60
fq_con
fq_nmod_ctx_t fq_con
Definition facHensel.cc:99
j
int j
Definition facHensel.cc:110
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
flintconv.h
This file is work in progress and currently not part of the official Singular.
convSingPFlintP
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
convSingNFlintN
void convSingNFlintN(fmpz_t f, mpz_t z)
convFlintNmod_matSingM
matrix convFlintNmod_matSingM(nmod_mat_t m, const ring r)
convSingNFlintNN
void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
convSingIFlintI
void convSingIFlintI(fmpz_t f, int p)
singflint_kernel
matrix singflint_kernel(matrix m, const ring R)
convSingNFlintN_QQ
void convSingNFlintN_QQ(fmpq_t f, number n)
convFlintNSingN
void convFlintNSingN(mpz_t z, fmpz_t f)
singflint_rref
matrix singflint_rref(matrix m, const ring R)
convFlintPSingP
poly convFlintPSingP(fmpq_poly_t f, const ring r)
convSingImPFlintP
void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
convFlintISingI
int convFlintISingI(fmpz_t f)
convFlintNSingN_QQ
number convFlintNSingN_QQ(fmpq_t f, const coeffs cf)
singflint_LLL
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
convSingMFlintNmod_mat
void convSingMFlintNmod_mat(matrix m, nmod_mat_t M, const ring r)
IMATELEM
#define IMATELEM(M, I, J)
Definition intvec.h:86
T
STATIC_VAR jList * T
Definition janet.cc:30
h
STATIC_VAR Poly * h
Definition janet.cc:971
nlMPZ
void nlMPZ(mpz_t m, number &n, const coeffs r)
get numerator as mpz_t
Definition longrat.cc:2790
longrat.h
SR_INT
#define SR_INT
Definition longrat.h:67
SR_TO_INT
#define SR_TO_INT(SR)
Definition longrat.h:69
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition matpol.cc:37
MATELEM
#define MATELEM(mat, i, j)
1-based access to matrix
Definition matpol.h:29
matrix
ip_smatrix * matrix
Definition matpol.h:43
MATROWS
#define MATROWS(i)
Definition matpol.h:26
MATCOLS
#define MATCOLS(i)
Definition matpol.h:27
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
pIter
#define pIter(p)
Definition monomials.h:37
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
p_GetCoeff
#define p_GetCoeff(p, r)
Definition monomials.h:50
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
NULL
#define NULL
Definition omList.c:12
p_ISet
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition p_polys.cc:1298
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition p_polys.cc:1474
p_Deg
long p_Deg(poly a, const ring r)
Definition p_polys.cc:586
p_polys.h
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition p_polys.h:938
p_SetExp
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition p_polys.h:490
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition p_polys.h:249
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition p_polys.h:471
p_Init
static poly p_Init(const ring r, omBin bin)
Definition p_polys.h:1341
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
p_Test
#define p_Test(p, r)
Definition p_polys.h:161
rChar
int rChar(ring r)
Definition ring.cc:719
rField_is_Zp
static BOOLEAN rField_is_Zp(const ring r)
Definition ring.h:506
rField_is_Q
static BOOLEAN rField_is_Q(const ring r)
Definition ring.h:512
rintegers.h
nrzInit
number nrzInit(long i, const coeffs r)
sbuckets.h
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
simpleideals.h
R
#define R
Definition sirandom.c:27
M
#define M
Definition sirandom.c:25
SR_HDL
#define SR_HDL(A)
Definition tgb.cc:35