33 #define TRANSEXT_PRIVATES 38 #include <factory/factory.h> 62 #define ADD_COMPLEXITY 1 63 #define MULT_COMPLEXITY 2 64 #define DIFF_COMPLEXITY 2 65 #define BOUND_COMPLEXITY 10 68 #define NUMIS1(f) (p_IsOne(NUM(f), cf->extRing)) 70 #define COM(f) (f)->complexity 77 #define ntTest(a) n_Test(a, cf) 81 #define ntRing cf->extRing 87 #define ntCoeffs cf->extRing->cf 95 BOOLEAN simpleTestsHaveAlreadyBeenPerformed);
145 if (IS0(a))
return TRUE;
147 const fraction t = (fraction)a;
159 Print(
"ERROR in %s:%d: non-integer Q coeff in num. poly\n",f,l);
174 Print(
"ERROR in %s:%d: non-integer Q coeff in den. poly\n",f,l);
183 Print(
"ERROR in %s:%d: constant den. poly / Zp\n",f,l);
191 Print(
"ERROR in %s:%d: non-monic den. poly / Zp\n",f,l);
205 Print(
"ERROR in %s:%d: 1 != GCD between num. & den. poly\n",f,l);
218 Print(
"?/1 in %s:%d\n",f,l);
223 Print(
"negative sign of DEN. of a fraction in %s:%d\n",f,l);
253 if (!(
SR_HDL(n) & SR_INT))
256 Print(
"rational coeff in num: %s:%d\n",f,l);
267 Print(
"rational coeff in den.:%s:%d\n",f,l);
288 cf = cf->extRing->cf;
306 fraction
f = (fraction)(*a);
322 if (a == b)
return TRUE;
323 if ((IS0(a)) && (!IS0(b)))
return FALSE;
324 if ((IS0(b)) && (!IS0(a)))
return FALSE;
327 fraction fa = (fraction)a;
328 fraction fb = (fraction)b;
329 if ((
COM(fa) == 1) && (
COM(fb) == 1))
335 if (DENIS1(fa) && DENIS1(fb))
return TRUE;
336 if (DENIS1(fa) && !DENIS1(fb))
return FALSE;
337 if (!DENIS1(fa) && DENIS1(fb))
return FALSE;
364 if (IS0(a))
return NULL;
365 fraction
f = (fraction)a;
371 DEN(result) =
p_Copy(h,cf->extRing);
409 number c; number tmp;
418 lcmOfDenominators = tmp;
427 lcmOfDenominators = tmp;
448 gcdOfCoefficients = tmp;
457 gcdOfCoefficients = tmp;
462 number inverseOfGcdOfCoefficients =
n_Invers(gcdOfCoefficients,
476 if ((DEN(f) !=
NULL) &&
498 if (IS0(a))
return NULL;
502 fraction
f = (fraction)a;
505 const BOOLEAN denis1= DENIS1 (f);
572 fraction
f = (fraction)a;
576 const BOOLEAN denis1 = DENIS1 (f);
594 if( DEN (f) !=
NULL )
662 fraction
f = (fraction)a;
671 fraction
f = (fraction)a;
672 if ((f==
NULL) || (!DENIS1(f)))
return FALSE;
685 fraction
f = (fraction)a;
765 if (IS0(a))
return 0;
767 fraction
f = (fraction)a;
768 if (!DENIS1(f))
return 0;
788 if (IS0(a))
return FALSE;
789 fraction
f = (fraction)a;
800 number aNumCoeff =
NULL;
int aNumDeg = 0;
801 number aDenCoeff =
NULL;
int aDenDeg = 0;
802 number bNumCoeff =
NULL;
int bNumDeg = 0;
803 number bDenCoeff =
NULL;
int bDenDeg = 0;
806 if (IS0(b))
return FALSE;
807 fraction fb = (fraction)b;
812 fraction fa = (fraction)a;
816 fraction fa = (fraction)a;
824 fraction fb = (fraction)b;
832 if (aNumDeg-aDenDeg > bNumDeg-bDenDeg)
return TRUE;
833 if (aNumDeg-aDenDeg < bNumDeg-bDenDeg)
return FALSE;
850 const ring
A = cf->extRing;
859 const int P =
rVar(A);
864 for (
int nop=0; nop <
P; nop ++)
867 if (nop!=P-1)
PrintS(
", ");
899 fraction t = (fraction) d;
902 WerrorS(
"expected differentiation by a variable");
908 WerrorS(
"expected differentiation by a variable");
912 if (IS0(a))
return ntCopy(a, cf);
914 fraction fa = (fraction)a;
950 if (IS0(a))
return ntCopy(b, cf);
951 if (IS0(b))
return ntCopy(a, cf);
953 fraction fa = (fraction)a;
954 fraction fb = (fraction)b;
965 if (DENIS1(fa) && DENIS1(fb)) f =
NULL;
966 else if (!DENIS1(fa) && DENIS1(fb)) f =
p_Copy(DEN(fa),
ntRing);
967 else if (DENIS1(fa) && !DENIS1(fb)) f =
p_Copy(DEN(fb),
ntRing);
992 if (IS0(b))
return ntCopy(a, cf);
994 fraction fa = (fraction)a;
995 fraction fb = (fraction)b;
1006 if (DENIS1(fa) && DENIS1(fb)) f =
NULL;
1007 else if (!DENIS1(fa) && DENIS1(fb)) f =
p_Copy(DEN(fa),
ntRing);
1008 else if (DENIS1(fa) && !DENIS1(fb)) f =
p_Copy(DEN(fb),
ntRing);
1031 if (IS0(a) || IS0(b))
return NULL;
1033 fraction fa = (fraction)a;
1034 fraction fb = (fraction)b;
1044 const poly da = DEN(fa);
1045 const poly db = DEN(fb);
1099 && (DEN(result)!=
NULL))
1125 if (IS0(a))
return NULL;
1128 fraction fa = (fraction)a;
1129 fraction fb = (fraction)b;
1170 fraction
f = (fraction)a;
1196 DEN(result) = num_f;
1234 if (exp >= 0) *b =
NULL;
1237 else if (exp == 0) { *b =
ntInit(1, cf);
return;}
1238 else if (exp == 1) { *b =
ntCopy(a, cf);
return;}
1239 else if (exp == -1) { *b =
ntInvers(a, cf);
return;}
1241 int expAbs =
exp;
if (expAbs < 0) expAbs = -expAbs;
1244 number
pow; number t;
1248 for (
int i = 2;
i <= expAbs;
i++)
1264 t =
ntMult(pow, factor, cf);
1269 expAbs = expAbs / 2;
1272 t =
ntMult(factor, factor, cf);
1299 fraction
f = (fraction)a;
1301 if (DENIS1(f) ||
NUMIS1(f)) {
COM(f) = 0;
return; }
1319 if( DEN(f) !=
NULL )
1363 }
while(i<ntRing->
N);
1381 BOOLEAN simpleTestsHaveAlreadyBeenPerformed)
1385 fraction
f = (fraction)a;
1388 if (
COM(f)==0)
return;
1390 if (!simpleTestsHaveAlreadyBeenPerformed)
1514 if( DEN(f) !=
NULL )
1539 fraction
f = (fraction)a;
1564 fraction
f = (fraction)a;
1599 if ((DEN((fraction)a)!=
NULL)
1637 fraction fb = (fraction)b;
1639 fraction fa = (fraction)a;
1654 number contentpa, contentpb, tmp;
1727 fraction fa = (fraction)a;
1728 fraction fb = (fraction)b;
1743 number contentpa, contentpb, tmp;
1800 if (IS0(a))
return -1;
1805 fraction
f = (fraction)a;
1821 return numDegree + denDegree + noOfTerms;
1830 assume(src->rep == dst->extRing->cf->rep);
1840 fraction ff=(fraction)res;
1842 else DEN(ff)=
p_NSet(nn,dst->extRing);
1854 poly p=
p_NSet(nMap(a, src,dst->extRing->cf), dst->extRing);
1868 int n =
n_Int(a, src);
1869 number q =
n_Init(n, dst->extRing->cf);
1882 if (IS0(a))
return NULL;
1884 const ring rSrc = cf->extRing;
1885 const ring rDst = dst->extRing;
1890 fraction
f = (fraction)a;
1896 h =
prCopyR(DEN(f), rSrc, rDst);
1904 n_Test((number)result, dst);
1911 if (IS0(a))
return NULL;
1913 const ring rSrc = cf->extRing;
1914 const ring rDst = dst->extRing;
1917 fraction
f = (fraction)a;
1949 h =
prMapR(DEN(f), nMap, rSrc, rDst);
1983 n_Test((number)result, dst);
2010 number q =
nlModP(a, src, dst->extRing->cf);
2032 assume(src == dst->extRing->cf);
2048 int n =
n_Int(a, src);
2049 number q =
n_Init(n, dst->extRing->cf);
2056 p =
p_One(dst->extRing);
2090 if (src->ch == dst->ch)
return ntMapPP;
2094 if (h != 1)
return NULL;
2102 if (
rVar(src->extRing) >
rVar(dst->extRing))
2105 for (
int i = 0;
i <
rVar(src->extRing);
i++)
2111 if (src->extRing->cf==dst->extRing->cf)
2118 if (src->extRing->cf==dst->extRing->cf)
2130 if (n==
ntCopyAlg) printf(
"n=ntCopyAlg\n");
2131 else if (n==
ntCopyMap) printf(
"n=ntCopyMap\n");
2132 else if (n==
ntMapUP) printf(
"n=ntMapUP\n");
2133 else if (n==
ntMap0P) printf(
"n=ntMap0P\n");
2134 else if (n==
ntMapP0) printf(
"n=ntMapP0\n");
2135 else if (n==
ntMap00) printf(
"n=ntMap00\n");
2136 else if (n==
NULL) printf(
"n=NULL\n");
2137 else printf(
"n=?\n");
2144 if ((--cf->extRing->ref) == 0)
2164 fraction
f = (fraction)n;
2171 if (IS0(a))
return -1;
2172 fraction fa = (fraction)a;
2173 return cf->extRing->pFDeg(
NUM(fa),cf->extRing);
2181 const ring
R = cf->extRing;
2183 assume( 0 < iParameter && iParameter <=
rVar(R) );
2204 const ring
R = cf->extRing;
2207 fraction
f = (fraction)m;
2209 if( DEN(f) !=
NULL )
2220 return NUM((fraction)n);
2232 const ring
R = cf->extRing;
2239 numberCollectionEnumerator.
Reset();
2241 if( !numberCollectionEnumerator.
MoveNext() )
2254 number &n = numberCollectionEnumerator.
Current();
2258 fraction
f = (fraction)n;
2276 while( numberCollectionEnumerator.
MoveNext() ) ;
2285 numberCollectionEnumerator.
Reset();
2286 while (numberCollectionEnumerator.
MoveNext() )
2288 number &n = numberCollectionEnumerator.
Current();
2289 const number t =
ntDiv(n, c, cf);
2306 number gg =
ntMult(g, c, cf);
2320 numberCollectionEnumerator.
Reset();
2322 if( !numberCollectionEnumerator.
MoveNext() )
2333 const ring
R = cf->extRing;
2342 number &n = numberCollectionEnumerator.
Current();
2377 while( numberCollectionEnumerator.
MoveNext() );
2387 numberCollectionEnumerator.
Reset();
2391 while (numberCollectionEnumerator.
MoveNext() )
2393 number &n = numberCollectionEnumerator.
Current();
2394 number t =
ntMult(n, c, cf);
2400 fraction
f = (fraction)t;
2422 numberCollectionEnumerator.
Reset();
2423 while (numberCollectionEnumerator.
MoveNext() )
2425 number &n = numberCollectionEnumerator.
Current();
2426 fraction
f = (fraction)n;
2463 number *X=(number *)
omAlloc(rl*
sizeof(number));
2467 for(i=0;i<rl;i++) P[i]=
p_Copy(
NUM((fraction)(x[
i])),cf->extRing);
2472 P[
i]=
p_Copy(DEN((fraction)(x[i])),cf->extRing);
2485 return ((number)result);
2493 DEN(result)=
p_Farey(
p_Copy(DEN((fraction)p),cf->extRing),n,cf->extRing);
2495 return ((number)result);
2526 cf->factoryVarOffset = R->cf->factoryVarOffset +
rVar(R);
2541 cf->cfInpNeg =
ntNeg;
2546 cf->cfExactDiv =
ntDiv;
2563 cf->cfSubringGcd =
ntGcd;
2579 cf->iNumberOfParameters =
rVar(R);
2580 cf->pParameterNames = (
const char**)R->names;
2582 cf->has_simple_Inverse=
FALSE;
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 number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n) ...
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...
const CanonicalForm int s
poly p_Diff(poly a, int k, const ring r)
#define BOUND_COMPLEXITY
maximum complexity of a number
poly singclap_gcd_r(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)
static BOOLEAN ntIsMOne(number a, const coeffs cf)
static void ntNormalizeDen(fraction result, const ring R)
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
number ntDiff(number a, number d, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
poly prCopyR(poly p, ring src_r, ring dest_r)
char * naCoeffName(const coeffs r)
static poly convert(const number &n)
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
number nlModP(number q, const coeffs, const coeffs Zp)
#define DIFF_COMPLEXITY
complexity increase due to * and /
static BOOLEAN ntIsOne(number a, const coeffs cf)
void p_String0Long(const poly p, ring lmRing, ring tailRing)
print p in a long way
static FORCE_INLINE BOOLEAN nlIsInteger(number q, const coeffs r)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
static void ntPower(number a, int exp, number *b, const coeffs cf)
static void definiteGcdCancellation(number a, const coeffs cf, BOOLEAN simpleTestsHaveAlreadyBeenPerformed)
modifies a
static BOOLEAN ntIsZero(number a, 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
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
#define omFreeSize(addr, size)
static short rVar(const ring r)
#define rVar(r) (r->N)
poly singclap_gcd(poly f, poly g, const ring r)
destroys f and g
(), see rinteger.h, new impl.
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...
poly p_Div_nn(poly p, const number n, const ring r)
static number ntFarey(number p, number n, const coeffs cf)
static long p_Totaldegree(poly p, const ring r)
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
void WerrorS(const char *s)
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...
(fraction), see transext.h
nMapFunc ntSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_transExt)
void p_Norm(poly p1, const ring r)
static number ntCopy(number a, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
char * naCoeffString(const coeffs r)
poly singclap_pdivide(poly f, poly g, const ring r)
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
static number p_SetCoeff(poly p, number n, ring r)
poly p_Sub(poly p1, poly p2, const ring r)
static coeffs nCoeff_bottom(const coeffs r, int &height)
static BOOLEAN rCanShortOut(const ring r)
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
static void ntWriteShort(number a, const coeffs cf)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static number ntGcd(number a, number b, const coeffs cf)
poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
static int ntParDeg(number a, const coeffs cf)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection...
const char * p_Read(const char *st, poly &rc, const ring r)
static number ntMap00(number a, const coeffs src, const coeffs dst)
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 void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Coefficient rings, fields and other domains suitable for Singular polynomials.
static void ntNormalize(number &a, const coeffs cf)
poly p_Farey(poly p, number N, const ring 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 ...
const CanonicalForm CFMap CFMap & N
Concrete implementation of enumerators over polynomials.
static number ntAdd(number a, number b, const coeffs cf)
static void ntWriteLong(number a, const coeffs cf)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
static long ntInt(number &a, const coeffs cf)
number ntInit(long i, const coeffs cf)
static BOOLEAN p_IsConstant(const poly p, const ring r)
static void ntKillChar(coeffs cf)
The main handler for Singular numbers which are suitable for Singular polynomials.
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Templated enumerator interface for simple iteration over a generic collection of T's.
static poly pp_Mult_qq(poly p, poly q, const ring r)
void StringAppendS(const char *st)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
virtual reference Current()=0
Gets the current element in the collection (read and write).
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
static void ntDelete(number *a, const coeffs cf)
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 ...
static number ntMapUP(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
#define NUMIS1(f)
TRUE iff num. represents 1.
struct for passing initialization parameters to naInitChar
const char *const nDivBy0
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
static BOOLEAN p_IsOne(const poly p, const ring R)
either poly(1) or gen(k)?!
void PrintS(const char *s)
static char * rRingVar(short i, const ring r)
static poly p_Mult_nn(poly p, number n, const ring r)
static const char * ntRead(const char *s, number *a, const coeffs cf)
static poly p_LmFreeAndNext(poly p, ring)
static unsigned pLength(poly a)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
go into polynomials over an alg. extension recursively
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
static number ntNormalizeHelper(number a, number b, const coeffs cf)
void p_Normalize(poly p, const ring r)
static void p_Delete(poly *p, const ring r)
#define omGetSpecBin(size)
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
static number ntMult(number a, number b, const coeffs cf)
CanonicalForm convSingPFactoryP(poly p, const ring r)
static void handleNestedFractionsOverQ(fraction f, const coeffs cf)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
void rDelete(ring r)
unconditionally deletes fields in r
static number ntMap0P(number a, const coeffs src, const coeffs dst)
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 int ntSize(number a, const coeffs cf)
static number ntInvers(number a, const coeffs cf)
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
poly p_ChineseRemainder(poly *xx, number *x, number *q, int rl, CFArray &inv_cache, const ring R)
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1) ...
static void p_Setm(poly p, const ring r)
static number ntMapP0(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
static number ntDiv(number a, number b, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
int ntIsParam(number m, const coeffs cf)
if m == var(i)/1 => return i,
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
static poly p_Neg(poly p, const ring r)
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
void p_wrp(poly p, ring lmRing, ring tailRing)
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 number ntSub(number a, number b, const coeffs cf)
void p_Write(poly p, ring lmRing, ring tailRing)
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
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), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
#define ADD_COMPLEXITY
complexity increase due to + and -
static poly p_Add_q(poly p, poly q, const ring r)
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
#define omFreeBin(addr, bin)
Rational pow(const Rational &a, int e)
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
int p_Var(poly m, const ring r)
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
#define MULT_COMPLEXITY
complexity increase due to * and /
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
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)
void p_String0Short(const poly p, ring lmRing, ring tailRing)
print p in a short way, if possible
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
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 number ntMapPP(number a, const coeffs src, const coeffs dst)
BOOLEAN ntInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.