33#define TRANSEXT_PRIVATES
61#define ADD_COMPLEXITY 1
62#define MULT_COMPLEXITY 2
63#define DIFF_COMPLEXITY 2
64#define BOUND_COMPLEXITY 10
67#define NUMIS1(f) (p_IsOne(NUM(f), cf->extRing))
69#define COM(f) (f)->complexity
76#define ntTest(a) n_Test(a, cf)
80#define ntRing cf->extRing
86#define ntCoeffs cf->extRing->cf
94 BOOLEAN simpleTestsHaveAlreadyBeenPerformed);
144 if (IS0(a))
return TRUE;
146 const fraction t = (fraction)a;
158 Print(
"ERROR in %s:%d: non-integer Q coeff in num. poly\n",
f,
l);
163 const poly
den = DEN(t);
173 Print(
"ERROR in %s:%d: non-integer Q coeff in den. poly\n",
f,
l);
182 Print(
"ERROR in %s:%d: constant den. poly / Zp\n",
f,
l);
190 Print(
"ERROR in %s:%d: non-monic den. poly / Zp\n",
f,
l);
204 Print(
"ERROR in %s:%d: 1 != GCD between num. & den. poly\n",
f,
l);
222 Print(
"negative sign of DEN. of a fraction in %s:%d\n",
f,
l);
244 number n=pGetCoeff(
p);
255 Print(
"rational coeff in num: %s:%d\n",
f,
l);
262 number n=pGetCoeff(
p);
266 Print(
"rational coeff in den.:%s:%d\n",
f,
l);
300 cf =
cf->extRing->cf;
318 fraction
f = (fraction)(*a);
321 if (!DENIS1(
f)) p_Delete(&DEN(
f),
ntRing);
334 if (a ==
b)
return TRUE;
335 if ((IS0(a)) && (!IS0(
b)))
return FALSE;
336 if ((IS0(
b)) && (!IS0(a)))
return FALSE;
339 fraction fa = (fraction)a;
340 fraction fb = (fraction)
b;
341 if ((
COM(fa) == 1) && (
COM(fb) == 1))
347 if (DENIS1(fa) && DENIS1(fb))
return TRUE;
348 if (DENIS1(fa) && !DENIS1(fb))
return FALSE;
349 if (!DENIS1(fa) && DENIS1(fb))
return FALSE;
350 f = p_Add_q(p_Copy(DEN(fa),
ntRing),
360 if (!DENIS1(fb))
f = p_Mult_q(
f, p_Copy(DEN(fb),
ntRing),
ntRing);
362 if (!DENIS1(fa))
g = p_Mult_q(
g, p_Copy(DEN(fa),
ntRing),
ntRing);
376 if (IS0(a))
return NULL;
377 fraction
f = (fraction)a;
420 number lcmOfDenominators = n_Init(1,
ntCoeffs);
421 number c; number tmp;
429 n_Delete(&lcmOfDenominators,
ntCoeffs);
430 lcmOfDenominators = tmp;
438 n_Delete(&lcmOfDenominators,
ntCoeffs);
439 lcmOfDenominators = tmp;
442 if (!n_IsOne(lcmOfDenominators,
ntCoeffs))
449 n_Delete(&lcmOfDenominators,
ntCoeffs);
455 while ((
p !=
NULL) && (!n_IsOne(gcdOfCoefficients,
ntCoeffs)))
458 tmp = n_Gcd(c, gcdOfCoefficients,
ntCoeffs);
459 n_Delete(&gcdOfCoefficients,
ntCoeffs);
460 gcdOfCoefficients = tmp;
464 while ((
p !=
NULL) && (!n_IsOne(gcdOfCoefficients,
ntCoeffs)))
467 tmp = n_Gcd(c, gcdOfCoefficients,
ntCoeffs);
468 n_Delete(&gcdOfCoefficients,
ntCoeffs);
469 gcdOfCoefficients = tmp;
472 if (!n_IsOne(gcdOfCoefficients,
ntCoeffs))
474 number inverseOfGcdOfCoefficients = n_Invers(gcdOfCoefficients,
480 n_Delete(&inverseOfGcdOfCoefficients,
ntCoeffs);
482 n_Delete(&gcdOfCoefficients,
ntCoeffs);
488 if ((DEN(
f) !=
NULL) &&
489 p_IsConstant(DEN(
f),
ntRing) &&
496 if( !n_GreaterZero(pGetCoeff(DEN(
f)),
ntCoeffs) )
510 if (IS0(a))
return NULL;
514 fraction
f = (fraction)a;
584 fraction
f = (fraction)a;
606 if( DEN (
f) !=
NULL )
674 fraction
f = (fraction)a;
683 fraction
f = (fraction)a;
697 fraction
f = (fraction)a;
777 if (IS0(a))
return 0;
779 fraction
f = (fraction)a;
780 if (!DENIS1(
f))
return 0;
782 const poly aAsPoly =
NUM(
f);
787 if (!p_IsConstant(aAsPoly,
ntRing))
800 if (IS0(a))
return FALSE;
801 fraction
f = (fraction)a;
815 fraction fb = (fraction)
b;
816 return (!n_GreaterZero(pGetCoeff(
NUM(fb)),
ntCoeffs));
820 fraction fa = (fraction)a;
821 return (n_GreaterZero(pGetCoeff(
NUM(fa)),
ntCoeffs));
824 fraction fa = (fraction)a;
826 int aNumDeg = p_Totaldegree(
NUM(fa),
ntRing);
827 number aDenCoeff =
NULL;
int aDenDeg = 0;
831 aDenDeg = p_Totaldegree(DEN(fa),
ntRing);
833 fraction fb = (fraction)
b;
835 int bNumDeg = p_Totaldegree(
NUM(fb),
ntRing);
836 number bDenCoeff =
NULL;
int bDenDeg = 0;
840 bDenDeg = p_Totaldegree(DEN(fb),
ntRing);
842 if (aNumDeg-aDenDeg > bNumDeg-bDenDeg)
return TRUE;
843 if (aNumDeg-aDenDeg < bNumDeg-bDenDeg)
return FALSE;
847 else aa=n_Mult(aNumCoeff,bDenCoeff,
ntCoeffs);
849 else bb=n_Mult(bNumCoeff,aDenCoeff,
ntCoeffs);
860 const ring
A =
cf->extRing;
869 const int P = rVar(
A);
874 for (
int nop=0; nop < P; nop ++)
876 Print(
"%s", rRingVar(nop,
A));
877 if (nop!=P-1)
PrintS(
", ");
909 fraction t = (fraction) d;
912 WerrorS(
"expected differentiation by a variable");
918 WerrorS(
"expected differentiation by a variable");
924 fraction fa = (fraction)a;
963 fraction fa = (fraction)a;
964 fraction fb = (fraction)
b;
967 if (!DENIS1(fb))
g = p_Mult_q(
g, p_Copy(DEN(fb),
ntRing),
ntRing);
969 if (!DENIS1(fa))
h = p_Mult_q(
h, p_Copy(DEN(fa),
ntRing),
ntRing);
975 if (DENIS1(fa) && DENIS1(fb))
f =
NULL;
976 else if (!DENIS1(fa) && DENIS1(fb))
f = p_Copy(DEN(fa),
ntRing);
977 else if (DENIS1(fa) && !DENIS1(fb))
f = p_Copy(DEN(fb),
ntRing);
978 else f = p_Mult_q(p_Copy(DEN(fa),
ntRing),
1002 fraction fa = (fraction)a;
1003 fraction fb = (fraction)
b;
1005 if (DENIS1(fa) && DENIS1(fb))
1014 if (!DENIS1(fb))
g = p_Mult_q(
g, p_Copy(DEN(fb),
ntRing),
ntRing);
1016 if (!DENIS1(fa))
h = p_Mult_q(
h, p_Copy(DEN(fa),
ntRing),
ntRing);
1020 if (!DENIS1(fa) && DENIS1(fb))
f = DEN(fa);
1021 else if (DENIS1(fa) && !DENIS1(fb))
f = p_Copy(DEN(fb),
ntRing);
1022 else f = p_Mult_q(DEN(fa),
1043 fraction fa = (fraction)a;
1044 fraction fb = (fraction)
b;
1047 if (!DENIS1(fb))
g = p_Mult_q(
g, p_Copy(DEN(fb),
ntRing),
ntRing);
1049 if (!DENIS1(fa))
h = p_Mult_q(
h, p_Copy(DEN(fa),
ntRing),
ntRing);
1055 if (DENIS1(fa) && DENIS1(fb))
f =
NULL;
1056 else if (!DENIS1(fa) && DENIS1(fb))
f = p_Copy(DEN(fa),
ntRing);
1057 else if (DENIS1(fa) && !DENIS1(fb))
f = p_Copy(DEN(fb),
ntRing);
1058 else f = p_Mult_q(p_Copy(DEN(fa),
ntRing),
1080 if (IS0(a) || IS0(
b))
return NULL;
1082 fraction fa = (fraction)a;
1083 fraction fb = (fraction)
b;
1093 const poly da = DEN(fa);
1094 const poly db = DEN(fb);
1149 fraction fa = (fraction)a;
1150 fraction fb = (fraction)
b;
1159 const poly da = DEN(fa);
1160 const poly db = DEN(fb);
1185 DEN(fa) = p_Copy(db,
ntRing);
1207 if (!n_IsOne(pGetCoeff(n),
R->cf))
1209 number inv=n_Invers(pGetCoeff(n),
R->cf);
1212 n_Delete(&inv,
R->cf);
1230 if (IS0(a))
return NULL;
1233 fraction fa = (fraction)a;
1234 fraction fb = (fraction)
b;
1237 if (!DENIS1(fb))
g = p_Mult_q(
g, p_Copy(DEN(fb),
ntRing),
ntRing);
1242 if (!DENIS1(fa))
f = p_Mult_q(
f, p_Copy(DEN(fa),
ntRing),
ntRing);
1246 if (!n_GreaterZero(pGetCoeff(
f),
ntCoeffs))
1279 fraction
f = (fraction)a;
1285 const poly
den = DEN(
f);
1303 num_f=p_Copy(num_f,
ntRing);
1309 if (p_IsOne(num_f,
ntRing))
1350 int expAbs =
exp;
if (expAbs < 0) expAbs = -expAbs;
1353 number
pow; number t;
1357 for (
int i = 2;
i <= expAbs;
i++)
1374 expAbs = expAbs / 2;
1402 fraction
f = (fraction)a;
1422 if( DEN(
f) !=
NULL )
1424 if( !n_GreaterZero(pGetCoeff(DEN(
f)),
ntCoeffs) )
1431 if (!n_IsOne(pGetCoeff(DEN(
f)),
ntCoeffs))
1433 number inv=n_Invers(pGetCoeff(DEN(
f)),
ntCoeffs);
1437 if(p_LmIsConstant(DEN(
f),
ntRing))
1458 p_ExpVectorDiff(den_f,den_f,den_f,
ntRing);
1474 && (p_LmIsConstantComp(DEN(
f),
ntRing))
1475 && (n_IsOne(pGetCoeff(DEN(
f)),
ntCoeffs)))
1484 BOOLEAN simpleTestsHaveAlreadyBeenPerformed)
1488 fraction
f = (fraction)a;
1491 if (
COM(
f)==0)
return;
1493 if (!simpleTestsHaveAlreadyBeenPerformed)
1564 if (p_IsConstant(pGcd,
ntRing)
1581 if (p_IsConstant (DEN (
f),
ntRing))
1595 if (p_IsConstant(DEN(
f),
ntRing) &&
1607 if (p_IsConstant (DEN (
f),
ntRing))
1623 if( DEN(
f) !=
NULL )
1625 if( !n_GreaterZero(pGetCoeff(DEN(
f)),
ntCoeffs) )
1629 if (p_IsConstant(DEN(
f),
ntRing) &&
1648 fraction
f = (fraction)a;
1657 omitBrackets = p_IsConstant(DEN(
f),
ntRing);
1673 fraction
f = (fraction)a;
1682 omitBrackets = p_IsConstant(DEN(
f),
ntRing);
1708 if ((DEN((fraction)a)!=
NULL)
1709 &&(!n_GreaterZero(pGetCoeff(DEN((fraction)a)),
ntCoeffs)))
1712 DEN((fraction)a)=p_Neg(DEN((fraction)a),
ntRing);
1753 fraction fb = (fraction)
b;
1755 fraction fa = (fraction)a;
1762 if (p_IsConstant(pa,
ntRing) && p_IsConstant(pb,
ntRing))
1764 pGcd = p_Copy(pa,
ntRing);
1765 p_SetCoeff (pGcd, n_Gcd (pGetCoeff(pGcd), pGetCoeff(pb),
ntCoeffs),
ntRing);
1769 number contentpa, contentpb, tmp;
1791 tmp= n_SubringGcd (contentpb, contentpa,
ntCoeffs);
1809 if (p_IsConstant(pGcd,
ntRing) &&
1836 fraction fa = (fraction)a;
1837 fraction fb = (fraction)
b;
1845 if (p_IsConstant(pa,
ntRing) && p_IsConstant(pb,
ntRing))
1847 pGcd = p_Copy(pa,
ntRing);
1848 p_SetCoeff (pGcd, n_SubringGcd (pGetCoeff(pGcd), pGetCoeff(pb),
ntCoeffs),
ntRing);
1852 number contentpa, contentpb, tmp;
1874 tmp= n_SubringGcd (contentpb, contentpa,
ntCoeffs);
1906 if (IS0(a))
return 0;
1907 fraction
f = (fraction)a;
1909 unsigned long noOfTerms = 0;
1910 unsigned long numDegree = 0;
1913 numDegree = p_Totaldegree(
p,
ntRing);
1914 noOfTerms = pLength(
p);
1916 unsigned long denDegree = 0;
1919 denDegree = p_Totaldegree(DEN(
f),
ntRing);
1920 noOfTerms += pLength(DEN(
f));
1924 unsigned long t= ((numDegree + denDegree)*(numDegree + denDegree) + 1) * noOfTerms;
1925 if (t>INT_MAX)
return INT_MAX;
1934 if (n_IsZero(a, src))
return NULL;
1935 assume(src->rep == dst->extRing->cf->rep);
1942 number nn=n_GetDenom(a,src);
1943 number zz=n_GetNumerator(a,src);
1945 fraction ff=(fraction)
res;
1946 if (n_IsOne(nn,src)) DEN(ff)=
NULL;
1947 else DEN(ff)=
p_NSet(nn,dst->extRing);
1957 if (n_IsZero(a, src))
return NULL;
1958 nMapFunc nMap=n_SetMap(src,dst->extRing->cf);
1959 poly
p=
p_NSet(nMap(a, src,dst->extRing->cf), dst->extRing);
1960 if (n_IsZero(pGetCoeff(
p),dst->extRing->cf))
1961 p_Delete(&
p,dst->extRing);
1971 if (n_IsZero(a, src))
return NULL;
1973 int n = n_Int(a, src);
1974 number q = n_Init(n, dst->extRing->cf);
1975 if (n_IsZero(q, dst->extRing->cf))
1977 n_Delete(&q, dst->extRing->cf);
1987 if (IS0(a))
return NULL;
1989 const ring rSrc =
cf->extRing;
1990 const ring rDst = dst->extRing;
1995 fraction
f = (fraction)a;
2016 if (IS0(a))
return NULL;
2018 const ring rSrc =
cf->extRing;
2019 const ring rDst = dst->extRing;
2021 const nMapFunc nMap=n_SetMap(rSrc->cf,rDst->cf);
2022 fraction
f = (fraction)a;
2029 if (n_IsZero(pGetCoeff(hh),rDst->cf))
2033 g=p_LmFreeAndNext(
g,rDst);
2038 prev->next=p_LmFreeAndNext(prev->next,rDst);
2054 h =
prMapR(DEN(
f), nMap, rSrc, rDst);
2060 if (n_IsZero(pGetCoeff(hh),rDst->cf))
2064 h=p_LmFreeAndNext(
h,rDst);
2069 prev->next=p_LmFreeAndNext(prev->next,rDst);
2095 if (n_IsZero(a,
cf))
return NULL;
2102 if (n_IsZero(a,
cf))
return NULL;
2104 const nMapFunc nMap=n_SetMap(
cf->extRing->cf,dst->extRing->cf);
2105 return ntInit(
prMapR((poly)a, nMap,
cf->extRing, dst->extRing),dst);
2112 if (n_IsZero(a, src))
return NULL;
2115 number q =
nlModP(a, src, dst->extRing->cf);
2117 if (n_IsZero(q, dst->extRing->cf))
2119 n_Delete(&q, dst->extRing->cf);
2123 poly
g =
p_NSet(q, dst->extRing);
2136 if (n_IsZero(a, src))
return NULL;
2137 assume(src == dst->extRing->cf);
2138 poly
p =
p_One(dst->extRing);
2139 p_SetCoeff(
p, n_Copy(a, src), dst->extRing);
2151 if (n_IsZero(a, src))
return NULL;
2153 int n = n_Int(a, src);
2154 number q = n_Init(n, dst->extRing->cf);
2156 if (n_IsZero(q, dst->extRing->cf))
2158 n_Delete(&q, dst->extRing->cf);
2162 p_SetCoeff(
p, q, dst->extRing);
2184 && (
nCoeff_is_Q(dst->extRing->cf) || nCoeff_is_Z(dst->extRing->cf)))
2192 if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2194 if (src->ch == dst->ch)
return ntMapPP;
2199 if (mpz_cmp(src->modNumber,bDst->modNumber)==0)
return ntMapPP;
2202 if (
h != 1)
return NULL;
2210 if (rVar(src->extRing) > rVar(dst->extRing))
2213 for (
int i = 0;
i < rVar(src->extRing);
i++)
2214 if (strcmp(rRingVar(
i, src->extRing), rRingVar(
i, dst->extRing)) != 0)
2219 if (src->extRing->cf==dst->extRing->cf)
2226 if (src->extRing->cf==dst->extRing->cf)
2238 if (n==
ntCopyAlg) printf(
"n=ntCopyAlg\n");
2239 else if (n==
ntCopyMap) printf(
"n=ntCopyMap\n");
2240 else if (n==
ntMapUP) printf(
"n=ntMapUP\n");
2241 else if (n==
ntMap0P) printf(
"n=ntMap0P\n");
2242 else if (n==
ntMapP0) printf(
"n=ntMapP0\n");
2243 else if (n==
ntMap00) printf(
"n=ntMap00\n");
2244 else if (n==
NULL) printf(
"n=NULL\n");
2245 else printf(
"n=?\n");
2252 rDecRefCnt(
cf->extRing);
2253 if (
cf->extRing->ref <= 0)
2273 fraction
f = (fraction)n;
2280 if (IS0(a))
return -1;
2281 fraction fa = (fraction)a;
2282 return cf->extRing->pFDeg(
NUM(fa),
cf->extRing);
2290 const ring
R =
cf->extRing;
2292 assume( 0 < iParameter && iParameter <= rVar(
R) );
2294 poly
p =
p_One(
R); p_SetExp(
p, iParameter, 1,
R); p_Setm(
p,
R);
2313 const ring
R =
cf->extRing;
2316 fraction
f = (fraction)
m;
2318 if( DEN(
f) !=
NULL )
2329 return NUM((fraction)n);
2341 const ring
R =
cf->extRing;
2348 numberCollectionEnumerator.
Reset();
2350 if( !numberCollectionEnumerator.
MoveNext() )
2363 number &n = numberCollectionEnumerator.
Current();
2367 fraction
f = (fraction)n;
2371 const poly
den = DEN(
f);
2386 if( p_IsConstant(
cand,
R) )
2389 while( numberCollectionEnumerator.
MoveNext() ) ;
2395 if( !p_IsConstant(
cand,
R) )
2398 numberCollectionEnumerator.
Reset();
2399 while (numberCollectionEnumerator.
MoveNext() )
2401 number &n = numberCollectionEnumerator.
Current();
2402 const number t =
ntDiv(n, c,
cf);
2433 numberCollectionEnumerator.
Reset();
2435 if( !numberCollectionEnumerator.
MoveNext() )
2446 const ring
R =
cf->extRing;
2455 number &n = numberCollectionEnumerator.
Current();
2490 while( numberCollectionEnumerator.
MoveNext() );
2500 numberCollectionEnumerator.
Reset();
2504 while (numberCollectionEnumerator.
MoveNext() )
2506 number &n = numberCollectionEnumerator.
Current();
2513 fraction
f = (fraction)t;
2516 const poly
den = DEN(
f);
2524 d = n_Copy(pGetCoeff(
den),
Q);
2528 n_Delete(&d,
Q); d =
g;
2535 numberCollectionEnumerator.
Reset();
2536 while (numberCollectionEnumerator.
MoveNext() )
2538 number &n = numberCollectionEnumerator.
Current();
2539 fraction
f = (fraction)n;
2543 const poly
den = DEN(
f);
2552 number ddd = n_Div(d, pGetCoeff(
den),
Q);
2556 p_Delete(&DEN(
f),
R);
2575 poly *P=(poly*)
omAlloc(rl*
sizeof(poly*));
2576 number *X=(number *)
omAlloc(rl*
sizeof(number));
2580 for(
i=0;
i<rl;
i++) P[
i]=p_Copy(
NUM((fraction)(
x[
i])),
cf->extRing);
2585 P[
i]=p_Copy(DEN((fraction)(
x[
i])),
cf->extRing);
2624 fraction nn=(fraction)n;
2627 if (p_IsConstant(
NUM(nn),r->extRing))
2629 n_MPZ(
m,pGetCoeff(
NUM(nn)),r->extRing->cf);
2664 cf->factoryVarOffset =
R->cf->factoryVarOffset + rVar(
R);
2711 if( rCanShortOut(
ntRing) )
2720 cf->iNumberOfParameters = rVar(
R);
2721 cf->pParameterNames = (
const char**)
R->names;
2723 cf->has_simple_Inverse=
FALSE;
Rational pow(const Rational &a, int e)
Concrete implementation of enumerators over polynomials.
char * naCoeffName(const coeffs r)
static coeffs nCoeff_bottom(const coeffs r, int &height)
const CanonicalForm CFMap CFMap & N
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
CanonicalForm convSingPFactoryP(poly p, const ring r)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
poly singclap_pdivide(poly f, poly g, const ring r)
poly singclap_gcd_and_divide(poly &f, poly &g, const ring r)
clears denominators of f and g, divides by gcd(f,g)
poly singclap_gcd_r(poly f, poly g, const ring r)
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
go into polynomials over an alg. extension recursively
virtual reference Current()=0
Gets the current element in the collection (read and write).
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
Templated enumerator interface for simple iteration over a generic collection of T's.
Coefficient rings, fields and other domains suitable for Singular polynomials.
IEnumerator< number > ICoeffsEnumerator
Abstract interface for an enumerator of number coefficients for an object, e.g. a polynomial.
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,...
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
@ n_Q
rational (GMP) numbers
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
static FORCE_INLINE BOOLEAN nCoeff_has_simple_inverse(const coeffs r)
TRUE, if the computation of the inverse is fast, i.e. prefer leading coeff. 1 over content.
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
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...
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
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 ...
@ n_rep_gap_rat
(number), see longrat.h
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
@ n_rep_rat_fct
(fraction), see transext.h
number(*) nMapFunc(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const CanonicalForm int s
factory.h' is the user interface to Factory.
void WerrorS(const char *s)
poly p_ChineseRemainder(poly *xx, mpz_ptr *x, mpz_ptr *q, int rl, mpz_ptr *C, const ring R)
number nlModP(number q, const coeffs, const coeffs Zp)
static FORCE_INLINE BOOLEAN nlIsInteger(number q, const coeffs r)
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
const char *const nDivBy0
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
#define omGetSpecBin(size)
poly p_Diff(poly a, int k, const ring r)
poly p_Farey(poly p, number N, const ring r)
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
poly p_Div_nn(poly p, const number n, const ring r)
void p_Normalize(poly p, const ring r)
void p_Norm(poly p1, const ring r)
poly p_Cleardenom(poly p, const ring r)
int p_Var(poly m, const ring r)
poly p_Sub(poly p1, poly p2, const ring r)
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
const char * p_Read(const char *st, poly &rc, const ring r)
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
void p_Write(poly p, ring lmRing, ring tailRing)
void p_String0Long(const poly p, ring lmRing, ring tailRing)
print p in a long way
void p_String0Short(const poly p, ring lmRing, ring tailRing)
print p in a short way, if possible
#define __p_Mult_nn(p, n, r)
void p_wrp(poly p, ring lmRing, ring tailRing)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
poly prCopyR(poly p, ring src_r, ring dest_r)
void StringAppendS(const char *st)
void PrintS(const char *s)
void rDelete(ring r)
unconditionally deletes fields in r
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise,...
static poly convert(const number &n)
static int ntSize(number a, const coeffs cf)
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
static void ntWriteLong(number a, const coeffs cf)
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
static const char * ntRead(const char *s, number *a, const coeffs cf)
number ntDiff(number a, number d, const coeffs cf)
nMapFunc ntSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_transExt).
static number ntSub(number a, number b, const coeffs cf)
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
static long ntInt(number &a, const coeffs cf)
static number ntMapPP(number a, const coeffs src, const coeffs dst)
static void ntDelete(number *a, const coeffs cf)
static BOOLEAN ntIsOne(number a, const coeffs cf)
static void ntNormalizeDen(fraction result, const ring R)
poly gcd_over_Q(poly f, poly g, const ring r)
helper routine for calling singclap_gcd_r
BOOLEAN ntInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
static BOOLEAN ntIsZero(number a, const coeffs cf)
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
static BOOLEAN ntIsMOne(number a, const coeffs cf)
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
static void ntMPZ(mpz_t m, number &n, const coeffs r)
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
static number ntMap0P(number a, const coeffs src, const coeffs dst)
#define NUMIS1(f)
TRUE iff num. represents 1.
static number ntGcd(number a, number b, const coeffs cf)
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
static number ntInvers(number a, const coeffs cf)
static number ntNormalizeHelper(number a, number b, const coeffs cf)
static void ntPower(number a, int exp, number *b, const coeffs cf)
number ntInit(long i, const coeffs cf)
static number ntMapP0(number a, const coeffs src, const coeffs dst)
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
static number ntMapUP(number a, const coeffs src, const coeffs dst)
static void ntInpMult(number &a, number b, const coeffs cf)
#define MULT_COMPLEXITY
complexity increase due to * and /
static void ntKillChar(coeffs cf)
static void ntInpAdd(number &a, number b, const coeffs cf)
static void ntWriteShort(number a, const coeffs cf)
static number ntDiv(number a, number b, const coeffs cf)
static number ntCopy(number a, const coeffs cf)
static int ntParDeg(number a, const coeffs cf)
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
int ntIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
static number ntMap00(number a, const coeffs src, const coeffs dst)
static number ntMult(number a, number b, const coeffs cf)
#define ADD_COMPLEXITY
complexity increase due to + and -
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
static void definiteGcdCancellation(number a, const coeffs cf, BOOLEAN simpleTestsHaveAlreadyBeenPerformed)
modifies a
static number ntAdd(number a, number b, const coeffs cf)
static number ntFarey(number p, number n, const coeffs cf)
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
static void ntNormalize(number &a, const coeffs cf)
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
VAR omBin fractionObjectBin
#define DIFF_COMPLEXITY
complexity increase due to diff
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
static void handleNestedFractionsOverQ(fraction f, const coeffs cf)
static number ntExactDiv(number a, number b, const coeffs cf)
#define BOUND_COMPLEXITY
maximum complexity of a number
static number ntInitMPZ(mpz_t m, const coeffs r)
struct for passing initialization parameters to naInitChar