Loading...
Searching...
No Matches
flintcf_Zn.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: flint: nmod_poly_t
*/
#include <ctype.h> /* isdigit*/
#include "misc/auxiliary.h"
#ifdef HAVE_FLINT
#include <flint/flint.h>
#include <flint/nmod_poly.h>
#include "factory/factory.h"
#include "coeffs/coeffs.h"
#include "coeffs/numbers.h"
#include "coeffs/longrat.h"
#include "coeffs/modulop.h"
#include "coeffs/flintcf_Zn.h"
typedef nmod_poly_struct *nmod_poly_ptr;
/*2
* extracts a long integer from s, returns the rest
*/
static const char* Eati(const char *s, int *i)
{
if (((*s) >= '0') && ((*s) <= '9'))
{
unsigned long ii=0L;
do
{
ii *= 10;
ii += *s++ - '0';
}
while (((*s) >= '0') && ((*s) <= '9'));
*i=(int)ii;
}
else (*i) = 1;
return s;
}
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void * parameter)
{
flintZn_struct *pp=(flintZn_struct*)parameter;
return (r->type==n) &&(r->ch==pp->ch)
&&(r->pParameterNames!=NULL)
&&(strcmp(r->pParameterNames[0],pp->name)==0);
}
static void KillChar(coeffs cf)
{
omFree((ADDRESS)(cf->pParameterNames[0]));
omFreeSize(cf->pParameterNames,sizeof(char*));
}
static void SetChar(const coeffs r)
{
// dummy
}
static number Mult(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(*res));
nmod_poly_init(res,c->ch);
nmod_poly_mul(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number Sub(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,c->ch);
nmod_poly_sub(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number Add(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,c->ch);
nmod_poly_add(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number Div(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,c->ch);
if(nmod_poly_is_zero((nmod_poly_ptr)b))
{
WerrorS(nDivBy0);
}
else
{
nmod_poly_div(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
nmod_poly_t mod;
nmod_poly_init(mod,c->ch);
nmod_poly_rem(mod,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
if (!nmod_poly_is_zero((nmod_poly_ptr)mod))
{
WerrorS("cannot divide");
}
nmod_poly_clear(mod);
}
return (number)res;
}
static number ExactDiv(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,c->ch);
if(nmod_poly_is_zero((nmod_poly_ptr)b))
{
WerrorS(nDivBy0);
}
else
nmod_poly_div(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number IntMod(number a, number b, const coeffs c)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,c->ch);
nmod_poly_rem(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number Init (long i, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
i= i%r->ch;
if (i<0) i+=r->ch;
nmod_poly_set_coeff_ui(res,0,i);
return (number)res;
}
static number InitMPZ (mpz_t i, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
mpz_t tmp;
mpz_init(tmp);
slong ii=mpz_mod_ui(tmp,i,r->ch);
mpz_clear(tmp);
nmod_poly_set_coeff_ui(res,0,ii);
return (number)res;
}
static int Size (number n, const coeffs r)
{
return nmod_poly_degree((nmod_poly_ptr)n);
}
static long Int (number &n, const coeffs r)
{
if (nmod_poly_degree((nmod_poly_ptr)n)==0)
{
slong m;
m=nmod_poly_get_coeff_ui((nmod_poly_ptr)n,0);
return (long)m;
}
return 0;
}
static void MPZ(mpz_t result, number &n, const coeffs r)
{
mpz_init(result);
if (nmod_poly_degree((nmod_poly_ptr)n)==0)
{
slong m;
m=nmod_poly_get_coeff_ui((nmod_poly_ptr)n,0);
mpz_set_ui(result,m);
}
}
static number Neg(number a, const coeffs r)
{
nmod_poly_neg((nmod_poly_ptr)a,(nmod_poly_ptr)a);
return a;
}
static number Invers(number a, const coeffs r)
{
if(nmod_poly_is_zero((nmod_poly_ptr)a))
{
WerrorS(nDivBy0);
return NULL;
}
if (nmod_poly_degree((nmod_poly_ptr)a)==0)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
slong c=nmod_poly_get_coeff_ui((nmod_poly_ptr)a,0);
extern number nvInvers (number c, const coeffs r);
c=(slong)nvInvers((number)c,r);
nmod_poly_set_coeff_ui((nmod_poly_ptr)a,0,c);
return (number)res;
}
else
{
WerrorS("not invertable");
return NULL;
}
}
static number Copy(number a, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
nmod_poly_set(res,(nmod_poly_ptr)a);
return (number)res;
}
//static number RePart(number a, const coeffs r)
//{
//}
//static number ImPart(number a, const coeffs r)
//{
//}
static BOOLEAN IsOne (number a, const coeffs r);
static BOOLEAN IsZero (number a, const coeffs r);
//static void WriteLong(number &a, const coeffs r)
//{
//}
static void WriteShort(number a, const coeffs r)
{
//nmod_poly_print_pretty((nmod_poly_ptr)a,r->pParameterNames[0]);
if (IsOne(a,r)) StringAppendS("1");
else if (IsZero(a,r)) StringAppendS("0");
else
{
StringAppendS("(");
BOOLEAN need_plus=FALSE;
for(int i=nmod_poly_length((nmod_poly_ptr)a);i>=0;i--)
{
slong m=nmod_poly_get_coeff_ui((nmod_poly_ptr)a,i);
if (m!=0)
{
if (need_plus) StringAppendS("+");
need_plus=TRUE;
if (i>0)
{
if (m!=1) StringAppend("%d*",(int)m);
if (i>1)
StringAppend("%s^%d",r->pParameterNames[0],i);
else if (i==1)
StringAppend("%s",r->pParameterNames[0]);
}
else StringAppend("%d",(int)m);
}
}
StringAppendS(")");
}
}
static const char* Read(const char * st, number * a, const coeffs r)
{
// we only read "monomials" (i.e. [-][digits][parameter]),
// everything else (+,*,^,()) is left to the singular interpreter
const char *s=st;
*a=(number)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init((nmod_poly_ptr)(*a),r->ch);
BOOLEAN neg=FALSE;
if (*s=='-') { neg=TRUE; s++;}
if (isdigit(*s))
{
int z;
s=Eati((char *)s, &z);
nmod_poly_set_coeff_ui((nmod_poly_ptr)(*a),0,z);
}
else if(strncmp(s,r->pParameterNames[0],strlen(r->pParameterNames[0]))==0)
{
nmod_poly_set_coeff_ui((nmod_poly_ptr)(*a),1,1);
s+=strlen(r->pParameterNames[0]);
if(isdigit(*s))
{
int i=1;
s=Eati(s,&i);
if (i!=1)
{
nmod_poly_set_coeff_ui((nmod_poly_ptr)(*a),1,0);
nmod_poly_set_coeff_ui((nmod_poly_ptr)(*a),i,1);
}
}
}
if (neg)
nmod_poly_neg((nmod_poly_ptr)(*a),(nmod_poly_ptr)(*a));
return s;
}
static void Normalize(number &a, const coeffs r)
{
}
static BOOLEAN Greater (number a, number b, const coeffs r)
{
if (nmod_poly_length((nmod_poly_ptr)a)>nmod_poly_length((nmod_poly_ptr)b))
return TRUE;
else if (nmod_poly_length((nmod_poly_ptr)a)<nmod_poly_length((nmod_poly_ptr)b))
return FALSE;
for(int i=nmod_poly_length((nmod_poly_ptr)a);i>=0;i--)
{
slong ac=nmod_poly_get_coeff_ui((nmod_poly_ptr)a,i);
slong bc=nmod_poly_get_coeff_ui((nmod_poly_ptr)b,i);
if (ac>bc) return TRUE;
else if (ac<bc) return FALSE;
}
return FALSE;
}
static BOOLEAN Equal (number a, number b, const coeffs r)
{
return (nmod_poly_equal((nmod_poly_ptr)a,(nmod_poly_ptr)b));
}
static BOOLEAN IsZero (number a, const coeffs r)
{
return nmod_poly_is_zero((nmod_poly_ptr)a);
}
static BOOLEAN IsOne (number a, const coeffs r)
{
return nmod_poly_is_one((nmod_poly_ptr)a);
}
static BOOLEAN IsMOne (number k, const coeffs r)
{
if (nmod_poly_length((nmod_poly_ptr)k)>0) return FALSE;
slong m=nmod_poly_get_coeff_ui((nmod_poly_ptr)k,0);
return (m+1==r->ch);
}
static BOOLEAN GreaterZero (number k, const coeffs r)
{
// does it have a leading sign?
// no: 0 and 1 do not have, everything else is in (...)
return TRUE;
}
static void Power(number a, int i, number * result, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
*result=(number)res;
nmod_poly_pow((nmod_poly_ptr)(*result),(nmod_poly_ptr)a,i);
}
static number Gcd(number a, number b, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
nmod_poly_gcd(res,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number ExtGcd(number a, number b, number *s, number *t,const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
nmod_poly_init((nmod_poly_ptr)*s,r->ch);
nmod_poly_init((nmod_poly_ptr)*t,r->ch);
nmod_poly_xgcd(res,(nmod_poly_ptr)*s,(nmod_poly_ptr)*t,(nmod_poly_ptr)a,(nmod_poly_ptr)b);
return (number)res;
}
static number Lcm(number a, number b, const coeffs r)
{
WerrorS("not yet: Lcm");
return NULL;
}
static void Delete(number * a, const coeffs r)
{
if ((*a)!=NULL)
{
nmod_poly_clear((nmod_poly_ptr)*a);
omFree(*a);
*a=NULL;
}
}
static nMapFunc SetMap(const coeffs src, const coeffs dst)
{
WerrorS("not yet: SetMap");
return NULL;
}
//static void InpMult(number &a, number b, const coeffs r)
//{
//}
//static void InpAdd(number &a, number b, const coeffs r)
//{
//}
static number Init_bigint(number i, const coeffs dummy, const coeffs dst)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,dst->ch);
long ii;
if (SR_HDL(i) & SR_INT)
{
ii=SR_TO_INT(i) % dst->ch;
}
else
{
mpz_t tmp;
mpz_init(tmp);
ii=mpz_mod_ui(tmp,i->z,dst->ch);
mpz_clear(tmp);
}
if (ii<0) ii+=dst->ch;
nmod_poly_set_coeff_ui(res,0,ii);
return (number)res;
}
static number Farey(number p, number n, const coeffs)
{
WerrorS("not yet: Farey");
return NULL;
}
static number ChineseRemainder(number *x, number *q,int rl, BOOLEAN sym,CFArray &inv_cache,const coeffs)
{
WerrorS("not yet: ChineseRemainder");
return NULL;
}
static int ParDeg(number x,const coeffs r)
{
return nmod_poly_degree((nmod_poly_ptr)x);
}
static number Parameter(const int i, const coeffs r)
{
nmod_poly_ptr res=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(res,r->ch);
nmod_poly_set_coeff_ui(res,1,1);
return (number)res;
}
// cfClearContent
// cfClearDenominators
#if 0
static number ConvFactoryNSingN( const CanonicalForm n, const coeffs r)
{
WerrorS("not yet: ConvFactoryNSingN");
return NULL;
}
#endif
#if 0
static CanonicalForm ConvSingNFactoryN( number n, BOOLEAN setChar, const coeffs r )
{
WerrorS("not yet: ConvSingNFactoryN");
return CanonicalForm(0);
}
#endif
static char * CoeffName(const coeffs r)
{
STATIC_VAR char CoeffName_flint_Zn[20];
snprintf(CoeffName_flint_Zn,20,"flint:Z/%d[%s]",r->ch,r->pParameterNames[0]);
return (char*)CoeffName_flint_Zn;
}
coeffs flintZnInitCfByName(char *s,n_coeffType n)
{
const char start[]="flint:Z/";
const int start_len=strlen(start);
if (strncmp(s,start,start_len)==0)
{
s+=start_len;
int p;
char st[10];
int l=sscanf(s,"%d[%s",&p,st);
if (l==2)
{
flintZn_struct info;
info.ch=p;
while (st[strlen(st)-1]==']') st[strlen(st)-1]='\0';
info.name=st;
return nInitChar(n,(void*)&info);
}
}
return NULL;
}
static void WriteFd(number a, const ssiInfo *d, const coeffs)
{
// format: len a_len .. a_0
nmod_poly_ptr aa=(nmod_poly_ptr)a;
int l=nmod_poly_length(aa);
fprintf(d->f_write,"%d ",l);
for(int i=l; i>=0; i--)
{
ulong ul=nmod_poly_get_coeff_ui(aa,i);
fprintf(d->f_write,"%lu ", ul);
}
}
static number ReadFd(const ssiInfo *d, const coeffs r)
{
// format: len a_len .. a_0
nmod_poly_ptr aa=(nmod_poly_ptr)omAlloc(sizeof(nmod_poly_t));
nmod_poly_init(aa,r->ch);
int l=s_readint(d->f_read);
unsigned long ul;
for (int i=l;i>=0;i--)
{
unsigned long ul=s_readlong(d->f_read);
nmod_poly_set_coeff_ui(aa,i,ul);
}
return (number)aa;
}
#ifdef LDEBUG
static BOOLEAN DBTest(number a, const char *f, const int l, const coeffs r)
{
return TRUE;
}
#endif
BOOLEAN flintZn_InitChar(coeffs cf, void * infoStruct)
{
flintZn_struct *pp=(flintZn_struct*)infoStruct;
cf->ch=pp->ch;
cf->cfCoeffName = CoeffName;
cf->nCoeffIsEqual = CoeffIsEqual;
cf->cfKillChar = KillChar;
cf->cfSetChar = SetChar;
cf->cfMult = Mult;
cf->cfSub = Sub;
cf->cfAdd = Add;
cf->cfDiv = Div;
cf->cfExactDiv = ExactDiv; // ???
cf->cfInit = Init;
cf->cfInitMPZ = InitMPZ;
cf->cfSize = Size;
cf->cfInt = Int;
cf->cfMPZ = MPZ;
cf->cfInpNeg = Neg;
cf->cfInvers = Invers;
cf->cfCopy = Copy;
cf->cfRePart = Copy;
// default: cf->cfImPart = ndReturn0;
cf->cfWriteLong = WriteShort; //WriteLong;
cf->cfWriteShort = WriteShort;
cf->cfRead = Read;
cf->cfNormalize = Normalize;
//cf->cfDivComp=
//cf->cfIsUnit=
//cf->cfGetUnit=
//cf->cfDivBy=
cf->cfGreater=Greater;
cf->cfEqual =Equal;
cf->cfIsZero =IsZero;
cf->cfIsOne =IsOne;
cf->cfIsMOne =IsMOne;
cf->cfGreaterZero=GreaterZero;
cf->cfPower = Power;
//default: cf->cfGetDenom = GetDenom;
//default: cf->cfGetNumerator = GetNumerator;
cf->cfGcd = Gcd;
cf->cfExtGcd = ExtGcd;
cf->cfLcm = Lcm;
cf->cfDelete = Delete;
cf->cfSetMap = SetMap;
// default: cf->cfInpMult
// default: cf->cfInpAdd
cf->cfFarey =Farey;
cf->cfChineseRemainder=ChineseRemainder;
cf->cfParDeg = ParDeg;
cf->cfParameter = Parameter;
// cf->cfClearContent = ClearContent;
// cf->cfClearDenominators = ClearDenominators;
//cf->convFactoryNSingN=ConvFactoryNSingN;
//cf->convSingNFactoryN=ConvSingNFactoryN;
cf->cfWriteFd = WriteFd;
cf->cfReadFd = ReadFd;
#ifdef LDEBUG
cf->cfDBTest = DBTest;
#endif
cf->iNumberOfParameters = 1;
char **pn=(char**)omAlloc0(sizeof(char*));
pn[0]=(char*)omStrDup(pp->name);
cf->pParameterNames = (const char **)pn;
cf->has_simple_Inverse= FALSE;
cf->has_simple_Alloc= FALSE;
cf->is_field=FALSE;
return FALSE;
}
#endif
auxiliary.h
All the auxiliary stuff.
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
mod
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
l
int l
Definition cfEzgcd.cc:100
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
k
int k
Definition cfEzgcd.cc:99
x
Variable x
Definition cfModGcd.cc:4090
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
CanonicalForm
factory's main class
Definition canonicalform.h:86
coeffs.h
Coefficient rings, fields and other domains suitable for Singular polynomials.
n_coeffType
n_coeffType
Definition coeffs.h:27
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
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
StringAppend
#define StringAppend
Definition emacs.cc:79
result
return result
Definition facAbsBiFact.cc:76
slong
#define slong
s
const CanonicalForm int s
Definition facAbsFact.cc:51
res
CanonicalForm res
Definition facAbsFact.cc:60
nmod_poly_init
nmod_poly_init(FLINTmipo, getCharacteristic())
nmod_poly_clear
nmod_poly_clear(FLINTmipo)
factory.h
factory.h' is the user interface to Factory.
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
ExtGcd
static number ExtGcd(number a, number b, number *s, number *t, const coeffs)
Definition flintcf_Q.cc:447
WriteShort
static void WriteShort(number a, const coeffs r)
Definition flintcf_Q.cc:233
Copy
static number Copy(number a, const coeffs)
Definition flintcf_Q.cc:215
ChineseRemainder
static number ChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs)
Definition flintcf_Q.cc:500
Normalize
static void Normalize(number &a, const coeffs)
Definition flintcf_Q.cc:373
SetChar
static void SetChar(const coeffs)
Definition flintcf_Q.cc:53
SetMap
static nMapFunc SetMap(const coeffs, const coeffs)
Definition flintcf_Q.cc:470
Farey
static number Farey(number, number, const coeffs)
Definition flintcf_Q.cc:495
Read
static const char * Read(const char *st, number *a, const coeffs r)
Definition flintcf_Q.cc:326
IsOne
static BOOLEAN IsOne(number a, const coeffs)
Definition flintcf_Q.cc:389
CoeffName
char * CoeffName(const coeffs r)
Definition flintcf_Q.cc:601
ConvFactoryNSingN
static number ConvFactoryNSingN(const CanonicalForm, const coeffs)
Definition flintcf_Q.cc:591
InitMPZ
static number InitMPZ(mpz_t i, const coeffs)
Definition flintcf_Q.cc:128
Size
static int Size(number n, const coeffs)
Definition flintcf_Q.cc:139
Add
static number Add(number a, number b, const coeffs)
Definition flintcf_Q.cc:71
Div
static number Div(number a, number b, const coeffs)
Definition flintcf_Q.cc:78
WriteFd
static void WriteFd(number a, const ssiInfo *d, const coeffs)
Definition flintcf_Q.cc:516
Delete
static void Delete(number *a, const coeffs)
Definition flintcf_Q.cc:461
Parameter
static number Parameter(const int, const coeffs)
Definition flintcf_Q.cc:509
DBTest
static BOOLEAN DBTest(number, const char *, const int, const coeffs)
Definition flintcf_Q.cc:626
KillChar
static void KillChar(coeffs cf)
Definition flintcf_Q.cc:631
ConvSingNFactoryN
static CanonicalForm ConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition flintcf_Q.cc:596
Init
static number Init(long i, const coeffs)
Definition flintcf_Q.cc:121
MPZ
static void MPZ(mpz_t result, number &n, const coeffs)
Definition flintcf_Q.cc:159
ReadFd
static number ReadFd(const ssiInfo *d, const coeffs)
Definition flintcf_Q.cc:561
ExactDiv
static number ExactDiv(number a, number b, const coeffs)
Definition flintcf_Q.cc:100
Power
static void Power(number a, int i, number *result, const coeffs)
Definition flintcf_Q.cc:416
IsMOne
static BOOLEAN IsMOne(number k, const coeffs)
Definition flintcf_Q.cc:393
Sub
static number Sub(number a, number b, const coeffs)
Definition flintcf_Q.cc:64
GreaterZero
static BOOLEAN GreaterZero(number, const coeffs)
Definition flintcf_Q.cc:410
Gcd
static number Gcd(number a, number b, const coeffs)
Definition flintcf_Q.cc:440
CoeffIsEqual
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *)
Definition flintcf_Q.cc:49
Mult
static number Mult(number a, number b, const coeffs)
Definition flintcf_Q.cc:57
Invers
static number Invers(number a, const coeffs)
Definition flintcf_Q.cc:195
Lcm
static number Lcm(number, number, const coeffs)
Definition flintcf_Q.cc:456
ParDeg
static int ParDeg(number x, const coeffs)
Definition flintcf_Q.cc:505
IsZero
static BOOLEAN IsZero(number a, const coeffs)
Definition flintcf_Q.cc:385
Neg
static number Neg(number a, const coeffs)
Definition flintcf_Q.cc:190
Equal
static BOOLEAN Equal(number a, number b, const coeffs)
Definition flintcf_Q.cc:381
Int
static long Int(number &n, const coeffs)
Definition flintcf_Q.cc:143
WriteShort
static void WriteShort(number a, const coeffs r)
Definition flintcf_Zn.cc:215
CoeffName
static char * CoeffName(const coeffs r)
Definition flintcf_Zn.cc:426
Lcm
static number Lcm(number a, number b, const coeffs r)
Definition flintcf_Zn.cc:344
MPZ
static void MPZ(mpz_t result, number &n, const coeffs r)
Definition flintcf_Zn.cc:159
Neg
static number Neg(number a, const coeffs r)
Definition flintcf_Zn.cc:169
Greater
static BOOLEAN Greater(number a, number b, const coeffs r)
Definition flintcf_Zn.cc:282
Read
static const char * Read(const char *st, number *a, const coeffs r)
Definition flintcf_Zn.cc:245
Mult
static number Mult(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:63
Init_bigint
static number Init_bigint(number i, const coeffs dummy, const coeffs dst)
Definition flintcf_Zn.cc:369
Sub
static number Sub(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:70
Int
static long Int(number &n, const coeffs r)
Definition flintcf_Zn.cc:149
Init
static number Init(long i, const coeffs r)
Definition flintcf_Zn.cc:125
CoeffIsEqual
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition flintcf_Zn.cc:47
Normalize
static void Normalize(number &a, const coeffs r)
Definition flintcf_Zn.cc:279
Gcd
static number Gcd(number a, number b, const coeffs r)
Definition flintcf_Zn.cc:328
ExtGcd
static number ExtGcd(number a, number b, number *s, number *t, const coeffs r)
Definition flintcf_Zn.cc:335
WriteFd
static void WriteFd(number a, const ssiInfo *d, const coeffs)
Definition flintcf_Zn.cc:453
GreaterZero
static BOOLEAN GreaterZero(number k, const coeffs r)
Definition flintcf_Zn.cc:315
DBTest
static BOOLEAN DBTest(number a, const char *f, const int l, const coeffs r)
Definition flintcf_Zn.cc:481
Delete
static void Delete(number *a, const coeffs r)
Definition flintcf_Zn.cc:349
ReadFd
static number ReadFd(const ssiInfo *d, const coeffs r)
Definition flintcf_Zn.cc:466
flintZn_InitChar
BOOLEAN flintZn_InitChar(coeffs cf, void *infoStruct)
Definition flintcf_Zn.cc:486
KillChar
static void KillChar(coeffs cf)
Definition flintcf_Zn.cc:54
nmod_poly_ptr
nmod_poly_struct * nmod_poly_ptr
Definition flintcf_Zn.cc:24
Copy
static number Copy(number a, const coeffs r)
Definition flintcf_Zn.cc:197
InitMPZ
static number InitMPZ(mpz_t i, const coeffs r)
Definition flintcf_Zn.cc:134
Div
static number Div(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:84
Power
static void Power(number a, int i, number *result, const coeffs r)
Definition flintcf_Zn.cc:321
Equal
static BOOLEAN Equal(number a, number b, const coeffs r)
Definition flintcf_Zn.cc:297
Add
static number Add(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:77
IsOne
static BOOLEAN IsOne(number a, const coeffs r)
Definition flintcf_Zn.cc:305
Farey
static number Farey(number p, number n, const coeffs)
Definition flintcf_Zn.cc:389
IsZero
static BOOLEAN IsZero(number a, const coeffs r)
Definition flintcf_Zn.cc:301
ParDeg
static int ParDeg(number x, const coeffs r)
Definition flintcf_Zn.cc:399
SetMap
static nMapFunc SetMap(const coeffs src, const coeffs dst)
Definition flintcf_Zn.cc:358
ChineseRemainder
static number ChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
Definition flintcf_Zn.cc:394
IsMOne
static BOOLEAN IsMOne(number k, const coeffs r)
Definition flintcf_Zn.cc:309
SetChar
static void SetChar(const coeffs r)
Definition flintcf_Zn.cc:59
Eati
static const char * Eati(const char *s, int *i)
Definition flintcf_Zn.cc:29
Parameter
static number Parameter(const int i, const coeffs r)
Definition flintcf_Zn.cc:403
Invers
static number Invers(number a, const coeffs r)
Definition flintcf_Zn.cc:174
IntMod
static number IntMod(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:118
Size
static int Size(number n, const coeffs r)
Definition flintcf_Zn.cc:145
flintZnInitCfByName
coeffs flintZnInitCfByName(char *s, n_coeffType n)
Definition flintcf_Zn.cc:432
ExactDiv
static number ExactDiv(number a, number b, const coeffs c)
Definition flintcf_Zn.cc:106
flintcf_Zn.h
flintZn_struct
Definition flintcf_Zn.h:17
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
Greater
static bool Greater(mono_type m1, mono_type m2)
Definition interpolation.cc:285
info
#define info
Definition libparse.cc:1256
longrat.h
SR_INT
#define SR_INT
Definition longrat.h:67
SR_TO_INT
#define SR_TO_INT(SR)
Definition longrat.h:69
nvInvers
number nvInvers(number c, const coeffs r)
Definition modulop.cc:682
modulop.h
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
numbers.h
nDivBy0
const char *const nDivBy0
Definition numbers.h:90
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
StringAppendS
void StringAppendS(const char *st)
Definition reporter.cc:107
s_readint
int s_readint(s_buff F)
Definition s_buff.cc:113
s_readlong
long s_readlong(s_buff F)
Definition s_buff.cc:160
ssiInfo::f_read
s_buff f_read
Definition s_buff.h:22
ssiInfo::f_write
FILE * f_write
Definition s_buff.h:23
ssiInfo
Definition s_buff.h:21
SR_HDL
#define SR_HDL(A)
Definition tgb.cc:35