 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
#define | TRANSEXT_PRIVATES 1 |
| ABSTRACT: numbers in an algebraic extension field K[a] / < f(a) > Assuming that we have a coeffs object cf, then these numbers are polynomials in the polynomial ring K[a] represented by cf->extRing. More...
|
|
#define | naTest(a) naDBTest(a,__FILE__,__LINE__,cf) |
|
#define | naRing cf->extRing |
|
#define | naCoeffs cf->extRing->cf |
|
#define | naMinpoly naRing->qideal->m[0] |
|
#define | n2pTest(a) n2pDBTest(a,__FILE__,__LINE__,cf) |
| ABSTRACT: numbers as polys in the ring K[a] Assuming that we have a coeffs object cf, then these numbers are polynomials in the polynomial ring K[a] represented by cf->extRing. More...
|
|
#define | n2pRing cf->extRing |
|
#define | n2pCoeffs cf->extRing->cf |
|
|
BOOLEAN | naDBTest (number a, const char *f, const int l, const coeffs r) |
|
BOOLEAN | naGreaterZero (number a, const coeffs cf) |
| forward declarations More...
|
|
BOOLEAN | naGreater (number a, number b, const coeffs cf) |
|
BOOLEAN | naEqual (number a, number b, const coeffs cf) |
|
BOOLEAN | naIsOne (number a, const coeffs cf) |
|
BOOLEAN | naIsMOne (number a, const coeffs cf) |
|
number | naInit (long i, const coeffs cf) |
|
number | naNeg (number a, const coeffs cf) |
| this is in-place, modifies a More...
|
|
number | naInvers (number a, const coeffs cf) |
|
number | naAdd (number a, number b, const coeffs cf) |
|
number | naSub (number a, number b, const coeffs cf) |
|
number | naMult (number a, number b, const coeffs cf) |
|
number | naDiv (number a, number b, const coeffs cf) |
|
void | naPower (number a, int exp, number *b, const coeffs cf) |
|
number | naCopy (number a, const coeffs cf) |
|
void | naWriteLong (number a, const coeffs cf) |
|
void | naWriteShort (number a, const coeffs cf) |
|
number | naGetDenom (number &a, const coeffs cf) |
|
number | naGetNumerator (number &a, const coeffs cf) |
|
number | naGcd (number a, number b, const coeffs cf) |
|
void | naDelete (number *a, const coeffs cf) |
|
void | naCoeffWrite (const coeffs cf, BOOLEAN details) |
|
const char * | naRead (const char *s, number *a, const coeffs cf) |
|
static BOOLEAN | naCoeffIsEqual (const coeffs cf, n_coeffType n, void *param) |
|
static void | p_Monic (poly p, const ring r) |
| returns NULL if p == NULL, otherwise makes p monic by dividing by its leading coefficient (only done if this is not already 1); this assumes that we are over a ground field so that division is well-defined; modifies p More...
|
|
static poly | p_GcdHelper (poly &p, poly &q, const ring r) |
| see p_Gcd; additional assumption: deg(p) >= deg(q); must destroy p and q (unless one of them is returned) More...
|
|
static poly | p_Gcd (const poly p, const poly q, const ring r) |
|
static poly | p_ExtGcdHelper (poly &p, poly &pFactor, poly &q, poly &qFactor, ring r) |
|
poly | p_ExtGcd (poly p, poly &pFactor, poly q, poly &qFactor, ring r) |
| assumes that p and q are univariate polynomials in r, mentioning the same variable; assumes a global monomial ordering in r; assumes that not both p and q are NULL; returns the gcd of p and q; moreover, afterwards pFactor and qFactor contain appropriate factors such that gcd(p, q) = p * pFactor + q * qFactor; leaves p and q unmodified More...
|
|
void | heuristicReduce (poly &p, poly reducer, const coeffs cf) |
|
void | definiteReduce (poly &p, poly reducer, const coeffs cf) |
|
static coeffs | nCoeff_bottom (const coeffs r, int &height) |
|
BOOLEAN | naIsZero (number a, const coeffs cf) |
|
long | naInt (number &a, const coeffs cf) |
|
number | napNormalizeHelper (number b, const coeffs cf) |
|
number | naLcmContent (number a, number b, const coeffs cf) |
|
int | naSize (number a, const coeffs cf) |
|
void | naNormalize (number &a, const coeffs cf) |
|
number | naConvFactoryNSingN (const CanonicalForm n, const coeffs cf) |
|
CanonicalForm | naConvSingNFactoryN (number n, BOOLEAN, const coeffs cf) |
|
number | naMap00 (number a, const coeffs src, const coeffs dst) |
|
number | naMapZ0 (number a, const coeffs src, const coeffs dst) |
|
number | naMapP0 (number a, const coeffs src, const coeffs dst) |
|
number | naCopyTrans2AlgExt (number a, const coeffs src, const coeffs dst) |
|
number | naMap0P (number a, const coeffs src, const coeffs dst) |
|
number | naMapPP (number a, const coeffs src, const coeffs dst) |
|
number | naMapUP (number a, const coeffs src, const coeffs dst) |
|
number | naGenMap (number a, const coeffs cf, const coeffs dst) |
|
number | naGenTrans2AlgExt (number a, const coeffs cf, const coeffs dst) |
|
nMapFunc | naSetMap (const coeffs src, const coeffs dst) |
| Get a mapping function from src into the domain of this type (n_algExt) More...
|
|
int | naParDeg (number a, const coeffs cf) |
|
number | naParameter (const int iParameter, const coeffs cf) |
| return the specified parameter as a number in the given alg. field More...
|
|
int | naIsParam (number m, const coeffs cf) |
| if m == var(i)/1 => return i, More...
|
|
void | naClearContent (ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf) |
|
void | naClearDenominators (ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf) |
|
void | naKillChar (coeffs cf) |
|
char * | naCoeffString (const coeffs r) |
|
char * | naCoeffName (const coeffs r) |
|
number | naChineseRemainder (number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf) |
|
number | naFarey (number p, number n, const coeffs cf) |
|
BOOLEAN | naInitChar (coeffs cf, void *infoStruct) |
| Initialize the coeffs object. More...
|
|
BOOLEAN | n2pDBTest (number a, const char *f, const int l, const coeffs r) |
|
void | n2pNormalize (number &a, const coeffs cf) |
|
number | n2pMult (number a, number b, const coeffs cf) |
|
number | n2pDiv (number a, number b, const coeffs cf) |
|
void | n2pPower (number a, int exp, number *b, const coeffs cf) |
|
const char * | n2pRead (const char *s, number *a, const coeffs cf) |
|
static BOOLEAN | n2pCoeffIsEqual (const coeffs cf, n_coeffType n, void *param) |
|
char * | n2pCoeffString (const coeffs cf) |
|
char * | n2pCoeffName (const coeffs cf) |
|
void | n2pCoeffWrite (const coeffs cf, BOOLEAN details) |
|
number | n2pInvers (number a, const coeffs cf) |
|
BOOLEAN | n2pInitChar (coeffs cf, void *infoStruct) |
|
◆ n2pCoeffs
#define n2pCoeffs cf->extRing->cf |
◆ n2pRing
#define n2pRing cf->extRing |
◆ n2pTest
ABSTRACT: numbers as polys in the ring K[a] Assuming that we have a coeffs object cf, then these numbers are polynomials in the polynomial ring K[a] represented by cf->extRing.
IMPORTANT ASSUMPTIONS: 1.) So far we assume that cf->extRing is a valid polynomial ring
Definition at line 1513 of file algext.cc.
◆ naCoeffs
#define naCoeffs cf->extRing->cf |
◆ naMinpoly
#define naMinpoly naRing->qideal->m[0] |
◆ naRing
#define naRing cf->extRing |
◆ naTest
#define naTest |
( |
|
a | ) |
naDBTest(a,__FILE__,__LINE__,cf) |
◆ TRANSEXT_PRIVATES
#define TRANSEXT_PRIVATES 1 |
ABSTRACT: numbers in an algebraic extension field K[a] / < f(a) > Assuming that we have a coeffs object cf, then these numbers are polynomials in the polynomial ring K[a] represented by cf->extRing.
IMPORTANT ASSUMPTIONS: 1.) So far we assume that cf->extRing is a valid polynomial ring in exactly one variable, i.e., K[a], where K is allowed to be any field (representable in SINGULAR and which may itself be some extension field, thus allowing for extension towers). 2.) Moreover, this implementation assumes that cf->extRing->qideal is not NULL but an ideal with at least one non-zero generator which may be accessed by cf->extRing->qideal->m[0] and which represents the minimal polynomial f(a) of the extension variable 'a' in K[a]. 3.) As soon as an std method for polynomial rings becomes availabe, all reduction steps modulo f(a) should be replaced by a call to std. Moreover, in this situation one can finally move from K[a] / < f(a) > to K[a_1, ..., a_s] / I, with I some zero-dimensional ideal in K[a_1, ..., a_s] given by a lex Gröbner basis. The code in algext.h and algext.cc is then capable of computing in K[a_1, ..., a_s] / I.
Definition at line 53 of file algext.cc.
◆ definiteReduce()
void definiteReduce |
( |
poly & |
p, |
|
|
poly |
reducer, |
|
|
const coeffs |
cf |
|
) |
| |
◆ heuristicReduce()
void heuristicReduce |
( |
poly & |
p, |
|
|
poly |
reducer, |
|
|
const coeffs |
cf |
|
) |
| |
◆ n2pCoeffIsEqual()
◆ n2pCoeffName()
Definition at line 1623 of file algext.cc.
1630 l+=(strlen(
p[
i])+1);
1635 snprintf(
s,strlen(cf_s)+2,
"%s",cf_s);
1646 else { tt[0]=
']'; strcat(
s,tt); }
◆ n2pCoeffString()
Definition at line 1595 of file algext.cc.
1602 l+=(strlen(
p[
i])+1);
1605 char *
s=(
char *)
omAlloc(
l+5+strlen(cf_s));
1607 snprintf(
s,strlen(cf_s)+2,
"%s",cf_s);
1618 else { tt[0]=
']'; strcat(
s,tt); }
◆ n2pCoeffWrite()
Definition at line 1651 of file algext.cc.
1655 const ring
A =
cf->extRing;
1658 PrintS(
"// polynomial ring as coefficient ring :\n");
◆ n2pDBTest()
◆ n2pDiv()
◆ n2pInitChar()
first check whether cf->extRing != NULL and delete old ring???
Definition at line 1679 of file algext.cc.
1692 const ring
R = e->
r;
1750 cf->iNumberOfParameters =
rVar(
R);
1751 cf->pParameterNames = (
const char**)
R->names;
◆ n2pInvers()
◆ n2pMult()
Definition at line 1542 of file algext.cc.
1547 return (number)aTimesB;
◆ n2pNormalize()
◆ n2pPower()
void n2pPower |
( |
number |
a, |
|
|
int |
exp, |
|
|
number * |
b, |
|
|
const coeffs |
cf |
|
) |
| |
◆ n2pRead()
Definition at line 1566 of file algext.cc.
1570 *a = (number)aAsPoly;
◆ naAdd()
Definition at line 439 of file algext.cc.
447 return (number)aPlusB;
◆ naChineseRemainder()
Definition at line 1375 of file algext.cc.
1377 poly *P=(poly*)
omAlloc(rl*
sizeof(poly*));
1378 number *X=(number *)
omAlloc(rl*
sizeof(number));
◆ naClearContent()
Definition at line 1106 of file algext.cc.
1112 const ring
R =
cf->extRing;
1118 numberCollectionEnumerator.
Reset();
1120 if( !numberCollectionEnumerator.
MoveNext() )
1129 int s1;
int s=2147483647;
1133 int normalcount = 0;
1139 number& n = numberCollectionEnumerator.
Current();
1152 }
while (numberCollectionEnumerator.
MoveNext() );
1159 numberCollectionEnumerator.
Reset();
1162 while (numberCollectionEnumerator.
MoveNext() )
1164 number& n = numberCollectionEnumerator.
Current();
1167 if( (--normalcount) <= 0)
1213 numberCollectionEnumerator.
Reset();
1216 while (numberCollectionEnumerator.
MoveNext() )
1218 number& n = numberCollectionEnumerator.
Current();
1229 n = (number)
p_Mult_q(cInverse, (poly)n,
R);
◆ naClearDenominators()
◆ naCoeffIsEqual()
Definition at line 680 of file algext.cc.
697 const ideal mi =
naRing->qideal;
699 const ideal ii = e->
r->qideal;
◆ naCoeffName()
Definition at line 1352 of file algext.cc.
1359 l+=(strlen(
p[
i])+1);
1363 snprintf(
s,10+1,
"%d",r->ch);
◆ naCoeffString()
Definition at line 1329 of file algext.cc.
1336 l+=(strlen(
p[
i])+1);
1340 snprintf(
s,10+1,
"%d",r->ch);
◆ naCoeffWrite()
Definition at line 389 of file algext.cc.
393 const ring
A =
cf->extRing;
402 const int P =
rVar(
A);
407 for (
int nop=0; nop < P; nop ++)
410 if (nop!=P-1)
PrintS(
", ");
415 const ideal I =
A->qideal;
◆ naConvFactoryNSingN()
◆ naConvSingNFactoryN()
◆ naCopy()
◆ naCopyTrans2AlgExt()
Definition at line 892 of file algext.cc.
896 fraction
fa=(fraction)a;
929 number t=
naDiv ((number)
p,(number)q, dst);
934 WerrorS (
"mapping denominator to zero");
◆ naDBTest()
◆ naDelete()
Definition at line 280 of file algext.cc.
282 if (*a ==
NULL)
return;
284 poly aAsPoly = (poly)(*a);
◆ naDiv()
Definition at line 471 of file algext.cc.
482 return (number)aDivB;
◆ naEqual()
◆ naFarey()
◆ naGcd()
◆ naGenMap()
Definition at line 974 of file algext.cc.
978 const ring rSrc =
cf->extRing;
979 const ring rDst = dst->extRing;
983 poly
g =
prMapR(
f, nMap, rSrc, rDst);
◆ naGenTrans2AlgExt()
Definition at line 989 of file algext.cc.
993 const ring rSrc =
cf->extRing;
994 const ring rDst = dst->extRing;
997 fraction
f = (fraction)a;
998 poly
g =
prMapR(NUM(
f), nMap, rSrc, rDst);
1004 h =
prMapR(DEN(
f), nMap, rSrc, rDst);
◆ naGetDenom()
◆ naGetNumerator()
◆ naGreater()
Definition at line 360 of file algext.cc.
374 if (aDeg>bDeg)
return TRUE;
375 if (aDeg<bDeg)
return FALSE;
◆ naGreaterZero()
forward declarations
Definition at line 380 of file algext.cc.
◆ naInit()
◆ naInitChar()
Initialize the coeffs object.
first check whether cf->extRing != NULL and delete old ring???
Definition at line 1395 of file algext.cc.
1407 (e->
r->qideal->m[0] !=
NULL) );
1413 const ring
R = e->
r;
1478 cf->iNumberOfParameters =
rVar(
R);
1479 cf->pParameterNames = (
const char**)
R->names;
1481 cf->has_simple_Inverse=
R->cf->has_simple_Inverse;
◆ naInt()
Definition at line 347 of file algext.cc.
350 poly aAsPoly = (poly)a;
◆ naInvers()
Definition at line 820 of file algext.cc.
825 poly aFactor =
NULL; poly mFactor =
NULL; poly theGcd =
NULL;
841 WerrorS(
"zero divisor found - your minpoly is not irreducible");
846 return (number)(aFactor);
◆ naIsMOne()
Definition at line 325 of file algext.cc.
328 poly aAsPoly = (poly)a;
◆ naIsOne()
Definition at line 317 of file algext.cc.
320 poly aAsPoly = (poly)a;
◆ naIsParam()
if m == var(i)/1 => return i,
Definition at line 1095 of file algext.cc.
1099 const ring
R =
cf->extRing;
◆ naIsZero()
◆ naKillChar()
Definition at line 1323 of file algext.cc.
1325 if ((--
cf->extRing->ref) == 0)
◆ naLcmContent()
number naLcmContent |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
cf |
|
) |
| |
◆ naMap00()
◆ naMap0P()
Definition at line 940 of file algext.cc.
945 number q =
nlModP(a, src, dst->extRing->cf);
◆ naMapP0()
◆ naMapPP()
◆ naMapUP()
◆ naMapZ0()
◆ naMult()
Definition at line 461 of file algext.cc.
468 return (number)aTimesB;
◆ naNeg()
this is in-place, modifies a
Definition at line 334 of file algext.cc.
◆ naNormalize()
◆ naParameter()
return the specified parameter as a number in the given alg. field
Definition at line 1080 of file algext.cc.
1084 const ring
R =
cf->extRing;
1086 assume( 0 < iParameter && iParameter <=
rVar(
R) );
◆ naParDeg()
Definition at line 1072 of file algext.cc.
1074 if (a ==
NULL)
return -1;
1076 return cf->extRing->pFDeg(aa,
cf->extRing);
◆ napNormalizeHelper()
number napNormalizeHelper |
( |
number |
b, |
|
|
const coeffs |
cf |
|
) |
| |
◆ naPower()
void naPower |
( |
number |
a, |
|
|
int |
exp, |
|
|
number * |
b, |
|
|
const coeffs |
cf |
|
) |
| |
Definition at line 495 of file algext.cc.
510 int expAbs =
exp;
if (expAbs < 0) expAbs = -expAbs;
513 poly
pow; poly aAsPoly = (poly)a;
517 for (
int i = 2;
i <= expAbs;
i++)
547 number n = (number)
pow;
◆ naRead()
Definition at line 608 of file algext.cc.
613 *a = (number)aAsPoly;
◆ naSetMap()
Get a mapping function from src into the domain of this type (n_algExt)
Q or Z --> Q(a)
Z --> Q(a)
Z/p --> Q(a)
Q --> Z/p(a)
Z --> Z/p(a)
Z/p --> Z/p(a)
Z/u --> Z/p(a)
default
Definition at line 1019 of file algext.cc.
1045 if (src->ch == dst->ch)
return naMapPP;
1049 if (
h != 1)
return NULL;
1061 else if ((nMap!=
NULL) && (strcmp(
rRingVar(0,src->extRing),
rRingVar(0,dst->extRing))==0) && (
rVar (src->extRing) ==
rVar (dst->extRing)))
◆ naSize()
Definition at line 714 of file algext.cc.
716 if (a ==
NULL)
return 0;
717 poly aAsPoly = (poly)a;
719 while (aAsPoly !=
NULL)
◆ naSub()
Definition at line 450 of file algext.cc.
455 if (a ==
NULL)
return (number)minusB;
458 return (number)aMinusB;
◆ naWriteLong()
Definition at line 572 of file algext.cc.
579 poly aAsPoly = (poly)a;
◆ naWriteShort()
Definition at line 590 of file algext.cc.
597 poly aAsPoly = (poly)a;
◆ nCoeff_bottom()
◆ p_ExtGcd()
poly p_ExtGcd |
( |
poly |
p, |
|
|
poly & |
pFactor, |
|
|
poly |
q, |
|
|
poly & |
qFactor, |
|
|
ring |
r |
|
) |
| |
assumes that p and q are univariate polynomials in r, mentioning the same variable; assumes a global monomial ordering in r; assumes that not both p and q are NULL; returns the gcd of p and q; moreover, afterwards pFactor and qFactor contain appropriate factors such that gcd(p, q) = p * pFactor + q * qFactor; leaves p and q unmodified
Definition at line 218 of file algext.cc.
223 { a = q;
b =
p; aCorrespondsToP =
FALSE; }
225 poly aFactor =
NULL; poly bFactor =
NULL;
227 if (aCorrespondsToP) { pFactor = aFactor; qFactor = bFactor; }
228 else { pFactor = bFactor; qFactor = aFactor; }
◆ p_ExtGcdHelper()
static poly p_ExtGcdHelper |
( |
poly & |
p, |
|
|
poly & |
pFactor, |
|
|
poly & |
q, |
|
|
poly & |
qFactor, |
|
|
ring |
r |
|
) |
| |
|
inlinestatic |
◆ p_Gcd()
◆ p_GcdHelper()
static poly p_GcdHelper |
( |
poly & |
p, |
|
|
poly & |
q, |
|
|
const ring |
r |
|
) |
| |
|
inlinestatic |
see p_Gcd; additional assumption: deg(p) >= deg(q); must destroy p and q (unless one of them is returned)
Definition at line 147 of file algext.cc.
◆ p_Monic()
static void p_Monic |
( |
poly |
p, |
|
|
const ring |
r |
|
) |
| |
|
inlinestatic |
returns NULL if p == NULL, otherwise makes p monic by dividing by its leading coefficient (only done if this is not already 1); this assumes that we are over a ground field so that division is well-defined; modifies p
assumes that p and q are univariate polynomials in r, mentioning the same variable; assumes a global monomial ordering in r; assumes that not both p and q are NULL; returns the gcd of p and q; leaves p and q unmodified
Definition at line 122 of file algext.cc.
124 if (
p ==
NULL)
return;
125 number n =
n_Init(1, r->cf);
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
@ n_rep_gap_rat
(number), see longrat.h
int dReportError(const char *fmt,...)
char * n2pCoeffString(const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
void StringAppendS(const char *st)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static void p_Monic(poly p, const ring r)
returns NULL if p == NULL, otherwise makes p monic by dividing by its leading coefficient (only done ...
#define p_SetCoeff0(p, n, r)
void p_Normalize(poly p, const ring r)
virtual reference Current()=0
Gets the current element in the collection (read and write).
void p_Write0(poly p, ring lmRing, ring tailRing)
nMapFunc naSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_algExt)
void naCoeffWrite(const coeffs cf, BOOLEAN details)
number napNormalizeHelper(number b, const coeffs cf)
static BOOLEAN rCanShortOut(const ring r)
const CanonicalForm int const CFList const Variable & y
BOOLEAN naIsOne(number a, const coeffs cf)
char * naCoeffName(const coeffs r)
void n2pCoeffWrite(const coeffs cf, BOOLEAN details)
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
const char * n2pRead(const char *s, number *a, const coeffs cf)
void n2pPower(number a, int exp, number *b, const coeffs cf)
number naDiv(number a, number b, const coeffs cf)
number naGenMap(number a, const coeffs cf, const coeffs dst)
number naGcd(number a, number b, const coeffs cf)
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
int p_Var(poly m, const ring r)
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
number n2pInvers(number a, const coeffs cf)
number naChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
static poly p_Neg(poly p, const ring r)
int naParDeg(number a, const coeffs cf)
number naInvers(number a, const coeffs cf)
number naFarey(number p, number n, const coeffs cf)
static BOOLEAN length(leftv result, leftv arg)
number naMap00(number a, const coeffs src, const coeffs dst)
poly p_ChineseRemainder(poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
poly singclap_pdivide(poly f, poly g, const ring r)
void naWriteLong(number a, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
static coeffs nCoeff_bottom(const coeffs r, int &height)
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
BOOLEAN naDBTest(number a, const char *f, const int l, const coeffs r)
number naMapPP(number a, const coeffs src, const coeffs dst)
number naAdd(number a, number b, const coeffs cf)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
CanonicalForm naConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
#define __p_Mult_nn(p, n, r)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
void p_String0Short(const poly p, ring lmRing, ring tailRing)
print p in a short way, if possible
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1,...
number n2pMult(number a, number b, const coeffs cf)
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
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
number naLcmContent(number a, number b, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise,...
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
static poly p_Copy(poly p, const ring r)
returns a copy of p
poly p_Power(poly p, int i, const ring r)
number naCopy(number a, const coeffs cf)
void definiteReduce(poly &p, poly reducer, const coeffs cf)
static short rVar(const ring r)
#define rVar(r) (r->N)
@ n_polyExt
used to represent polys as coeffcients
#define n2pTest(a)
ABSTRACT: numbers as polys in the ring K[a] Assuming that we have a coeffs object cf,...
struct for passing initialization parameters to naInitChar
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const char *const nDivBy0
void PrintS(const char *s)
#define omFreeSize(addr, size)
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
static char * rRingVar(short i, const ring r)
void naClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
void naClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
BOOLEAN naGreaterZero(number a, const coeffs cf)
forward declarations
BOOLEAN naGreater(number a, number b, const coeffs cf)
int naSize(number a, const coeffs cf)
char * n2pCoeffName(const coeffs cf)
number naParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given alg. field
number naGetDenom(number &a, const coeffs cf)
number ndGcd(number, number, const coeffs r)
void p_String0Long(const poly p, ring lmRing, ring tailRing)
print p in a long way
poly p_Farey(poly p, number N, const ring r)
number naGetNumerator(number &a, const coeffs cf)
long naInt(number &a, const coeffs cf)
static poly pp_Mult_qq(poly p, poly q, const ring r)
number naMult(number a, number b, const coeffs cf)
BOOLEAN fa(leftv res, leftv args)
number naMapUP(number a, const coeffs src, const coeffs dst)
char * naCoeffString(const coeffs r)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
number naConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
void naPower(number a, int exp, number *b, const coeffs cf)
const char * p_Read(const char *st, poly &rc, const ring r)
number nlModP(number q, const coeffs, const coeffs Zp)
static poly p_Init(const ring r, omBin bin)
void naWriteShort(number a, const coeffs cf)
number n2pDiv(number a, number b, const coeffs cf)
poly p_PolyDiv(poly &p, const poly divisor, const BOOLEAN needResult, const ring r)
assumes that p and divisor are univariate polynomials in r, mentioning the same variable; assumes div...
void naKillChar(coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
@ n_rep_poly
(poly), see algext.h
static poly p_ExtGcdHelper(poly &p, poly &pFactor, poly &q, poly &qFactor, ring r)
CanonicalForm convSingPFactoryP(poly p, const ring r)
gmp_float exp(const gmp_float &a)
number naInit(long i, const coeffs cf)
const char * naRead(const char *s, number *a, const coeffs cf)
void rDelete(ring r)
unconditionally deletes fields in r
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
long p_Deg(poly a, const ring r)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
BOOLEAN singclap_extgcd(poly f, poly g, poly &res, poly &pa, poly &pb, const ring r)
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
number naSub(number a, number b, const coeffs cf)
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
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
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
void rWrite(ring r, BOOLEAN details)
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
void naNormalize(number &a, const coeffs cf)
number naGenTrans2AlgExt(number a, const coeffs cf, const coeffs dst)
void heuristicReduce(poly &p, poly reducer, const coeffs cf)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
static BOOLEAN naCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
static BOOLEAN n2pCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
BOOLEAN naIsZero(number a, const coeffs cf)
static number p_SetCoeff(poly p, number n, ring r)
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Rational pow(const Rational &a, int e)
void WerrorS(const char *s)
number naMapP0(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
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 ....
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algext(const coeffs r)
is it an alg. ext. of Q?
number naNeg(number a, const coeffs cf)
this is in-place, modifies a
static void p_Setm(poly p, const ring r)
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
static long p_Totaldegree(poly p, const ring r)
static BOOLEAN p_IsConstant(const poly p, const ring r)
void naDelete(number *a, const coeffs cf)
number naCopyTrans2AlgExt(number a, const coeffs src, const coeffs dst)
const CanonicalForm int s
static poly p_GcdHelper(poly &p, poly &q, const ring r)
see p_Gcd; additional assumption: deg(p) >= deg(q); must destroy p and q (unless one of them is retur...
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...
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Mult_q(poly p, poly q, const ring r)
BOOLEAN naIsMOne(number a, const coeffs cf)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
BOOLEAN naEqual(number a, number b, const coeffs cf)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
go into polynomials over an alg. extension recursively
number naMapZ0(number a, const coeffs src, const coeffs dst)
void n2pNormalize(number &a, const coeffs cf)
@ n_algExt
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic
number naMap0P(number a, const coeffs src, const coeffs dst)
@ n_rep_gap_gmp
(), see rinteger.h, new impl.