Loading...
Searching...
No Matches
numbers.cc
Go to the documentation of this file.
/*****************************************
* Computer Algebra System SINGULAR *
*****************************************/
/*
* ABSTRACT: interface to coefficient aritmetics
*/
#include <string.h>
#include <stdlib.h>
#include "misc/auxiliary.h"
#include "misc/mylimits.h"
#include "factory/factory.h"
#include "reporter/reporter.h"
#include "coeffs/coeffs.h"
#include "coeffs/numbers.h"
#include "coeffs/longrat.h"
#include "coeffs/modulop.h"
#include "coeffs/gnumpfl.h"
#include "coeffs/gnumpc.h"
#include "coeffs/ffields.h"
#include "coeffs/shortfl.h"
#include "coeffs/ntupel.h"
#include "coeffs/flintcf_Qrat.h"
#include "coeffs/rmodulo2m.h"
#include "coeffs/rmodulon.h"
#include "coeffs/rintegers.h"
#ifdef HAVE_POLYEXTENSIONS
#include "polys/ext_fields/algext.h"
#include "polys/ext_fields/transext.h"
#endif
//static int characteristic = 0;
//extern int IsPrime(int p);
VAR n_Procs_s *cf_root=NULL;
static void ndDelete(number* d, const coeffs) { *d=NULL; }
static number ndAnn(number, const coeffs cf) { WarnS("cfAnn undefined"); return n_Init(0,cf); }
static char* ndCoeffString(const coeffs r)
{
return omStrDup(r->cfCoeffName(r));
}
static void ndCoeffWrite(const coeffs r,BOOLEAN)
{
PrintS(r->cfCoeffName(r));
}
static char* ndCoeffName(const coeffs r)
{
STATIC_VAR char s[20];
snprintf(s,11,"Coeffs(%d)",r->type);
return s;
}
static void ndInpMult(number &a, number b, const coeffs r)
{
number n=r->cfMult(a,b,r);
r->cfDelete(&a,r);
a=n;
}
static void ndInpAdd(number &a, number b, const coeffs r)
{
number n=r->cfAdd(a,b,r);
r->cfDelete(&a,r);
a=n;
}
static void ndPower(number a, int i, number * res, const coeffs r)
{
if (i==0)
{
*res = r->cfInit(1, r);
}
else if (i==1)
{
*res = r->cfCopy(a, r);
}
else if (i==2)
{
*res = r->cfMult(a, a, r);
}
else if (i<0)
{
number b = r->cfInvers(a, r);
ndPower(b, -i, res, r);
r->cfDelete(&b, r);
}
else
{
ndPower(a, i/2, res, r);
r->cfInpMult(*res, *res, r);
if (i&1)
{
r->cfInpMult(*res, a, r);
}
}
}
static number ndInvers(number a, const coeffs r)
{
number one=r->cfInit(1,r);
number res=r->cfDiv(one,a,r);
r->cfDelete(&one,r);
return res;
}
static number ndInvers_Ring(number a, const coeffs r)
{
if (!r->cfIsUnit(a,r)) Print("ndInvers_Ring used with non-unit\n");
number one=r->cfInit(1,r);
number res=r->cfDiv(one,a,r);
r->cfDelete(&one,r);
return res;
}
static BOOLEAN ndIsUnit_Ring(number a, const coeffs r)
{ return r->cfIsOne(a,r)|| r->cfIsMOne(a,r); }
static BOOLEAN ndIsUnit_Field(number a, const coeffs r)
{ return !r->cfIsZero(a,r); }
static number ndGetUnit_Ring(number, const coeffs r)
{ return r->cfInit(1,r); }
static number ndRandom(siRandProc p, number, number, const coeffs cf)
{ return cf->cfInit(p(),cf); }
static number ndEucNorm(number a, const coeffs cf)
{ return cf->cfInit(cf->cfSize(a,cf),cf); }
#ifdef LDEBUG
// static void nDBDummy1(number* d,char *, int) { *d=NULL; }
static BOOLEAN ndDBTest(number, const char *, const int, const coeffs){ return TRUE; }
#endif
static number ndFarey(number,number,const coeffs r)
{
Werror("farey not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
return n_Init(0,r);
}
static number ndXExtGcd(number, number, number *, number *, number *, number *, const coeffs r)
{
Werror("XExtGcd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
return n_Init(0,r);
}
static number ndChineseRemainder(number *,number *,int,BOOLEAN,CFArray&,const coeffs r)
{
Werror("ChineseRemainder not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
return r->cfInit(0,r);
}
number ndReadFd( const ssiInfo *, const coeffs r)
{
Warn("ReadFd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
return n_Init(0,r);
}
number ndReadFd_S( char**, const coeffs r)
{
Warn("ReadFd_S not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
return n_Init(0,r);
}
static void ndWriteFd(number, const ssiInfo *, const coeffs r)
{
Warn("WriteFd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
}
static int ndParDeg(number n, const coeffs r)
{
return (-r->cfIsZero(n,r));
}
static number ndParameter(const int, const coeffs r)
{
return r->cfInit(1,r);
}
BOOLEAN n_IsZeroDivisor( number a, const coeffs r)
{
BOOLEAN ret = n_IsZero(a, r);
int c = n_GetChar(r);
if (ret || (c==0) || (r->is_field))
return ret; /*n_IsZero(a, r)*/
number ch = n_Init( c, r );
number g = n_Gcd( ch, a, r );
ret = !n_IsOne (g, r);
n_Delete(&ch, r);
n_Delete(&g, r);
return ret;
}
void ndNormalize(number&, const coeffs) { }
static number ndReturn0(number, const coeffs r) { return r->cfInit(0,r); }
number ndGcd(number, number, const coeffs r) { return r->cfInit(1,r); }
static number ndIntMod(number a, number b, const coeffs R)
{
if (R->is_field)
return R->cfInit(0,R);
else // implementation for a non-field:
{
number d=n_Div(a,b,R);
number p=n_Mult(b,d,R);
number r=n_Sub(a,p,R);
n_Delete(&p,R);
n_Delete(&d,R);
return r;
}
}
static number ndGetDenom(number &, const coeffs r) { return r->cfInit(1,r); }
static number ndGetNumerator(number &a,const coeffs r) { return r->cfCopy(a,r); }
static int ndSize(number a, const coeffs r) { return (int)r->cfIsZero(a,r)==FALSE; }
static void ndClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
{
assume(r != NULL);
// no fractions
assume(!( nCoeff_is_Q(r) ));
// all coeffs are given by integers!!!
numberCollectionEnumerator.Reset();
if( !numberCollectionEnumerator.MoveNext() ) // empty zero polynomial?
{
c = n_Init(1, r);
return;
}
number &curr = numberCollectionEnumerator.Current();
/// TODO: move to a separate implementation
if (nCoeff_is_Ring(r))
{
if (nCoeff_has_Units(r))
{
c = n_GetUnit(curr, r);
if (!n_IsOne(c, r))
{
number inv = n_Invers(c, r);
n_InpMult(curr, inv, r);
while( numberCollectionEnumerator.MoveNext() )
{
number &n = numberCollectionEnumerator.Current();
n_Normalize(n, r); // ?
n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
}
n_Delete(&inv, r);
}
} else c = n_Init(1, r);
return;
}
assume(!nCoeff_is_Ring(r));
assume(nCoeff_is_Zp(r) || nCoeff_is_numeric(r) || nCoeff_is_GF(r) || nCoeff_is_Zp_a(r) || nCoeff_is_Q_algExt(r));
n_Normalize(curr, r); // Q: good/bad/ugly??
if (!n_IsOne(curr, r))
{
number t = curr; // takes over the curr! note: not a reference!!!
curr = n_Init(1, r); // ???
number inv = n_Invers(t, r);
while( numberCollectionEnumerator.MoveNext() )
{
number &n = numberCollectionEnumerator.Current();
n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
// n_Normalize(n, r); // ?
}
n_Delete(&inv, r);
c = t;
} else
c = n_Copy(curr, r); // c == 1 and nothing else to do...
}
static void ndClearDenominators(ICoeffsEnumerator& /*numberCollectionEnumerator*/, number& d, const coeffs r)
{
assume( r != NULL );
assume( !(nCoeff_is_Q(r) || nCoeff_is_transExt(r) || nCoeff_is_algExt(r)) );
assume( nCoeff_is_Ring(r) || nCoeff_is_Zp(r) || nCoeff_is_numeric(r) || nCoeff_is_GF(r) );
d = n_Init(1, r);
}
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
{
// aRing and r need not be the same, but must be the same representation
assume(aRing->rep==r->rep);
if ( nCoeff_has_simple_Alloc(r) && nCoeff_has_simple_Alloc(aRing) )
return a;
else
return r->cfCopy(a, r);
}
static void ndKillChar(coeffs) {}
static void ndSetChar(const coeffs) {}
static number ndCopy(number a, const coeffs) { return a; }
number nd_Copy(number a, const coeffs r) { return r->cfCopy(a, r); }
static BOOLEAN ndDivBy(number, number, const coeffs) { return TRUE; } // assume a,b !=0
static int ndDivComp(number, number, const coeffs) { return 2; }
static number ndExtGcd (number, number, number *, number *, const coeffs r) { return r->cfInit(1,r); }
CanonicalForm ndConvSingNFactoryN( number, BOOLEAN /*setChar*/, const coeffs)
{
CanonicalForm term(0);
WerrorS("no conversion to factory");
return term;
}
static number ndConvFactoryNSingN( const CanonicalForm, const coeffs r)
{
WerrorS("no conversion from factory");
return n_Init(0,r);
}
/**< [in, out] a bigint number >= 0 */
/**< [out] the GMP equivalent */
/// Converts a non-negative bigint number into a GMP number.
static void ndMPZ(mpz_t result, number &n, const coeffs r)
{
mpz_init_set_si( result, r->cfInt(n, r) );
}
static number ndInitMPZ(mpz_t m, const coeffs r)
{
return r->cfInit( mpz_get_si(m), r);
}
static const char *ndRead(const char * s, number *n, const coeffs r)
{
*n=n_Init(1,r);
return s;
}
static nMapFunc ndSetMap(const coeffs src, const coeffs dst)
{
if (src==dst) return ndCopyMap;
Werror("cfSetMap is undefined for %s",nCoeffString(dst));
return ndCopyMap;
}
static BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void *d)
{
/* test, if r is an instance of nInitCoeffs(n,parameter) */
return (n==r->type) &&(r->data==d);
}
number ndQuotRem (number a, number b, number * r, const coeffs R)
{
// implementation for a field: r: 0, result: n_Div
if(R->is_field)
{
*r=n_Init(0,R);
return n_Div(a,b,R);
}
else
// implementation for a non-field:
{
number d=n_Div(a,b,R);
number p=n_Mult(b,d,R);
*r=n_Sub(a,p,R);
n_Delete(&p,R);
return d;
}
}
STATIC_VAR n_coeffType nLastCoeffs=n_Nemo_Ring;
VAR cfInitCharProc nInitCharTableDefault[]=
{ NULL, /*n_unknown */
npInitChar, /* n_Zp */
nlInitChar, /* n_Q */
nrInitChar, /* n_R */
nfInitChar, /* n_GF */
ngfInitChar, /* n_long_R */
#ifdef HAVE_POLYEXTENSIONS
n2pInitChar, /* n_polyExt */
naInitChar, /* n_algExt */
ntInitChar, /* n_transExt */
#else
NULL, /* n_polyExt */
NULL, /* n_algExt */
NULL, /* n_transExt */
#endif
ngcInitChar, /* n_long_C */
nnInitChar, /* n_nTupel */
nrzInitChar, /* n_Z */
nrnInitChar, /* n_Zn */
nrnInitChar, /* n_Znm */
nr2mInitChar, /* n_Z2m */
flintQrat_InitChar, /* n_FlintQrat */
NULL, /* n_CF */
NULL, /* n_Nemo_AnticNumberField */
NULL, /* n_Nemo_QQField */
NULL, /* n_Nemo_ZZRing */
NULL, /* n_Nemo_FqPolyRepField */
NULL, /* n_Nemo_fqPolyRepField */
NULL, /* n_Nemo_Field */
NULL /* n_Nemo_Ring */
};
STATIC_VAR cfInitCharProc *nInitCharTable=nInitCharTableDefault;
/*2
* init operations for coeffs r
*/
coeffs nInitChar(n_coeffType t, void * parameter)
{
n_Procs_s *n=cf_root;
while((n!=NULL) && (n->nCoeffIsEqual!=NULL) && (!n->nCoeffIsEqual(n,t,parameter)))
n=n->next;
if (n==NULL)
{
n=(n_Procs_s*)omAlloc0(sizeof(n_Procs_s));
n->next=cf_root;
n->ref=1;
n->type=t;
// default entries (different from NULL) for some routines:
n->nCoeffIsEqual = ndCoeffIsEqual;
n->cfSize = ndSize;
n->cfGetDenom= ndGetDenom;
n->cfGetNumerator= ndGetNumerator;
n->cfImPart=ndReturn0;
n->cfDelete= ndDelete;
n->cfAnn = ndAnn;
n->cfCoeffString = ndCoeffString;
n->cfCoeffWrite = ndCoeffWrite;
n->cfCoeffName = ndCoeffName; // should always be changed!
n->cfInpAdd=ndInpAdd;
n->cfInpMult=ndInpMult;
n->cfCopy = ndCopy;
n->cfIntMod=ndIntMod; /* dummy !! */
n->cfNormalize=ndNormalize;
n->cfGcd = ndGcd;
n->cfNormalizeHelper = ndGcd; /* tricky, isn't it ?*/
n->cfLcm = ndGcd; /* tricky, isn't it ?*/
n->cfInitMPZ = ndInitMPZ;
n->cfMPZ = ndMPZ;
n->cfPower = ndPower;
n->cfQuotRem = ndQuotRem;
n->cfInvers = ndInvers;
n->cfRandom = ndRandom;
n->cfKillChar = ndKillChar; /* dummy */
n->cfSetChar = ndSetChar; /* dummy */
// temp. removed to catch all the coeffs which miss to implement this!
n->cfChineseRemainder = ndChineseRemainder; /* not implemented */
n->cfFarey = ndFarey; /* not implemented */
n->cfParDeg = ndParDeg; /* not implemented */
n->cfReadFd = ndReadFd; /* not implemented */
n->cfReadFd_S = ndReadFd_S; /* not implemented */
n->cfWriteFd = ndWriteFd; /* not implemented */
n->cfParameter = ndParameter;
n->cfClearContent = ndClearContent;
n->cfClearDenominators = ndClearDenominators;
n->cfEucNorm = ndEucNorm;
n->cfDivComp = ndDivComp;
n->cfDivBy = ndDivBy;
n->cfExtGcd = ndExtGcd;
n->cfXExtGcd = ndXExtGcd;
//n->cfGetUnit = ndGetUnit_Ring;// set afterwards
// report error, if not redefined
n->cfRead=ndRead;
n->cfSetMap=ndSetMap;
#ifdef LDEBUG
n->cfDBTest=ndDBTest;
#endif
n->convSingNFactoryN=ndConvSingNFactoryN;
n->convFactoryNSingN=ndConvFactoryNSingN;
BOOLEAN nOK=TRUE;
// init
if ((t<=nLastCoeffs) && (nInitCharTable[t]!=NULL))
nOK = (nInitCharTable[t])(n,parameter);
else
Werror("Sorry: the coeff type [%d] was not registered: it is missing in nInitCharTable", (int)t);
if (nOK)
{
omFreeSize(n,sizeof(*n));
return NULL;
}
cf_root=n;
// post init settings:
if (n->cfRePart==NULL) n->cfRePart=n->cfCopy;
if (n->cfExactDiv==NULL) n->cfExactDiv=n->cfDiv;
if (n->cfSubringGcd==NULL) n->cfSubringGcd=n->cfGcd;
if (n->cfWriteShort==NULL) n->cfWriteShort = n->cfWriteLong;
if (n->cfIsUnit==NULL)
{
if (n->is_field) n->cfIsUnit=ndIsUnit_Field;
else n->cfIsUnit=ndIsUnit_Ring;
}
if (n->cfGetUnit==NULL)
{
if (n->is_field) n->cfGetUnit=n->cfCopy;
else n->cfGetUnit=ndGetUnit_Ring;
}
if ((n->cfInvers==ndInvers)&&(n->is_field))
{
n->cfInvers=ndInvers_Ring;
}
if(n->cfMult==NULL) PrintS("cfMult missing\n");
if(n->cfSub==NULL) PrintS("cfSub missing\n");
if(n->cfAdd==NULL) PrintS("cfAdd missing\n");
if(n->cfDiv==NULL) PrintS("cfDiv missing\n");
if(n->cfExactDiv==NULL) PrintS("cfExactDiv missing\n");
if(n->cfInit==NULL) PrintS("cfInit missing\n");
if(n->cfInt==NULL) PrintS("cfInt missing\n");
if(n->cfIsUnit==NULL) PrintS("cfIsUnit missing\n");
if(n->cfGetUnit==NULL) PrintS("cfGetUnit missing\n");
if(n->cfInpNeg==NULL) PrintS("cfInpNeg missing\n");
if(n->cfXExtGcd==NULL) PrintS("cfXExtGcd missing\n");
if(n->cfAnn==NULL) PrintS("cfAnn missing\n");
if(n->cfWriteLong==NULL) PrintS("cfWriteLong missing\n");
assume(n->iNumberOfParameters>= 0);
assume( (n->iNumberOfParameters == 0 && n->pParameterNames == NULL) ||
(n->iNumberOfParameters > 0 && n->pParameterNames != NULL) );
if(n->cfGreater==NULL) PrintS("cfGreater missing\n");
if(n->cfEqual==NULL) PrintS("cfEqual missing\n");
if(n->cfIsZero==NULL) PrintS("cfIsZero missing\n");
if(n->cfIsOne==NULL) PrintS("cfIsOne missing\n");
if(n->cfIsMOne==NULL) PrintS("cfIsMOne missing\n");
if(n->cfGreaterZero==NULL) PrintS("cfGreaterZero missing\n");
/* error reporter:
if(n->cfRead==ndRead) PrintS("cfRead missing\n");
if(n->cfSetMap==ndSetMap) PrintS("cfSetMap missing\n");
*/
assume(n->type==t);
#ifndef SING_NDEBUG
if(n->cfWriteLong==NULL) Warn("cfWrite is NULL for coeff %d",t);
if(n->cfWriteShort==NULL) Warn("cfWriteShort is NULL for coeff %d",t);
#endif
}
else
{
n->ref++;
}
return n;
}
void nKillChar(coeffs r)
{
if (r!=NULL)
{
r->ref--;
if (r->ref<=0)
{
n_Procs_s tmp;
n_Procs_s* n=&tmp;
tmp.next=cf_root;
while((n->next!=NULL) && (n->next!=r)) n=n->next;
if (n->next==r)
{
n->next=n->next->next;
if (cf_root==r) cf_root=n->next;
assume (r->cfKillChar!=NULL); r->cfKillChar(r);
omFreeSize((void *)r, sizeof(n_Procs_s));
r=NULL;
}
else
{
WarnS("cf_root list destroyed");
}
}
}
}
n_coeffType nRegister(n_coeffType n, cfInitCharProc p)
{
if (n==n_unknown)
{
nLastCoeffs=(n_coeffType)(int(nLastCoeffs)+1);
if (nInitCharTable==nInitCharTableDefault)
{
nInitCharTable=(cfInitCharProc*)omAlloc0(
((int)nLastCoeffs+1)*sizeof(cfInitCharProc));
memcpy(nInitCharTable,nInitCharTableDefault,
((int)nLastCoeffs)*sizeof(cfInitCharProc));
}
else
{
nInitCharTable=(cfInitCharProc*)omReallocSize(nInitCharTable,
((int)nLastCoeffs)*sizeof(cfInitCharProc),
(((int)nLastCoeffs)+1)*sizeof(cfInitCharProc));
}
nInitCharTable[nLastCoeffs]=p;
return nLastCoeffs;
}
else
{
//if (nInitCharTable[n]!=NULL) Print("coeff %d already initialized\n",n);
nInitCharTable[n]=p;
return n;
}
}
struct nFindCoeffByName_s;
typedef struct nFindCoeffByName_s* nFindCoeffByName_p;
struct nFindCoeffByName_s
{
n_coeffType n;
cfInitCfByNameProc p;
nFindCoeffByName_p next;
};
VAR nFindCoeffByName_p nFindCoeffByName_Root=NULL;
void nRegisterCfByName(cfInitCfByNameProc p,n_coeffType n)
{
nFindCoeffByName_p h=(nFindCoeffByName_p)omAlloc0(sizeof(*h));
h->p=p;
h->n=n;
h->next=nFindCoeffByName_Root;
nFindCoeffByName_Root=h;
}
coeffs nFindCoeffByName(char *cf_name)
{
n_Procs_s* n=cf_root;
// try existings coeffs:
while(n!=NULL)
{
if ((n->cfCoeffName!=NULL)
&& (strcmp(cf_name,n->cfCoeffName(n))==0)) return n;
n=n->next;
}
// TODO: parametrized cf, e.g. flint:Z/26[a]
// try existing types:
nFindCoeffByName_p p=nFindCoeffByName_Root;
while(p!=NULL)
{
coeffs cf=p->p(cf_name,p->n);
if (cf!=NULL) return cf;
p=p->next;
}
return NULL;
}
void n_Print(number& a, const coeffs r)
{
assume(r != NULL);
n_Test(a,r);
StringSetS("");
n_Write(a, r);
{ char* s = StringEndS(); Print("%s", s); omFree(s); }
}
char* nEati(char *s, int *i, int m)
{
if (((*s) >= '0') && ((*s) <= '9'))
{
unsigned long ii=0L;
do
{
ii *= 10;
ii += *s++ - '0';
if ((m!=0) && (ii > (MAX_INT_VAL / 10))) ii = ii % m;
}
while (((*s) >= '0') && ((*s) <= '9'));
if ((m!=0) && (ii>=(unsigned)m)) ii=ii%m;
*i=(int)ii;
}
else (*i) = 1;
return s;
}
char* nEati(char *s, long *i, int m)
{
if (((*s) >= '0') && ((*s) <= '9'))
{
unsigned long ii=0L;
do
{
ii *= 10;
ii += *s++ - '0';
if ((m!=0) && (ii > (LONG_MAX / 10))) ii = ii % m;
}
while (((*s) >= '0') && ((*s) <= '9'));
if ((m!=0) && (ii>=(unsigned long)m)) ii=ii%(unsigned long)m;
*i=ii;
}
else (*i) = 1L;
return s;
}
/// extracts a long integer from s, returns the rest
char * nEatLong(char *s, mpz_ptr i)
{
const char * start=s;
while (*s >= '0' && *s <= '9') s++;
if (*s=='\0')
{
mpz_set_str(i,start,10);
}
else
{
char c=*s;
*s='\0';
mpz_set_str(i,start,10);
*s=c;
}
return s;
}
naInitChar
BOOLEAN naInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition algext.cc:1433
n2pInitChar
BOOLEAN n2pInitChar(coeffs cf, void *infoStruct)
Definition algext.cc:1687
algext.h
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
CFArray
Array< CanonicalForm > CFArray
Definition canonicalform.h:397
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
g
g
Definition cfModGcd.cc:4098
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
b
CanonicalForm b
Definition cfModGcd.cc:4111
CanonicalForm
factory's main class
Definition canonicalform.h:86
IAccessor::Current
virtual reference Current()=0
Gets the current element in the collection (read and write).
IBaseEnumerator::Reset
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
IBaseEnumerator::MoveNext
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
term
Definition int_poly.h:33
coeffs.h
Coefficient rings, fields and other domains suitable for Singular polynomials.
n_Procs_s::cfReadFd_S
number(* cfReadFd_S)(char **s, const coeffs r)
Definition coeffs.h:419
n_Mult
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition coeffs.h:639
ICoeffsEnumerator
IEnumerator< number > ICoeffsEnumerator
Abstract interface for an enumerator of number coefficients for an object, e.g. a polynomial.
Definition coeffs.h:85
n_Procs_s::convSingNFactoryN
CanonicalForm(* convSingNFactoryN)(number n, BOOLEAN setChar, const coeffs r)
Definition coeffs.h:323
n_Procs_s::cfInitMPZ
number(* cfInitMPZ)(mpz_t i, const coeffs r)
init with a GMP integer
Definition coeffs.h:188
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
n_Procs_s::cfImPart
number(* cfImPart)(number a, const coeffs r)
Definition coeffs.h:208
n_Procs_s::cfCoeffString
char *(* cfCoeffString)(const coeffs r)
string output of coeff description
Definition coeffs.h:158
n_Procs_s::cfLcm
number(* cfLcm)(number a, number b, const coeffs r)
Definition coeffs.h:277
n_Procs_s::iNumberOfParameters
int iNumberOfParameters
Number of Parameters in the coeffs (default 0).
Definition coeffs.h:326
n_Procs_s::cfSubringGcd
number(* cfSubringGcd)(number a, number b, const coeffs r)
Definition coeffs.h:254
nCoeff_has_Units
static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
returns TRUE, if r is not a field and r has non-trivial units
Definition coeffs.h:792
n_Procs_s::cfIsMOne
BOOLEAN(* cfIsMOne)(number a, const coeffs r)
Definition coeffs.h:239
nCoeff_is_GF
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition coeffs.h:834
n_Procs_s::cfWriteFd
void(* cfWriteFd)(number a, const ssiInfo *f, const coeffs r)
Definition coeffs.h:284
n_Procs_s::cfIsZero
BOOLEAN(* cfIsZero)(number a, const coeffs r)
Definition coeffs.h:235
n_Procs_s::cfInvers
number(* cfInvers)(number a, const coeffs r)
return 1/a
Definition coeffs.h:204
n_Procs_s::cfMPZ
void(* cfMPZ)(mpz_t result, number &n, const coeffs r)
Converts a (integer) number n into a GMP number, 0 if impossible.
Definition coeffs.h:197
ndCopyMap
number ndCopyMap(number a, const coeffs src, const coeffs dst)
Definition numbers.cc:293
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition coeffs.h:715
n_coeffType
n_coeffType
Definition coeffs.h:27
n_Nemo_Ring
@ n_Nemo_Ring
Definition coeffs.h:55
n_unknown
@ n_unknown
Definition coeffs.h:28
n_Gcd
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ,...
Definition coeffs.h:667
n_Invers
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
Definition coeffs.h:567
n_Procs_s::cfAnn
number(* cfAnn)(number a, const coeffs r)
Definition coeffs.h:268
n_Procs_s::cfSub
numberfunc cfSub
Definition coeffs.h:182
n_Procs_s::cfDiv
numberfunc cfDiv
Definition coeffs.h:182
nCoeff_is_numeric
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition coeffs.h:827
nCoeffString
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
Definition coeffs.h:958
n_Procs_s::cfQuotRem
number(* cfQuotRem)(number a, number b, number *rem, const coeffs r)
Definition coeffs.h:276
nCoeff_is_Zp_a
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition coeffs.h:854
n_Procs_s::cfParameter
number(* cfParameter)(const int i, const coeffs r)
create i^th parameter or NULL if not possible
Definition coeffs.h:310
n_Procs_s::cfIsUnit
BOOLEAN(* cfIsUnit)(number a, const coeffs r)
Definition coeffs.h:385
n_Procs_s::cfNormalizeHelper
number(* cfNormalizeHelper)(number a, number b, const coeffs r)
Definition coeffs.h:278
n_Procs_s::cfRandom
number(* cfRandom)(siRandProc p, number p1, number p2, const coeffs cf)
a function returning random elements
Definition coeffs.h:313
n_Procs_s::cfDivBy
BOOLEAN(* cfDivBy)(number a, number b, const coeffs r)
test if b divides a cfDivBy(zero,b,r) is true, if b is a zero divisor
Definition coeffs.h:389
n_Procs_s::cfCoeffWrite
void(* cfCoeffWrite)(const coeffs r, BOOLEAN details)
output of coeff description via Print
Definition coeffs.h:155
n_Procs_s::cfInpNeg
number(* cfInpNeg)(number a, const coeffs r)
changes argument inline: a:= -a return -a! (no copy is returned) the result should be assigned to the...
Definition coeffs.h:202
n_Procs_s::cfGcd
number(* cfGcd)(number a, number b, const coeffs r)
Definition coeffs.h:253
n_Procs_s::type
n_coeffType type
Definition coeffs.h:135
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_Procs_s::cfSetChar
void(* cfSetChar)(const coeffs r)
Definition coeffs.h:168
n_Procs_s::cfAdd
numberfunc cfAdd
Definition coeffs.h:182
nCoeff_is_Q
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition coeffs.h:801
n_Procs_s::cfClearContent
nCoeffsEnumeratorFunc cfClearContent
function pointer behind n_ClearContent
Definition coeffs.h:316
n_Procs_s::cfDivComp
int(* cfDivComp)(number a, number b, const coeffs r)
Definition coeffs.h:384
n_Procs_s::cfReadFd
number(* cfReadFd)(const ssiInfo *f, const coeffs r)
Definition coeffs.h:285
n_Procs_s::cfRead
const char *(* cfRead)(const char *s, number *a, const coeffs r)
Definition coeffs.h:228
n_IsZero
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:470
n_Procs_s::convFactoryNSingN
number(* convFactoryNSingN)(const CanonicalForm n, const coeffs r)
conversion to CanonicalForm(factory) to number
Definition coeffs.h:322
n_Procs_s::cfEqual
BOOLEAN(* cfEqual)(number a, number b, const coeffs r)
tests
Definition coeffs.h:234
n_Procs_s::cfWriteLong
void(* cfWriteLong)(number a, const coeffs r)
print a given number (long format)
Definition coeffs.h:211
n_GetUnit
static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
in Z: 1 in Z/kZ (where k is not a prime): largest divisor of n (taken in Z) that is co-prime with k i...
Definition coeffs.h:537
n_Procs_s::cfDelete
void(* cfDelete)(number *a, const coeffs r)
Definition coeffs.h:279
nCoeff_has_simple_Alloc
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete is empty operation.
Definition coeffs.h:901
n_Sub
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
Definition coeffs.h:658
n_Procs_s::nCoeffIsEqual
BOOLEAN(* nCoeffIsEqual)(const coeffs r, n_coeffType n, void *parameter)
Definition coeffs.h:152
n_Procs_s::cfClearDenominators
nCoeffsEnumeratorFunc cfClearDenominators
function pointer behind n_ClearDenominators
Definition coeffs.h:319
n_Procs_s::cfExactDiv
numberfunc cfExactDiv
Definition coeffs.h:182
nCoeff_is_Ring
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition coeffs.h:732
n_Procs_s::pParameterNames
char const ** pParameterNames
array containing the names of Parameters (default NULL)
Definition coeffs.h:329
n_Procs_s::cfEucNorm
number(* cfEucNorm)(number a, const coeffs r)
Definition coeffs.h:265
n_Procs_s::cfGreaterZero
BOOLEAN(* cfGreaterZero)(number a, const coeffs r)
Definition coeffs.h:244
n_Procs_s::cfInpAdd
void(* cfInpAdd)(number &a, number b, const coeffs r)
Inplace: a += b.
Definition coeffs.h:291
n_Procs_s::cfExtGcd
number(* cfExtGcd)(number a, number b, number *s, number *t, const coeffs r)
Definition coeffs.h:255
getCoeffType
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:431
n_GetChar
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition coeffs.h:450
n_Procs_s::cfFarey
number(* cfFarey)(number p, number n, const coeffs)
rational reconstruction: "best" rational a/b with a/b = p mod n
Definition coeffs.h:298
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_Procs_s::cfWriteShort
void(* cfWriteShort)(number a, const coeffs r)
print a given number in a shorter way, if possible e.g. in K(a): a2 instead of a^2
Definition coeffs.h:215
n_Procs_s::cfSetMap
nMapFunc(* cfSetMap)(const coeffs src, const coeffs dst)
Definition coeffs.h:282
n_Procs_s::cfParDeg
int(* cfParDeg)(number x, const coeffs r)
degree for coefficients: -1 for 0, 0 for "constants", ...
Definition coeffs.h:307
n_Procs_s::cfInit
number(* cfInit)(long i, const coeffs r)
init with an integer
Definition coeffs.h:185
n_Write
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition coeffs.h:594
n_Procs_s::cfInpMult
void(* cfInpMult)(number &a, number b, const coeffs r)
Inplace: a *= b.
Definition coeffs.h:288
n_Procs_s::cfKillChar
void(* cfKillChar)(coeffs r)
Definition coeffs.h:166
nCoeff_is_Zp
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition coeffs.h:795
n_Procs_s::is_field
BOOLEAN is_field
TRUE, if cf is a field.
Definition coeffs.h:147
n_Procs_s::next
coeffs next
Definition coeffs.h:132
n_Procs_s::cfInt
long(* cfInt)(number &n, const coeffs r)
conversion to long, 0 if impossible
Definition coeffs.h:194
n_Procs_s::cfPower
void(* cfPower)(number a, int i, number *result, const coeffs r)
Definition coeffs.h:246
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_Procs_s::cfChineseRemainder
number(* cfChineseRemainder)(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
chinese remainder returns X with X mod q[i]=x[i], i=0..rl-1
Definition coeffs.h:304
n_Procs_s::cfGreater
BOOLEAN(* cfGreater)(number a, number b, const coeffs r)
Definition coeffs.h:232
n_Procs_s::cfDBTest
BOOLEAN(* cfDBTest)(number a, const char *f, const int l, const coeffs r)
Test: is "a" a correct number?
Definition coeffs.h:425
nCoeff_is_algExt
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition coeffs.h:905
n_InpMult
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
Definition coeffs.h:644
n_Procs_s::cfRePart
number(* cfRePart)(number a, const coeffs r)
Definition coeffs.h:207
n_Procs_s::ref
int ref
Definition coeffs.h:133
n_Procs_s::cfMult
numberfunc cfMult
Definition coeffs.h:182
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
n_Procs_s::cfGetUnit
number(* cfGetUnit)(number a, const coeffs r)
Definition coeffs.h:386
n_Procs_s::cfCopy
number(* cfCopy)(number a, const coeffs r)
return a copy of a
Definition coeffs.h:206
n_Procs_s::cfNormalize
void(* cfNormalize)(number &a, const coeffs r)
Definition coeffs.h:230
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
n_Procs_s::cfCoeffName
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitute cfCoeffWrite, cfCoeffString
Definition coeffs.h:161
n_Procs_s::cfIntMod
numberfunc cfIntMod
Definition coeffs.h:182
n_Procs_s::cfGetDenom
number(* cfGetDenom)(number &n, const coeffs r)
Definition coeffs.h:247
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:474
n_Procs_s::cfIsOne
BOOLEAN(* cfIsOne)(number a, const coeffs r)
Definition coeffs.h:236
n_Procs_s::cfXExtGcd
number(* cfXExtGcd)(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
Definition coeffs.h:263
n_Procs_s::cfGetNumerator
number(* cfGetNumerator)(number &n, const coeffs r)
Definition coeffs.h:248
nCoeff_is_transExt
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition coeffs.h:913
nCoeff_is_Q_algExt
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algExt(const coeffs r)
is it an alg. ext. of Q?
Definition coeffs.h:909
n_Procs_s::cfSize
int(* cfSize)(number n, const coeffs r)
how complicated, (0) => 0, or positive
Definition coeffs.h:191
n_Procs_s
Definition coeffs.h:130
Print
#define Print
Definition emacs.cc:80
Warn
#define Warn
Definition emacs.cc:77
WarnS
#define WarnS
Definition emacs.cc:78
result
return result
Definition facAbsBiFact.cc:76
s
const CanonicalForm int s
Definition facAbsFact.cc:51
res
CanonicalForm res
Definition facAbsFact.cc:60
factory.h
factory.h' is the user interface to Factory.
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
nfInitChar
BOOLEAN nfInitChar(coeffs r, void *parameter)
Definition ffields.cc:855
ffields.h
flintQrat_InitChar
BOOLEAN flintQrat_InitChar(coeffs cf, void *infoStruct)
Definition flintcf_Qrat.cc:1669
flintcf_Qrat.h
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
VAR
#define VAR
Definition globaldefs.h:5
ngcInitChar
BOOLEAN ngcInitChar(coeffs n, void *parameter)
Initialize r (n_long_C).
Definition gnumpc.cc:560
gnumpc.h
ngfInitChar
BOOLEAN ngfInitChar(coeffs n, void *parameter)
Initialize r.
Definition gnumpfl.cc:511
gnumpfl.h
h
STATIC_VAR Poly * h
Definition janet.cc:971
nlInitChar
BOOLEAN nlInitChar(coeffs r, void *p)
Definition longrat.cc:3559
longrat.h
assume
#define assume(x)
Definition mod2.h:389
npInitChar
BOOLEAN npInitChar(coeffs r, void *p)
Definition modulop.cc:351
modulop.h
mylimits.h
MAX_INT_VAL
const int MAX_INT_VAL
Definition mylimits.h:12
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
nnInitChar
BOOLEAN nnInitChar(coeffs n, void *p)
Initialize r.
Definition ntupel.cc:616
ntupel.h
ndPower
static void ndPower(number a, int i, number *res, const coeffs r)
Definition numbers.cc:74
ndIsUnit_Field
static BOOLEAN ndIsUnit_Field(number a, const coeffs r)
Definition numbers.cc:122
nRegisterCfByName
void nRegisterCfByName(cfInitCfByNameProc p, n_coeffType n)
Definition numbers.cc:631
ndConvSingNFactoryN
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition numbers.cc:313
ndReadFd
number ndReadFd(const ssiInfo *, const coeffs r)
Definition numbers.cc:150
ndDivComp
static int ndDivComp(number, number, const coeffs)
Definition numbers.cc:310
ndEucNorm
static number ndEucNorm(number a, const coeffs cf)
Definition numbers.cc:128
nFindCoeffByName_Root
VAR nFindCoeffByName_p nFindCoeffByName_Root
Definition numbers.cc:630
ndGetUnit_Ring
static number ndGetUnit_Ring(number, const coeffs r)
Definition numbers.cc:124
ndCoeffIsEqual
static BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void *d)
Definition numbers.cc:350
ndDBTest
static BOOLEAN ndDBTest(number, const char *, const int, const coeffs)
Definition numbers.cc:132
ndGcd
number ndGcd(number, number, const coeffs r)
Definition numbers.cc:193
ndKillChar
static void ndKillChar(coeffs)
Definition numbers.cc:303
ndClearDenominators
static void ndClearDenominators(ICoeffsEnumerator &, number &d, const coeffs r)
Definition numbers.cc:284
ndClearContent
static void ndClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Definition numbers.cc:212
ndParDeg
static int ndParDeg(number n, const coeffs r)
Definition numbers.cc:167
cf_root
VAR n_Procs_s * cf_root
Definition numbers.cc:43
ndCopyMap
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition numbers.cc:293
ndIsUnit_Ring
static BOOLEAN ndIsUnit_Ring(number a, const coeffs r)
Definition numbers.cc:120
ndNormalize
void ndNormalize(number &, const coeffs)
Definition numbers.cc:191
n_Print
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
Definition numbers.cc:662
nFindCoeffByName_s::next
nFindCoeffByName_p next
Definition numbers.cc:627
nEati
char * nEati(char *s, int *i, int m)
divide by the first (leading) number and return it, i.e. make monic
Definition numbers.cc:672
ndSize
static int ndSize(number a, const coeffs r)
Definition numbers.cc:210
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
ndFarey
static number ndFarey(number, number, const coeffs r)
Definition numbers.cc:135
ndRandom
static number ndRandom(siRandProc p, number, number, const coeffs cf)
Definition numbers.cc:126
ndMPZ
static void ndMPZ(mpz_t result, number &n, const coeffs r)
Converts a non-negative bigint number into a GMP number.
Definition numbers.cc:328
nLastCoeffs
STATIC_VAR n_coeffType nLastCoeffs
Definition numbers.cc:374
ndGetDenom
static number ndGetDenom(number &, const coeffs r)
Definition numbers.cc:208
ndDelete
static void ndDelete(number *d, const coeffs)
Definition numbers.cc:45
nInitCharTable
STATIC_VAR cfInitCharProc * nInitCharTable
Definition numbers.cc:408
nFindCoeffByName_s::n
n_coeffType n
Definition numbers.cc:625
ndInvers_Ring
static number ndInvers_Ring(number a, const coeffs r)
Definition numbers.cc:111
ndParameter
static number ndParameter(const int, const coeffs r)
Definition numbers.cc:172
ndReadFd_S
number ndReadFd_S(char **, const coeffs r)
Definition numbers.cc:156
ndCopy
static number ndCopy(number a, const coeffs)
Definition numbers.cc:306
ndInpMult
static void ndInpMult(number &a, number b, const coeffs r)
Definition numbers.cc:61
nInitCharTableDefault
VAR cfInitCharProc nInitCharTableDefault[]
Definition numbers.cc:375
ndWriteFd
static void ndWriteFd(number, const ssiInfo *, const coeffs r)
Definition numbers.cc:162
ndChineseRemainder
static number ndChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs r)
Definition numbers.cc:145
ndCoeffString
static char * ndCoeffString(const coeffs r)
Definition numbers.cc:47
nFindCoeffByName
coeffs nFindCoeffByName(char *cf_name)
find an existing coeff by its "CoeffName"
Definition numbers.cc:640
ndGetNumerator
static number ndGetNumerator(number &a, const coeffs r)
Definition numbers.cc:209
ndDivBy
static BOOLEAN ndDivBy(number, number, const coeffs)
Definition numbers.cc:309
ndInitMPZ
static number ndInitMPZ(mpz_t m, const coeffs r)
Definition numbers.cc:333
nFindCoeffByName_s::p
cfInitCfByNameProc p
Definition numbers.cc:626
ndInpAdd
static void ndInpAdd(number &a, number b, const coeffs r)
Definition numbers.cc:67
nd_Copy
number nd_Copy(number a, const coeffs r)
Definition numbers.cc:307
ndSetMap
static nMapFunc ndSetMap(const coeffs src, const coeffs dst)
Definition numbers.cc:343
ndAnn
static number ndAnn(number, const coeffs cf)
Definition numbers.cc:46
ndInvers
static number ndInvers(number a, const coeffs r)
Definition numbers.cc:104
n_IsZeroDivisor
BOOLEAN n_IsZeroDivisor(number a, const coeffs r)
Test whether a is a zero divisor in r i.e. not coprime with char. of r very inefficient implementatio...
Definition numbers.cc:177
ndIntMod
static number ndIntMod(number a, number b, const coeffs R)
Definition numbers.cc:194
ndCoeffWrite
static void ndCoeffWrite(const coeffs r, BOOLEAN)
Definition numbers.cc:51
nRegister
n_coeffType nRegister(n_coeffType n, cfInitCharProc p)
Definition numbers.cc:590
ndConvFactoryNSingN
static number ndConvFactoryNSingN(const CanonicalForm, const coeffs r)
[in, out] a bigint number >= 0
Definition numbers.cc:320
ndReturn0
static number ndReturn0(number, const coeffs r)
Definition numbers.cc:192
ndExtGcd
static number ndExtGcd(number, number, number *, number *, const coeffs r)
Definition numbers.cc:311
ndRead
static const char * ndRead(const char *s, number *n, const coeffs r)
Definition numbers.cc:338
ndCoeffName
static char * ndCoeffName(const coeffs r)
Definition numbers.cc:55
ndSetChar
static void ndSetChar(const coeffs)
Definition numbers.cc:304
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:563
ndXExtGcd
static number ndXExtGcd(number, number, number *, number *, number *, number *, const coeffs r)
Definition numbers.cc:140
nEatLong
char * nEatLong(char *s, mpz_ptr i)
extracts a long integer from s, returns the rest
Definition numbers.cc:713
ndQuotRem
number ndQuotRem(number a, number b, number *r, const coeffs R)
Definition numbers.cc:356
nFindCoeffByName_s
Definition numbers.cc:624
numbers.h
cfInitCfByNameProc
coeffs(* cfInitCfByNameProc)(char *s, n_coeffType n)
initialize an object of type coeffs by its name, return NULL otherwise
Definition numbers.h:100
cfInitCharProc
BOOLEAN(* cfInitCharProc)(coeffs, void *)
initialize an object of type coeff, return FALSE in case of success
Definition numbers.h:96
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omReallocSize
#define omReallocSize(addr, o_size, size)
Definition omAllocDecl.h:220
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211
NULL
#define NULL
Definition omList.c:12
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
StringEndS
char * StringEndS()
Definition reporter.cc:151
Werror
void Werror(const char *fmt,...)
Definition reporter.cc:189
reporter.h
rintegers.h
nrzInitChar
BOOLEAN nrzInitChar(coeffs r, void *parameter)
nr2mInitChar
BOOLEAN nr2mInitChar(coeffs r, void *p)
Definition rmodulo2m.cc:797
rmodulo2m.h
nrnInitChar
BOOLEAN nrnInitChar(coeffs r, void *p)
Definition rmodulon.cc:991
rmodulon.h
ssiInfo
Definition s_buff.h:21
nrInitChar
BOOLEAN nrInitChar(coeffs n, void *p)
Initialize r.
Definition shortfl.cc:658
shortfl.h
R
#define R
Definition sirandom.c:27
siRandProc
int(* siRandProc)(void)
Definition sirandom.h:9
ntInitChar
BOOLEAN ntInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition transext.cc:2636
transext.h