Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
coeffs.h File Reference

Coefficient rings, fields and other domains suitable for Singular polynomials. More...

#include <misc/auxiliary.h>
#include <omalloc/omalloc.h>
#include <misc/sirandom.h>
#include <reporter/reporter.h>
#include <reporter/s_buff.h>
#include <coeffs/si_gmp.h>
#include <coeffs/Enumerator.h>
#include <coeffs/numstats.h>

Go to the source code of this file.

Data Structures

struct  GFInfo
 Creation data needed for finite fields. More...
 
struct  LongComplexInfo
 
struct  coeffs
 

Macros

#define FREE_RNUMBER(x)   omFreeBin((void *)x, rnumber_bin)
 
#define ALLOC_RNUMBER()   (number)omAllocBin(rnumber_bin)
 
#define ALLOC0_RNUMBER()   (number)omAlloc0Bin(rnumber_bin)
 
#define n_New(n, r)   nNew(n)
 
#define n_Test(a, r)   n_DBTest(a, __FILE__, __LINE__, r)
 BOOLEAN n_Test(number a, const coeffs r) More...
 

Typedefs

typedef number(* numberfunc) (number a, number b, const coeffs r)
 
typedef number(* nMapFunc) (number a, const coeffs src, const coeffs dst)
 maps "a", which lives in src, into dst More...
 
typedef IEnumerator< number > ICoeffsEnumerator
 Abstract interface for an enumerator of number coefficients for an object, e.g. a polynomial. More...
 
typedef void(* nCoeffsEnumeratorFunc) (ICoeffsEnumerator &numberCollectionEnumerator, number &output, const coeffs r)
 goes over coeffs given by the ICoeffsEnumerator and changes them. Additionally returns a number; More...
 

Enumerations

enum  n_coeffType {
  n_unknown =0, n_Zp, n_Q, n_R,
  n_GF, n_long_R, n_algExt, n_transExt,
  n_long_C, n_Z, n_Zn, n_Znm,
  n_Z2m, n_CF
}
 
enum  n_coeffRep {
  n_rep_unknown =0, n_rep_int, n_rep_gap_rat, n_rep_gap_gmp,
  n_rep_poly, n_rep_rat_fct, n_rep_gmp, n_rep_float,
  n_rep_gmp_float, n_rep_gmp_complex, n_rep_gf
}
 

Functions

static FORCE_INLINE n_coeffType getCoeffType (const coeffs r)
 Returns the type of coeffs domain. More...
 
coeffs nInitChar (n_coeffType t, void *parameter)
 one-time initialisations for new coeffs in case of an error return NULL More...
 
static FORCE_INLINE coeffs nCopyCoeff (const coeffs r)
 "copy" coeffs, i.e. increment ref More...
 
void nKillChar (coeffs r)
 undo all initialisations More...
 
static FORCE_INLINE void nSetChar (const coeffs r)
 initialisations after each ring change More...
 
void nNew (number *a)
 
static FORCE_INLINE int n_GetChar (const coeffs r)
 Return the characteristic of the coeff. domain. More...
 
static FORCE_INLINE number n_Copy (number n, const coeffs r)
 return a copy of 'n' More...
 
static FORCE_INLINE void n_Delete (number *p, const coeffs r)
 delete 'p' More...
 
static FORCE_INLINE BOOLEAN n_Equal (number a, number b, const coeffs r)
 TRUE iff 'a' and 'b' represent the same number; they may have different representations. More...
 
static FORCE_INLINE BOOLEAN n_IsZero (number n, const coeffs r)
 TRUE iff 'n' represents the zero element. More...
 
static FORCE_INLINE BOOLEAN n_IsOne (number n, const coeffs r)
 TRUE iff 'n' represents the one element. More...
 
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. More...
 
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 More...
 
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 long's representing More...
 
static FORCE_INLINE int n_DivComp (number a, number b, const coeffs r)
 
static FORCE_INLINE BOOLEAN n_IsUnit (number n, const coeffs r)
 TRUE iff n has a multiplicative inverse in the given coeff field/ring r. More...
 
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 in Z/2^kZ: largest odd divisor of n (taken in Z) other cases: not implemented More...
 
static FORCE_INLINE coeffs n_CoeffRingQuot1 (number c, const coeffs r)
 
static FORCE_INLINE number n_Init (long i, const coeffs r)
 a number representing i in the given coeff field/ring r More...
 
static FORCE_INLINE number n_InitMPZ (mpz_t n, const coeffs r)
 conversion of a GMP integer to number More...
 
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 .. p/2] More...
 
static FORCE_INLINE void n_MPZ (mpz_t result, number &n, const coeffs r)
 conversion of n to a GMP integer; 0 if not possible More...
 
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) More...
 
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 More...
 
static FORCE_INLINE int n_Size (number n, const coeffs r)
 return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used for pivot strategies in matrix computations with entries from r) More...
 
static FORCE_INLINE void n_Normalize (number &n, const coeffs r)
 inplace-normalization of n; produces some canonical representation of n; More...
 
static FORCE_INLINE void n_WriteLong (number &n, const coeffs r)
 write to the output buffer of the currently used reporter More...
 
static FORCE_INLINE void n_WriteShort (number &n, const coeffs r)
 write to the output buffer of the currently used reporter in a shortest possible way, e.g. in K(a): a2 instead of a^2 More...
 
static FORCE_INLINE void n_Write (number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
 
static FORCE_INLINE const char * n_Read (const char *s, number *a, const coeffs r)
 !!! Recommendation: This method is too cryptic to be part of the user- !!! interface. As defined here, it is merely a helper !!! method for parsing number input strings. More...
 
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) More...
 
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) More...
 
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 exception in Z: raises an error if 'a' is not divisible by 'b' More...
 
static FORCE_INLINE number n_ExactDiv (number a, number b, const coeffs r)
 assume that there is a canonical subring in cf and we know that division is possible for these a and b in the subring, n_ExactDiv performs it, may skip additional tests. Can always be substituted by n_Div at the cost of larger computing time. More...
 
static FORCE_INLINE number n_IntMod (number a, number b, const coeffs r)
 for r a field, return n_Init(0,r) otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a More...
 
static FORCE_INLINE void n_Power (number a, int b, number *res, const coeffs r)
 fill res with the power a^b More...
 
static FORCE_INLINE number n_Mult (number a, number b, const coeffs r)
 return the product of 'a' and 'b', i.e., a*b More...
 
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 More...
 
static FORCE_INLINE void n_InpAdd (number &a, number b, const coeffs r)
 addition of 'a' and 'b'; replacement of 'a' by the sum a+b More...
 
static FORCE_INLINE number n_Add (number a, number b, const coeffs r)
 return the sum of 'a' and 'b', i.e., a+b More...
 
static FORCE_INLINE number n_Sub (number a, number b, const coeffs r)
 return the difference of 'a' and 'b', i.e., a-b More...
 
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, C, R: not implemented in Q: return the gcd of the numerators of 'a' and 'b' in K(a)/<p(a)>: not implemented in K(t_1, ..., t_n): not implemented More...
 
static FORCE_INLINE number n_SubringGcd (number a, number b, const coeffs r)
 
static FORCE_INLINE number n_ExtGcd (number a, number b, number *s, number *t, const coeffs r)
 beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpected in some cases... More...
 
static FORCE_INLINE number n_XExtGcd (number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
 
static FORCE_INLINE number n_EucNorm (number a, const coeffs r)
 
static FORCE_INLINE number n_Ann (number a, const coeffs r)
 if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL More...
 
static FORCE_INLINE number n_QuotRem (number a, number b, number *q, const coeffs r)
 
static FORCE_INLINE number n_Lcm (number a, number b, const coeffs r)
 in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ, C, R: not implemented in K(a)/<p(a)>: not implemented in K(t_1, ..., t_n): not implemented More...
 
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,b2)/1) More...
 
static FORCE_INLINE nMapFunc n_SetMap (const coeffs src, const coeffs dst)
 set the mapping function pointers for translating numbers from src to dst More...
 
static FORCE_INLINE BOOLEAN n_DBTest (number n, const char *filename, const int linenumber, const coeffs r)
 test whether n is a correct number; only used if LDEBUG is defined More...
 
static FORCE_INLINE void n_CoeffWrite (const coeffs r, BOOLEAN details=TRUE)
 output the coeff description More...
 
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_ModN (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Ring (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Domain (const coeffs r)
 returns TRUE, if r is a field or r has no zero divisors (i.e is a domain) More...
 
static FORCE_INLINE BOOLEAN n_DivBy (number a, number b, const coeffs r)
 test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z: TRUE iff 'b' divides 'a' (with remainder = zero) in Z/nZ: TRUE iff (a = 0 and b divides n in Z) or (a != 0 and b/gcd(a, b) is co-prime with n, i.e. a unit in Z/nZ) in Z/2^kZ: TRUE iff ((a = 0 mod 2^k) and (b = 0 or b is a power of 2)) or ((a, b <> 0) and (b/gcd(a, b) is odd)) More...
 
static FORCE_INLINE number n_ChineseRemainderSym (number *a, number *b, int rl, BOOLEAN sym, const coeffs r)
 
static FORCE_INLINE number n_Farey (number a, number b, const coeffs r)
 
static FORCE_INLINE int n_ParDeg (number n, const coeffs r)
 
static FORCE_INLINE int n_NumberOfParameters (const coeffs r)
 Returns the number of parameters. More...
 
static FORCE_INLINE char const ** n_ParameterNames (const coeffs r)
 Returns a (const!) pointer to (const char*) names of parameters. More...
 
static FORCE_INLINE number n_Param (const int iParameter, const coeffs r)
 return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1..n_NumberOfParameters(...) More...
 
static FORCE_INLINE number n_RePart (number i, const coeffs cf)
 
static FORCE_INLINE number n_ImPart (number i, const coeffs cf)
 
static FORCE_INLINE BOOLEAN nCoeff_has_Units (const coeffs r)
 returns TRUE, if r is not a field and r has non-trivial units More...
 
static FORCE_INLINE BOOLEAN nCoeff_is_Zp (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Zp (const coeffs r, int p)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Q (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_numeric (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_R (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_GF (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_GF (const coeffs r, int q)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Extension (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a (const coeffs r, int p)
 
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_long_R (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_long_C (const coeffs r)
 
static FORCE_INLINE BOOLEAN nCoeff_is_CF (const coeffs r)
 
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. More...
 
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc (const coeffs r)
 TRUE if n_Delete/n_New are empty operations. More...
 
static FORCE_INLINE BOOLEAN nCoeff_is_algExt (const coeffs r)
 TRUE iff r represents an algebraic extension field. More...
 
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algext (const coeffs r)
 is it an alg. ext. of Q? More...
 
static FORCE_INLINE BOOLEAN nCoeff_is_transExt (const coeffs r)
 TRUE iff r represents a transcendental extension field. More...
 
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 (i.e. the GCD of all the coeffs, which we divide out inplace) NOTE: it assumes all coefficient numbers to be integer!!! NOTE/TODO: see also the description by Hans TODO: rename into n_ClearIntegerContent. More...
 
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 denominators (i.e. the number with which all the number coeffs. were multiplied) NOTE/TODO: see also the description by Hans More...
 
static FORCE_INLINE void n_ClearContent (ICoeffsEnumerator &numberCollectionEnumerator, const coeffs r)
 
static FORCE_INLINE void n_ClearDenominators (ICoeffsEnumerator &numberCollectionEnumerator, const coeffs r)
 
void n_Print (number &a, const coeffs r)
 print a number (BEWARE of string buffers!) mostly for debugging More...
 
static FORCE_INLINE char * nCoeffString (const coeffs cf)
 TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar. More...
 
static FORCE_INLINE char * nCoeffName (const coeffs cf)
 
static FORCE_INLINE number n_Random (siRandProc p, number p1, number p2, const coeffs cf)
 
static FORCE_INLINE void n_WriteFd (number a, FILE *f, const coeffs r)
 io via ssi: More...
 
static FORCE_INLINE number n_ReadFd (s_buff f, const coeffs r)
 io via ssi: More...
 
number n_convFactoryNSingN (const CanonicalForm n, const coeffs r)
 
CanonicalForm n_convSingNFactoryN (number n, BOOLEAN setChar, const coeffs r)
 
static FORCE_INLINE void number2mpz (number n, coeffs c, mpz_t m)
 
static FORCE_INLINE number mpz2number (mpz_t m, coeffs c)
 

Variables

unsigned short fftable []
 
omBin rnumber_bin
 

Detailed Description

Coefficient rings, fields and other domains suitable for Singular polynomials.

The main interface for Singular coefficients: coeffs is the main handler for Singular numbers

Definition in file coeffs.h.


Data Structure Documentation

struct GFInfo

Creation data needed for finite fields.

Definition at line 90 of file coeffs.h.

Data Fields
int GFChar
int GFDegree
const char * GFPar_name
struct LongComplexInfo

Definition at line 97 of file coeffs.h.

Data Fields
short float_len additional char-flags, rInit
short float_len2 additional char-flags, rInit
const char * par_name parameter name

Macro Definition Documentation

#define ALLOC0_RNUMBER ( )    (number)omAlloc0Bin(rnumber_bin)

Definition at line 86 of file coeffs.h.

#define ALLOC_RNUMBER ( )    (number)omAllocBin(rnumber_bin)

Definition at line 85 of file coeffs.h.

#define FREE_RNUMBER (   x)    omFreeBin((void *)x, rnumber_bin)

Definition at line 84 of file coeffs.h.

#define n_New (   n,
  r 
)    nNew(n)

Definition at line 440 of file coeffs.h.

#define n_Test (   a,
  r 
)    n_DBTest(a, __FILE__, __LINE__, r)

BOOLEAN n_Test(number a, const coeffs r)

Definition at line 918 of file coeffs.h.

Typedef Documentation

typedef IEnumerator<number> ICoeffsEnumerator

Abstract interface for an enumerator of number coefficients for an object, e.g. a polynomial.

Definition at line 76 of file coeffs.h.

typedef void(* nCoeffsEnumeratorFunc) (ICoeffsEnumerator &numberCollectionEnumerator, number &output, const coeffs r)

goes over coeffs given by the ICoeffsEnumerator and changes them. Additionally returns a number;

Definition at line 80 of file coeffs.h.

typedef number(* nMapFunc) (number a, const coeffs src, const coeffs dst)

maps "a", which lives in src, into dst

Definition at line 71 of file coeffs.h.

typedef number(* numberfunc) (number a, number b, const coeffs r)

Definition at line 68 of file coeffs.h.

Enumeration Type Documentation

enum n_coeffRep
Enumerator
n_rep_unknown 
n_rep_int 

(int), see modulop.h

n_rep_gap_rat 

(number), see longrat.h

n_rep_gap_gmp 

(), see rinteger.h, new impl.

n_rep_poly 

(poly), see algext.h

n_rep_rat_fct 

(fraction), see transext.h

n_rep_gmp 

(mpz_ptr), see rmodulon,h

n_rep_float 

(float), see shortfl.h

n_rep_gmp_float 

(gmp_float), see

n_rep_gmp_complex 

(gmp_complex), see gnumpc.h

n_rep_gf 

(int), see ffields.h

Definition at line 105 of file coeffs.h.

106 {
107  n_rep_unknown=0,
108  n_rep_int, /**< (int), see modulop.h */
109  n_rep_gap_rat, /**< (number), see longrat.h */
110  n_rep_gap_gmp, /**< (), see rinteger.h, new impl. */
111  n_rep_poly, /**< (poly), see algext.h */
112  n_rep_rat_fct, /**< (fraction), see transext.h */
113  n_rep_gmp, /**< (mpz_ptr), see rmodulon,h */
114  n_rep_float, /**< (float), see shortfl.h */
115  n_rep_gmp_float, /**< (gmp_float), see */
116  n_rep_gmp_complex,/**< (gmp_complex), see gnumpc.h */
117  n_rep_gf /**< (int), see ffields.h */
118 };
(), see rinteger.h, new impl.
Definition: coeffs.h:110
(fraction), see transext.h
Definition: coeffs.h:112
(poly), see algext.h
Definition: coeffs.h:111
(gmp_complex), see gnumpc.h
Definition: coeffs.h:116
(mpz_ptr), see rmodulon,h
Definition: coeffs.h:113
(number), see longrat.h
Definition: coeffs.h:109
(gmp_float), see
Definition: coeffs.h:115
(int), see modulop.h
Definition: coeffs.h:108
(int), see ffields.h
Definition: coeffs.h:117
(float), see shortfl.h
Definition: coeffs.h:114
Enumerator
n_unknown 
n_Zp 

{p < 2^31}

n_Q 

rational (GMP) numbers

n_R 

single prescision (6,6) real numbers

n_GF 

{p^n < 2^16}

n_long_R 

real floating point (GMP) numbers

n_algExt 

used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic

n_transExt 

used for all transcendental extensions, i.e., the top-most extension in an extension tower is transcendental

n_long_C 

complex floating point (GMP) numbers

n_Z 

only used if HAVE_RINGS is defined: ?

n_Zn 

only used if HAVE_RINGS is defined: ?

n_Znm 

only used if HAVE_RINGS is defined: ?

n_Z2m 

only used if HAVE_RINGS is defined: ?

n_CF 

?

Definition at line 26 of file coeffs.h.

27 {
28  n_unknown=0,
29  n_Zp, /**< \F{p < 2^31} */
30  n_Q, /**< rational (GMP) numbers */
31  n_R, /**< single prescision (6,6) real numbers */
32  n_GF, /**< \GF{p^n < 2^16} */
33  n_long_R, /**< real floating point (GMP) numbers */
34  n_algExt, /**< used for all algebraic extensions, i.e.,
35  the top-most extension in an extension tower
36  is algebraic */
37  n_transExt, /**< used for all transcendental extensions, i.e.,
38  the top-most extension in an extension tower
39  is transcendental */
40  n_long_C, /**< complex floating point (GMP) numbers */
41  n_Z, /**< only used if HAVE_RINGS is defined: ? */
42  n_Zn, /**< only used if HAVE_RINGS is defined: ? */
43  n_Znm, /**< only used if HAVE_RINGS is defined: ? */
44  n_Z2m, /**< only used if HAVE_RINGS is defined: ? */
45  n_CF /**< ? */
46 };
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:42
?
Definition: coeffs.h:45
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:44
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:37
rational (GMP) numbers
Definition: coeffs.h:30
{p < 2^31}
Definition: coeffs.h:29
real floating point (GMP) numbers
Definition: coeffs.h:33
single prescision (6,6) real numbers
Definition: coeffs.h:31
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:43
complex floating point (GMP) numbers
Definition: coeffs.h:40
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:41
{p^n < 2^16}
Definition: coeffs.h:32
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:34

Function Documentation

static FORCE_INLINE n_coeffType getCoeffType ( const coeffs  r)
static

Returns the type of coeffs domain.

Definition at line 421 of file coeffs.h.

422 { assume(r != NULL); return r->type; }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number mpz2number ( mpz_t  m,
coeffs  c 
)
static

Definition at line 987 of file coeffs.h.

987 { return n_InitMPZ(m, c); }
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
Definition: coeffs.h:541
int m
Definition: cfEzgcd.cc:119
static FORCE_INLINE number n_Add ( number  a,
number  b,
const coeffs  r 
)
static

return the sum of 'a' and 'b', i.e., a+b

Definition at line 653 of file coeffs.h.

654 { STATISTIC(n_Add); assume(r != NULL); assume(r->cfAdd!=NULL); const number sum = r->cfAdd(a, b, r);
655 
656 #ifdef HAVE_NUMSTATS
657  // avoid double counting
658  if( r->cfIsZero(sum,r) ) STATISTIC(n_CancelOut);
659 #endif
660 
661  return sum;
662 }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
Definition: coeffs.h:653
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_Ann ( number  a,
const coeffs  r 
)
static

if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL

Definition at line 698 of file coeffs.h.

699 { STATISTIC(n_Ann); assume(r != NULL); return r->cfAnn (a,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE number n_Ann(number a, const coeffs r)
if r is a ring with zero divisors, return an annihilator!=0 of b otherwise return NULL ...
Definition: coeffs.h:698
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_ChineseRemainderSym ( number *  a,
number *  b,
int  rl,
BOOLEAN  sym,
const coeffs  r 
)
static

Definition at line 780 of file coeffs.h.

781 { STATISTIC(n_ChineseRemainderSym); assume(r != NULL); assume(r->cfChineseRemainder != NULL); return r->cfChineseRemainder(a,b,rl,sym,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym, const coeffs r)
Definition: coeffs.h:780
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE void n_ClearContent ( ICoeffsEnumerator numberCollectionEnumerator,
number &  c,
const coeffs  r 
)
static

Computes the content and (inplace) divides it out on a collection of numbers number c is the content (i.e. the GCD of all the coeffs, which we divide out inplace) NOTE: it assumes all coefficient numbers to be integer!!! NOTE/TODO: see also the description by Hans TODO: rename into n_ClearIntegerContent.

Definition at line 927 of file coeffs.h.

928 { STATISTIC(n_ClearContent); assume(r != NULL); r->cfClearContent(numberCollectionEnumerator, c, r); }
#define STATISTIC(f)
Definition: numstats.h:16
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 ...
Definition: coeffs.h:927
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_ClearContent ( ICoeffsEnumerator numberCollectionEnumerator,
const coeffs  r 
)
static

Definition at line 943 of file coeffs.h.

944 { STATISTIC(n_ClearContent); number c; n_ClearContent(numberCollectionEnumerator, c, r); n_Delete(&c, r); }
#define STATISTIC(f)
Definition: numstats.h:16
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 ...
Definition: coeffs.h:927
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
static FORCE_INLINE void n_ClearDenominators ( ICoeffsEnumerator numberCollectionEnumerator,
number &  d,
const coeffs  r 
)
static

(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient denominators (i.e. the number with which all the number coeffs. were multiplied) NOTE/TODO: see also the description by Hans

Definition at line 934 of file coeffs.h.

935 { STATISTIC(n_ClearDenominators); assume(r != NULL); r->cfClearDenominators(numberCollectionEnumerator, d, r); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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...
Definition: coeffs.h:934
static FORCE_INLINE void n_ClearDenominators ( ICoeffsEnumerator numberCollectionEnumerator,
const coeffs  r 
)
static

Definition at line 946 of file coeffs.h.

947 { STATISTIC(n_ClearDenominators); assume(r != NULL); number d; n_ClearDenominators(numberCollectionEnumerator, d, r); n_Delete(&d, r); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
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...
Definition: coeffs.h:934
static FORCE_INLINE coeffs n_CoeffRingQuot1 ( number  c,
const coeffs  r 
)
static

Definition at line 532 of file coeffs.h.

533 { STATISTIC(n_CoeffRingQuot1); assume(r != NULL); assume(r->cfQuot1 != NULL); return r->cfQuot1(c, r); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE coeffs n_CoeffRingQuot1(number c, const coeffs r)
Definition: coeffs.h:532
static FORCE_INLINE void n_CoeffWrite ( const coeffs  r,
BOOLEAN  details = TRUE 
)
static

output the coeff description

Definition at line 735 of file coeffs.h.

736 { STATISTIC(n_CoeffWrite); assume(r != NULL); assume(r->cfCoeffWrite != NULL); r->cfCoeffWrite(r, details); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
Definition: coeffs.h:735
#define NULL
Definition: omList.c:10
number n_convFactoryNSingN ( const CanonicalForm  n,
const coeffs  r 
)

Definition at line 549 of file numbers.cc.

551 { STATISTIC(n_convFactoryNSingN); assume(r != NULL); assume(r->convFactoryNSingN != NULL); return r->convFactoryNSingN(n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
Definition: numbers.cc:549
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
CanonicalForm n_convSingNFactoryN ( number  n,
BOOLEAN  setChar,
const coeffs  r 
)

Definition at line 554 of file numbers.cc.

556 { STATISTIC(n_convSingNFactoryN); assume(r != NULL); assume(r->convSingNFactoryN != NULL); return r->convSingNFactoryN(n, setChar, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
Definition: numbers.cc:554
static FORCE_INLINE number n_Copy ( number  n,
const coeffs  r 
)
static

return a copy of 'n'

Definition at line 451 of file coeffs.h.

452 { STATISTIC(n_Copy); assume(r != NULL); assume(r->cfCopy!=NULL); return r->cfCopy(n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:451
static FORCE_INLINE BOOLEAN n_DBTest ( number  n,
const char *  filename,
const int  linenumber,
const coeffs  r 
)
static

test whether n is a correct number; only used if LDEBUG is defined

Definition at line 724 of file coeffs.h.

725 { STATISTIC(n_Test); assume(r != NULL); assume(r->cfDBTest != NULL); return r->cfDBTest(n, filename, linenumber, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:918
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete ( number *  p,
const coeffs  r 
)
static

delete 'p'

Definition at line 455 of file coeffs.h.

456 { STATISTIC(n_Delete); assume(r != NULL); assume(r->cfDelete!= NULL); r->cfDelete(p, r); }
#define STATISTIC(f)
Definition: numstats.h:16
return P p
Definition: myNF.cc:203
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
static FORCE_INLINE number n_Div ( number  a,
number  b,
const coeffs  r 
)
static

return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exception in Z: raises an error if 'a' is not divisible by 'b'

Definition at line 613 of file coeffs.h.

614 { STATISTIC(n_Div); assume(r != NULL); assume(r->cfDiv!=NULL); return r->cfDiv(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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:613
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE BOOLEAN n_DivBy ( number  a,
number  b,
const coeffs  r 
)
static

test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z: TRUE iff 'b' divides 'a' (with remainder = zero) in Z/nZ: TRUE iff (a = 0 and b divides n in Z) or (a != 0 and b/gcd(a, b) is co-prime with n, i.e. a unit in Z/nZ) in Z/2^kZ: TRUE iff ((a = 0 mod 2^k) and (b = 0 or b is a power of 2)) or ((a, b <> 0) and (b/gcd(a, b) is odd))

Definition at line 769 of file coeffs.h.

770 { STATISTIC(n_DivBy); assume(r != NULL);
771 #ifdef HAVE_RINGS
772  if( nCoeff_is_Ring(r) )
773  {
774  assume(r->cfDivBy!=NULL); return r->cfDivBy(a,b,r);
775  }
776 #endif
777  return !n_IsZero(b, r);
778 }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:751
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
Definition: coeffs.h:769
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:464
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE int n_DivComp ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 515 of file coeffs.h.

516 { STATISTIC(n_DivComp); assume(r != NULL); assume(r->cfDivComp!=NULL); return r->cfDivComp (a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
Definition: coeffs.h:515
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE BOOLEAN n_Equal ( number  a,
number  b,
const coeffs  r 
)
static

TRUE iff 'a' and 'b' represent the same number; they may have different representations.

Definition at line 460 of file coeffs.h.

461 { STATISTIC(n_Equal); assume(r != NULL); assume(r->cfEqual!=NULL); return r->cfEqual(a, b, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition: coeffs.h:460
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_EucNorm ( number  a,
const coeffs  r 
)
static

Definition at line 694 of file coeffs.h.

695 { STATISTIC(n_EucNorm); assume(r != NULL); assume(r->cfEucNorm!=NULL); return r->cfEucNorm (a,r); }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE number n_EucNorm(number a, const coeffs r)
Definition: coeffs.h:694
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_ExactDiv ( number  a,
number  b,
const coeffs  r 
)
static

assume that there is a canonical subring in cf and we know that division is possible for these a and b in the subring, n_ExactDiv performs it, may skip additional tests. Can always be substituted by n_Div at the cost of larger computing time.

Definition at line 620 of file coeffs.h.

621 { STATISTIC(n_ExactDiv); assume(r != NULL); assume(r->cfExactDiv!=NULL); return r->cfExactDiv(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
Definition: coeffs.h:620
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_ExtGcd ( number  a,
number  b,
number *  s,
number *  t,
const coeffs  r 
)
static

beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpected in some cases...

Definition at line 690 of file coeffs.h.

691 { STATISTIC(n_ExtGcd); assume(r != NULL); assume(r->cfExtGcd!=NULL); return r->cfExtGcd (a,b,s,t,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
beware that ExtGCD is only relevant for a few chosen coeff. domains and may perform something unexpec...
Definition: coeffs.h:690
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_Farey ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 783 of file coeffs.h.

784 { STATISTIC(n_Farey); assume(r != NULL); assume(r->cfFarey != NULL); return r->cfFarey(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
Definition: coeffs.h:783
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_Gcd ( number  a,
number  b,
const coeffs  r 
)
static

in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ, C, R: not implemented in Q: return the gcd of the numerators of 'a' and 'b' in K(a)/<p(a)>: not implemented in K(t_1, ..., t_n): not implemented

Definition at line 683 of file coeffs.h.

684 { STATISTIC(n_Gcd); assume(r != NULL); assume(r->cfGcd!=NULL); return r->cfGcd(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
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:683
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE int n_GetChar ( const coeffs  r)
static

Return the characteristic of the coeff. domain.

Definition at line 444 of file coeffs.h.

445 { STATISTIC(n_GetChar); assume(r != NULL); return r->ch; }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_GetDenom ( number &  n,
const coeffs  r 
)
static

return the denominator of n (if elements of r are by nature not fractional, result is 1)

Definition at line 602 of file coeffs.h.

603 { STATISTIC(n_GetDenom); assume(r != NULL); assume(r->cfGetDenom!=NULL); return r->cfGetDenom(n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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) ...
Definition: coeffs.h:602
static FORCE_INLINE number n_GetNumerator ( number &  n,
const coeffs  r 
)
static

return the numerator of n (if elements of r are by nature not fractional, result is n)

Definition at line 607 of file coeffs.h.

608 { STATISTIC(n_GetNumerator); assume(r != NULL); assume(r->cfGetNumerator!=NULL); return r->cfGetNumerator(n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
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) ...
Definition: coeffs.h:607
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_GetUnit ( number  n,
const coeffs  r 
)
static

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 in Z/2^kZ: largest odd divisor of n (taken in Z) other cases: not implemented

Definition at line 529 of file coeffs.h.

530 { STATISTIC(n_GetUnit); assume(r != NULL); assume(r->cfGetUnit!=NULL); return r->cfGetUnit(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
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:529
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_Greater ( number  a,
number  b,
const coeffs  r 
)
static

ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the long's representing

in C: TRUE iff (Im(a) > Im(b)) in K(a)/<p(a)>: TRUE iff (a != 0 and (b == 0 or deg(a) > deg(b)) in K(t_1, ..., t_n): TRUE only if one or both numerator polynomials are zero or if their degrees are equal. In this case, TRUE if LC(numerator(a)) > LC(numerator(b)) in Z/2^kZ: TRUE if n_DivBy(a, b) in Z/mZ: TRUE iff the internal mpz's fulfill the relation '>' in Z: TRUE iff a > b

!!! Recommendation: remove implementations for unordered fields !!! and raise errors instead, in these cases

Definition at line 511 of file coeffs.h.

512 { STATISTIC(n_Greater); assume(r != NULL); assume(r->cfGreater!=NULL); return r->cfGreater(a,b,r); }
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...
Definition: coeffs.h:511
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE BOOLEAN n_GreaterZero ( number  n,
const coeffs  r 
)
static

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

!!! Recommendation: remove implementations for unordered fields !!! and raise errors instead, in these cases !!! Do not follow this recommendation: while writing polys, !!! between 2 monomials will be an additional + iff !n_GreaterZero(next coeff) Then change definition to include n_GreaterZero => printing does NOT start with -

Definition at line 494 of file coeffs.h.

495 { STATISTIC(n_GreaterZero); assume(r != NULL); assume(r->cfGreaterZero!=NULL); return r->cfGreaterZero(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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)/: 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
Definition: coeffs.h:494
static FORCE_INLINE number n_ImPart ( number  i,
const coeffs  cf 
)
static

Definition at line 809 of file coeffs.h.

810 { STATISTIC(n_ImPart); assume(cf != NULL); assume(cf->cfImPart!=NULL); return cf->cfImPart(i,cf); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
Definition: coeffs.h:809
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Init ( long  i,
const coeffs  r 
)
static

a number representing i in the given coeff field/ring r

Definition at line 537 of file coeffs.h.

538 { STATISTIC(n_Init); assume(r != NULL); assume(r->cfInit!=NULL); return r->cfInit(i,r); }
#define STATISTIC(f)
Definition: numstats.h:16
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:537
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_InitMPZ ( mpz_t  n,
const coeffs  r 
)
static

conversion of a GMP integer to number

Definition at line 541 of file coeffs.h.

542 { STATISTIC(n_InitMPZ); assume(r != NULL); assume(r->cfInitMPZ != NULL); return r->cfInitMPZ(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
Definition: coeffs.h:541
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_InpAdd ( number &  a,
number  b,
const coeffs  r 
)
static

addition of 'a' and 'b'; replacement of 'a' by the sum a+b

Definition at line 643 of file coeffs.h.

644 { STATISTIC(n_InpAdd); assume(r != NULL); assume(r->cfInpAdd!=NULL); r->cfInpAdd(a,b,r);
645 
646 #ifdef HAVE_NUMSTATS
647  // avoid double counting
648  if( r->cfIsZero(a,r) ) STATISTIC(n_CancelOut);
649 #endif
650 }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE void n_InpAdd(number &a, number b, const coeffs r)
addition of 'a' and 'b'; replacement of 'a' by the sum a+b
Definition: coeffs.h:643
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE void n_InpMult ( number &  a,
number  b,
const coeffs  r 
)
static

multiplication of 'a' and 'b'; replacement of 'a' by the product a*b

Definition at line 638 of file coeffs.h.

639 { STATISTIC(n_InpMult); assume(r != NULL); assume(r->cfInpMult!=NULL); r->cfInpMult(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
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:638
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_InpNeg ( number  n,
const coeffs  r 
)
static

in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)

Definition at line 556 of file coeffs.h.

557 { STATISTIC(n_InpNeg); assume(r != NULL); assume(r->cfInpNeg!=NULL); return r->cfInpNeg(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
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)
Definition: coeffs.h:556
#define NULL
Definition: omList.c:10
static FORCE_INLINE long n_Int ( number &  n,
const coeffs  r 
)
static

conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 .. p/2]

Definition at line 546 of file coeffs.h.

547 { STATISTIC(n_Int); assume(r != NULL); assume(r->cfInt!=NULL); return r->cfInt(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
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 ...
Definition: coeffs.h:546
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_IntMod ( number  a,
number  b,
const coeffs  r 
)
static

for r a field, return n_Init(0,r) otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a

Definition at line 625 of file coeffs.h.

626 { STATISTIC(n_IntMod); assume(r != NULL); return r->cfIntMod(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a
Definition: coeffs.h:625
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_Invers ( number  a,
const coeffs  r 
)
static

return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible

!!! Recommendation: rename to 'n_Inverse'

Definition at line 563 of file coeffs.h.

564 { STATISTIC(n_Invers); assume(r != NULL); assume(r->cfInvers!=NULL); return r->cfInvers(a,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
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:563
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_IsMOne ( number  n,
const coeffs  r 
)
static

TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.

Definition at line 472 of file coeffs.h.

473 { STATISTIC(n_IsMOne); assume(r != NULL); assume(r->cfIsMOne!=NULL); return r->cfIsMOne(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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.
Definition: coeffs.h:472
static FORCE_INLINE BOOLEAN n_IsOne ( number  n,
const coeffs  r 
)
static

TRUE iff 'n' represents the one element.

Definition at line 468 of file coeffs.h.

469 { STATISTIC(n_IsOne); assume(r != NULL); assume(r->cfIsOne!=NULL); return r->cfIsOne(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_IsUnit ( number  n,
const coeffs  r 
)
static

TRUE iff n has a multiplicative inverse in the given coeff field/ring r.

Definition at line 519 of file coeffs.h.

520 { STATISTIC(n_IsUnit); assume(r != NULL); assume(r->cfIsUnit!=NULL); return r->cfIsUnit(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
Definition: coeffs.h:519
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN n_IsZero ( number  n,
const coeffs  r 
)
static

TRUE iff 'n' represents the zero element.

Definition at line 464 of file coeffs.h.

465 { STATISTIC(n_IsZero); assume(r != NULL); assume(r->cfIsZero!=NULL); return r->cfIsZero(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:464
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Lcm ( number  a,
number  b,
const coeffs  r 
)
static

in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ, C, R: not implemented in K(a)/<p(a)>: not implemented in K(t_1, ..., t_n): not implemented

Definition at line 709 of file coeffs.h.

710 { STATISTIC(n_Lcm); assume(r != NULL); assume(r->cfLcm!=NULL); return r->cfLcm(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
Definition: coeffs.h:709
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE void n_MPZ ( mpz_t  result,
number &  n,
const coeffs  r 
)
static

conversion of n to a GMP integer; 0 if not possible

Definition at line 550 of file coeffs.h.

551 { STATISTIC(n_MPZ); assume(r != NULL); assume(r->cfMPZ!=NULL); r->cfMPZ(result, n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
Definition: coeffs.h:550
return result
Definition: facAbsBiFact.cc:76
static FORCE_INLINE number n_Mult ( number  a,
number  b,
const coeffs  r 
)
static

return the product of 'a' and 'b', i.e., a*b

Definition at line 633 of file coeffs.h.

634 { STATISTIC(n_Mult); assume(r != NULL); assume(r->cfMult!=NULL); return r->cfMult(a, b, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
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:633
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE void n_Normalize ( number &  n,
const coeffs  r 
)
static

inplace-normalization of n; produces some canonical representation of n;

!!! Recommendation: remove this method from the user-interface, i.e., !!! this should be hidden

Definition at line 577 of file coeffs.h.

578 { STATISTIC(n_Normalize); assume(r != NULL); assume(r->cfNormalize!=NULL); r->cfNormalize(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:577
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_NormalizeHelper ( number  a,
number  b,
const coeffs  r 
)
static

assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1,b2)/1)

Definition at line 714 of file coeffs.h.

715 { STATISTIC(n_NormalizeHelper); assume(r != NULL); assume(r->cfNormalizeHelper!=NULL); return r->cfNormalizeHelper(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
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...
Definition: coeffs.h:714
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE int n_NumberOfParameters ( const coeffs  r)
static

Returns the number of parameters.

Definition at line 790 of file coeffs.h.

791 { STATISTIC(n_NumberOfParameters); assume(r != NULL); return r->iNumberOfParameters; }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:790
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Param ( const int  iParameter,
const coeffs  r 
)
static

return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1..n_NumberOfParameters(...)

Definition at line 799 of file coeffs.h.

800 { assume(r != NULL);
801  assume((iParameter >= 1) || (iParameter <= n_NumberOfParameters(r)));
802  assume(r->cfParameter != NULL);
803  STATISTIC(n_Param); return r->cfParameter(iParameter, r);
804 }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:790
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1..n_NumberOfParameters(...)
Definition: coeffs.h:799
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE char const* * n_ParameterNames ( const coeffs  r)
static

Returns a (const!) pointer to (const char*) names of parameters.

Definition at line 794 of file coeffs.h.

795 { STATISTIC(n_ParameterNames); assume(r != NULL); return r->pParameterNames; }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:794
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE int n_ParDeg ( number  n,
const coeffs  r 
)
static

Definition at line 786 of file coeffs.h.

787 { STATISTIC(n_ParDeg); assume(r != NULL); assume(r->cfParDeg != NULL); return r->cfParDeg(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
Definition: coeffs.h:786
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Power ( number  a,
int  b,
number *  res,
const coeffs  r 
)
static

fill res with the power a^b

Definition at line 629 of file coeffs.h.

630 { STATISTIC(n_Power); assume(r != NULL); assume(r->cfPower!=NULL); r->cfPower(a,b,res,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
poly res
Definition: myNF.cc:322
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition: coeffs.h:629
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
void n_Print ( number &  a,
const coeffs  r 
)

print a number (BEWARE of string buffers!) mostly for debugging

Definition at line 538 of file numbers.cc.

540 {
541  assume(r != NULL);
542  n_Test(a,r);
543 
544  StringSetS("");
545  n_Write(a, r);
546  { char* s = StringEndS(); Print("%s", s); omFree(s); }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
#define Print
Definition: emacs.cc:83
char * StringEndS()
Definition: reporter.cc:151
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:405
void StringSetS(const char *st)
Definition: reporter.cc:128
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:590
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:918
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_QuotRem ( number  a,
number  b,
number *  q,
const coeffs  r 
)
static

Definition at line 700 of file coeffs.h.

701 { STATISTIC(n_QuotRem); assume(r != NULL); assume(r->cfQuotRem!=NULL); return r->cfQuotRem (a,b,q,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
Definition: coeffs.h:700
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_Random ( siRandProc  p,
number  p1,
number  p2,
const coeffs  cf 
)
static

Definition at line 965 of file coeffs.h.

966 { STATISTIC(n_Random); assume( cf != NULL ); assume( cf->cfRandom != NULL ); return cf->cfRandom(p, p1, p2, cf); }
#define STATISTIC(f)
Definition: numstats.h:16
return P p
Definition: myNF.cc:203
static FORCE_INLINE number n_Random(siRandProc p, number p1, number p2, const coeffs cf)
Definition: coeffs.h:965
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
static FORCE_INLINE const char* n_Read ( const char *  s,
number *  a,
const coeffs  r 
)
static

!!! Recommendation: This method is too cryptic to be part of the user- !!! interface. As defined here, it is merely a helper !!! method for parsing number input strings.

Definition at line 597 of file coeffs.h.

598 { STATISTIC(n_Read); assume(r != NULL); assume(r->cfRead!=NULL); return r->cfRead(s, a, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface. As defined here, it is merely a helper !!! method for parsing number input strings.
Definition: coeffs.h:597
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_ReadFd ( s_buff  f,
const coeffs  r 
)
static

io via ssi:

Definition at line 973 of file coeffs.h.

974 { STATISTIC(n_ReadFd); assume(r != NULL); assume(r->cfReadFd != NULL); return r->cfReadFd(f, r); }
#define STATISTIC(f)
Definition: numstats.h:16
f
Definition: cfModGcd.cc:4022
static FORCE_INLINE number n_ReadFd(s_buff f, const coeffs r)
io via ssi:
Definition: coeffs.h:973
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_RePart ( number  i,
const coeffs  cf 
)
static

Definition at line 806 of file coeffs.h.

807 { STATISTIC(n_RePart); assume(cf != NULL); assume(cf->cfRePart!=NULL); return cf->cfRePart(i,cf); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
Definition: coeffs.h:806
static FORCE_INLINE nMapFunc n_SetMap ( const coeffs  src,
const coeffs  dst 
)
static

set the mapping function pointers for translating numbers from src to dst

Definition at line 718 of file coeffs.h.

719 { STATISTIC(n_SetMap); assume(src != NULL && dst != NULL); assume(dst->cfSetMap!=NULL); return dst->cfSetMap(src,dst); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:718
#define NULL
Definition: omList.c:10
static FORCE_INLINE int n_Size ( number  n,
const coeffs  r 
)
static

return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used for pivot strategies in matrix computations with entries from r)

Definition at line 569 of file coeffs.h.

570 { STATISTIC(n_Size); assume(r != NULL); assume(r->cfSize!=NULL); return r->cfSize(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition: coeffs.h:569
static FORCE_INLINE number n_Sub ( number  a,
number  b,
const coeffs  r 
)
static

return the difference of 'a' and 'b', i.e., a-b

Definition at line 666 of file coeffs.h.

667 { STATISTIC(n_Sub); assume(r != NULL); assume(r->cfSub!=NULL); const number d = r->cfSub(a, b, r);
668 
669 #ifdef HAVE_NUMSTATS
670  // avoid double counting
671  if( r->cfIsZero(d,r) ) STATISTIC(n_CancelOut);
672 #endif
673 
674  return d;
675 }
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:666
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE number n_SubringGcd ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 685 of file coeffs.h.

686 { STATISTIC(n_SubringGcd); assume(r != NULL); assume(r->cfSubringGcd!=NULL); return r->cfSubringGcd(a,b,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:685
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE void n_Write ( number &  n,
const coeffs  r,
const BOOLEAN  bShortOut = TRUE 
)
static

Definition at line 590 of file coeffs.h.

591 { STATISTIC(n_Write); if (bShortOut) n_WriteShort(n, r); else n_WriteLong(n, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:590
static FORCE_INLINE void n_WriteShort(number &n, const coeffs r)
write to the output buffer of the currently used reporter in a shortest possible way, e.g. in K(a): a2 instead of a^2
Definition: coeffs.h:587
static FORCE_INLINE void n_WriteLong(number &n, const coeffs r)
write to the output buffer of the currently used reporter
Definition: coeffs.h:582
static FORCE_INLINE void n_WriteFd ( number  a,
FILE *  f,
const coeffs  r 
)
static

io via ssi:

Definition at line 969 of file coeffs.h.

970 { STATISTIC(n_WriteFd); assume(r != NULL); assume(r->cfWriteFd != NULL); return r->cfWriteFd(a, f, r); }
#define STATISTIC(f)
Definition: numstats.h:16
const poly a
Definition: syzextra.cc:212
f
Definition: cfModGcd.cc:4022
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE void n_WriteFd(number a, FILE *f, const coeffs r)
io via ssi:
Definition: coeffs.h:969
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_WriteLong ( number &  n,
const coeffs  r 
)
static

write to the output buffer of the currently used reporter

Definition at line 582 of file coeffs.h.

583 { STATISTIC(n_WriteLong); assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_WriteLong(number &n, const coeffs r)
write to the output buffer of the currently used reporter
Definition: coeffs.h:582
static FORCE_INLINE void n_WriteShort ( number &  n,
const coeffs  r 
)
static

write to the output buffer of the currently used reporter in a shortest possible way, e.g. in K(a): a2 instead of a^2

Definition at line 587 of file coeffs.h.

588 { STATISTIC(n_WriteShort); assume(r != NULL); assume(r->cfWriteShort!=NULL); r->cfWriteShort(n,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_WriteShort(number &n, const coeffs r)
write to the output buffer of the currently used reporter in a shortest possible way, e.g. in K(a): a2 instead of a^2
Definition: coeffs.h:587
static FORCE_INLINE number n_XExtGcd ( number  a,
number  b,
number *  s,
number *  t,
number *  u,
number *  v,
const coeffs  r 
)
static

Definition at line 692 of file coeffs.h.

693 { STATISTIC(n_XExtGcd); assume(r != NULL); assume(r->cfXExtGcd!=NULL); return r->cfXExtGcd (a,b,s,t,u,v,r); }
#define STATISTIC(f)
Definition: numstats.h:16
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
static FORCE_INLINE number n_XExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
Definition: coeffs.h:692
#define assume(x)
Definition: mod2.h:405
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc ( const coeffs  r)
static

TRUE if n_Delete/n_New are empty operations.

Definition at line 902 of file coeffs.h.

903 { assume(r != NULL); return r->has_simple_Alloc; }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_has_simple_inverse ( const coeffs  r)
static

TRUE, if the computation of the inverse is fast, i.e. prefer leading coeff. 1 over content.

Definition at line 898 of file coeffs.h.

899 { assume(r != NULL); return r->has_simple_Inverse; }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_has_Units ( const coeffs  r)
static

returns TRUE, if r is not a field and r has non-trivial units

Definition at line 813 of file coeffs.h.

814 { assume(r != NULL); return ((getCoeffType(r)==n_Zn) || (getCoeffType(r)==n_Z2m) || (getCoeffType(r)==n_Znm)); }
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:42
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:44
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:43
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_algExt ( const coeffs  r)
static

TRUE iff r represents an algebraic extension field.

Definition at line 906 of file coeffs.h.

907 { assume(r != NULL); return (getCoeffType(r)==n_algExt); }
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:34
static FORCE_INLINE BOOLEAN nCoeff_is_CF ( const coeffs  r)
static

Definition at line 893 of file coeffs.h.

894 { assume(r != NULL); return getCoeffType(r)==n_CF; }
?
Definition: coeffs.h:45
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Domain ( const coeffs  r)
static

returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)

Definition at line 755 of file coeffs.h.

756 {
757  assume(r != NULL);
758  return (r->is_domain);
759 }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Extension ( const coeffs  r)
static

Definition at line 839 of file coeffs.h.

840 {
841  assume(r != NULL);
842  return (getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt);
843 }
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:37
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:34
static FORCE_INLINE BOOLEAN nCoeff_is_GF ( const coeffs  r)
static

Definition at line 832 of file coeffs.h.

833 { assume(r != NULL); return getCoeffType(r)==n_GF; }
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
{p^n < 2^16}
Definition: coeffs.h:32
static FORCE_INLINE BOOLEAN nCoeff_is_GF ( const coeffs  r,
int  q 
)
static

Definition at line 835 of file coeffs.h.

836 { assume(r != NULL); return (getCoeffType(r)==n_GF) && (r->ch == q); }
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
{p^n < 2^16}
Definition: coeffs.h:32
static FORCE_INLINE BOOLEAN nCoeff_is_long_C ( const coeffs  r)
static

Definition at line 890 of file coeffs.h.

891 { assume(r != NULL); return getCoeffType(r)==n_long_C; }
#define assume(x)
Definition: mod2.h:405
complex floating point (GMP) numbers
Definition: coeffs.h:40
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_long_R ( const coeffs  r)
static

Definition at line 887 of file coeffs.h.

888 { assume(r != NULL); return getCoeffType(r)==n_long_R; }
real floating point (GMP) numbers
Definition: coeffs.h:33
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_numeric ( const coeffs  r)
static

Definition at line 825 of file coeffs.h.

826 { assume(r != NULL); return (getCoeffType(r)==n_R) || (getCoeffType(r)==n_long_R) || (getCoeffType(r)==n_long_C); }
real floating point (GMP) numbers
Definition: coeffs.h:33
single prescision (6,6) real numbers
Definition: coeffs.h:31
#define assume(x)
Definition: mod2.h:405
complex floating point (GMP) numbers
Definition: coeffs.h:40
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Q ( const coeffs  r)
static

Definition at line 822 of file coeffs.h.

823 { assume(r != NULL); return getCoeffType(r)==n_Q && (r->is_field); }
rational (GMP) numbers
Definition: coeffs.h:30
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a ( const coeffs  r)
static

Definition at line 878 of file coeffs.h.

879 {
880  assume(r != NULL);
881  return ((n_GetChar(r) == 0) && nCoeff_is_Extension(r));
882 }
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:839
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algext ( const coeffs  r)
static

is it an alg. ext. of Q?

Definition at line 910 of file coeffs.h.

911 { assume(r != NULL); return ((n_GetChar(r) == 0) && nCoeff_is_algExt(r)); }
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:906
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_R ( const coeffs  r)
static

Definition at line 829 of file coeffs.h.

830 { assume(r != NULL); return getCoeffType(r)==n_R; }
single prescision (6,6) real numbers
Definition: coeffs.h:31
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Ring ( const coeffs  r)
static

Definition at line 751 of file coeffs.h.

752 { assume(r != NULL); return (r->is_field==0); }
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM ( const coeffs  r)
static

Definition at line 739 of file coeffs.h.

740 { assume(r != NULL); return (getCoeffType(r)==n_Z2m); }
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:44
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_ModN ( const coeffs  r)
static

Definition at line 742 of file coeffs.h.

743 { assume(r != NULL); return (getCoeffType(r)==n_Zn); }
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:42
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM ( const coeffs  r)
static

Definition at line 745 of file coeffs.h.

746 { assume(r != NULL); return (getCoeffType(r)==n_Znm); }
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:43
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z ( const coeffs  r)
static

Definition at line 748 of file coeffs.h.

749 { assume(r != NULL); return (getCoeffType(r)==n_Z); }
#define assume(x)
Definition: mod2.h:405
only used if HAVE_RINGS is defined: ?
Definition: coeffs.h:41
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_transExt ( const coeffs  r)
static

TRUE iff r represents a transcendental extension field.

Definition at line 914 of file coeffs.h.

915 { assume(r != NULL); return (getCoeffType(r)==n_transExt); }
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:37
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Zp ( const coeffs  r)
static

Definition at line 816 of file coeffs.h.

817 { assume(r != NULL); return getCoeffType(r)==n_Zp; }
{p < 2^31}
Definition: coeffs.h:29
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Zp ( const coeffs  r,
int  p 
)
static

Definition at line 819 of file coeffs.h.

820 { assume(r != NULL); return ((getCoeffType(r)==n_Zp) && (r->ch == p)); }
return P p
Definition: myNF.cc:203
{p < 2^31}
Definition: coeffs.h:29
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a ( const coeffs  r)
static

Definition at line 852 of file coeffs.h.

853 {
854  assume(r != NULL);
855  return ((!nCoeff_is_Ring(r)) && (n_GetChar(r) != 0) && nCoeff_is_Extension(r));
856 }
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:751
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:839
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a ( const coeffs  r,
int  p 
)
static

Definition at line 865 of file coeffs.h.

866 {
867  assume(r != NULL);
868  assume(p != 0);
869  return ((!nCoeff_is_Ring(r)) && (n_GetChar(r) == p) && nCoeff_is_Extension(r));
870 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:751
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:839
static FORCE_INLINE char* nCoeffName ( const coeffs  cf)
static

Definition at line 962 of file coeffs.h.

963 { STATISTIC(nCoeffName); assume( cf != NULL ); return cf->cfCoeffName(cf); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:962
#define NULL
Definition: omList.c:10
static FORCE_INLINE char* nCoeffString ( const coeffs  cf)
static

TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.

Definition at line 958 of file coeffs.h.

959 { STATISTIC(nCoeffString); assume( cf != NULL ); return cf->cfCoeffString(cf); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
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
static FORCE_INLINE coeffs nCopyCoeff ( const coeffs  r)
static

"copy" coeffs, i.e. increment ref

Definition at line 429 of file coeffs.h.

430 { assume(r!=NULL); r->ref++; return r;}
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
coeffs nInitChar ( n_coeffType  t,
void *  parameter 
)

one-time initialisations for new coeffs in case of an error return NULL

Definition at line 316 of file numbers.cc.

318 {
320 
321  while((n!=NULL) && (n->nCoeffIsEqual!=NULL) && (!n->nCoeffIsEqual(n,t,parameter)))
322  n=n->next;
323 
324  if (n==NULL)
325  {
326  n=(n_Procs_s*)omAlloc0(sizeof(n_Procs_s));
327  n->next=cf_root;
328  n->ref=1;
329  n->type=t;
330 
331  // default entries (different from NULL) for some routines:
333  n->cfSize = ndSize;
336  n->cfImPart=ndReturn0;
337  n->cfDelete= ndDelete;
338  n->cfAnn = ndAnn;
339  n->cfCoeffString = ndCoeffString; // should alway be changed!
340  n->cfInpMult=ndInpMult;
341  n->cfInpAdd=ndInpAdd;
342  n->cfCopy = ndCopy;
343  n->cfIntMod=ndIntMod; /* dummy !! */
345  n->cfGcd = ndGcd;
346  n->cfNormalizeHelper = ndGcd; /* tricky, isn't it ?*/
347  n->cfLcm = ndGcd; /* tricky, isn't it ?*/
348  n->cfInitMPZ = ndInitMPZ;
349  n->cfMPZ = ndMPZ;
350  n->cfPower = ndPower;
352 
353  n->cfKillChar = ndKillChar; /* dummy */
354  n->cfSetChar = ndSetChar; /* dummy */
355  // temp. removed to catch all the coeffs which miss to implement this!
356 
358  n->cfFarey = ndFarey;
359  n->cfParDeg = ndParDeg;
360 
362 
365 
366 #ifdef HAVE_RINGS
367  n->cfDivComp = ndDivComp;
368  n->cfDivBy = ndDivBy;
369  n->cfIsUnit = ndIsUnit;
370  n->cfExtGcd = ndExtGcd;
371  //n->cfGetUnit = (nMapFunc)NULL;
372 #endif
373 
374 #ifdef LDEBUG
375  n->cfDBTest=ndDBTest;
376 #endif
377 
380 
381  BOOLEAN nOK=TRUE;
382  // init
383  if ((t<=nLastCoeffs) && (nInitCharTable[t]!=NULL))
384  nOK = (nInitCharTable[t])(n,parameter);
385  else
386  Werror("Sorry: the coeff type [%d] was not registered: it is missing in nInitCharTable", (int)t);
387  if (nOK)
388  {
389  omFreeSize(n,sizeof(*n));
390  return NULL;
391  }
392  cf_root=n;
393  // post init settings:
394  if (n->cfRePart==NULL) n->cfRePart=n->cfCopy;
395  if (n->cfExactDiv==NULL) n->cfExactDiv=n->cfDiv;
396  if (n->cfSubringGcd==NULL) n->cfSubringGcd=n->cfGcd;
397 
398 #ifdef HAVE_RINGS
399  if (n->cfGetUnit==NULL) n->cfGetUnit=n->cfCopy;
400 #endif
401 
402  if(n->cfWriteShort==NULL)
403  n->cfWriteShort = n->cfWriteLong;
404 
406  assume(n->cfSetChar!=NULL);
408  assume(n->cfMult!=NULL);
409  assume(n->cfSub!=NULL);
410  assume(n->cfAdd!=NULL);
411  assume(n->cfDiv!=NULL);
412  assume(n->cfIntMod!=NULL);
413  assume(n->cfExactDiv!=NULL);
414  assume(n->cfInit!=NULL);
415  assume(n->cfInitMPZ!=NULL);
416  assume(n->cfSize!=NULL);
417  assume(n->cfInt!=NULL);
418  assume(n->cfMPZ!=NULL);
419  //assume(n->n->cfDivComp!=NULL);
420  //assume(n->cfIsUnit!=NULL);
421  //assume(n->cfGetUnit!=NULL);
422  //assume(n->cfExtGcd!=NULL);
423  assume(n->cfInpNeg!=NULL);
424  assume(n->cfCopy!=NULL);
425 
426  assume(n->cfWriteLong!=NULL);
427  assume(n->cfWriteShort!=NULL);
428 
429  assume(n->iNumberOfParameters>= 0);
430 
431  assume( (n->iNumberOfParameters == 0 && n->pParameterNames == NULL) ||
432  (n->iNumberOfParameters > 0 && n->pParameterNames != NULL) );
433 
434  assume(n->cfParameter!=NULL);
435  assume(n->cfParDeg!=NULL);
436 
437  assume(n->cfRead!=NULL);
438  assume(n->cfNormalize!=NULL);
439  assume(n->cfGreater!=NULL);
440  //assume(n->cfDivBy!=NULL);
441  assume(n->cfEqual!=NULL);
442  assume(n->cfIsZero!=NULL);
443  assume(n->cfIsOne!=NULL);
444  assume(n->cfIsMOne!=NULL);
446  assume(n->cfGetDenom!=NULL);
448  assume(n->cfGcd!=NULL);
450  assume(n->cfDelete!=NULL);
451  assume(n->cfSetMap!=NULL);
452  assume(n->cfInpMult!=NULL);
453 // assume(n->cfInit_bigint!=NULL);
454  assume(n->cfCoeffWrite != NULL);
455 
456  assume(n->cfClearContent != NULL);
458 
459  assume(n->type==t);
460 
461 #ifndef SING_NDEBUG
462  if(n->cfKillChar==NULL) Warn("cfKillChar is NULL for coeff %d",t);
463  if(n->cfWriteLong==NULL) Warn("cfWrite is NULL for coeff %d",t);
464  if(n->cfWriteShort==NULL) Warn("cfWriteShort is NULL for coeff %d",t);
465  if(n->cfCoeffString==ndCoeffString) Warn("cfCoeffString is undefined for coeff %d",t);
466 #endif
467 
468  if( n->nNULL == NULL )
469  n->nNULL = n->cfInit(0, n); // may still remain NULL
470  }
471  else
472  {
473  n->ref++;
474  }
475  return n;
static BOOLEAN ndIsUnit(number a, const coeffs r)
Definition: numbers.cc:245
BOOLEAN(* cfDivBy)(number a, number b, const coeffs r)
Definition: coeffs.h:381
static number ndChineseRemainder(number *, number *, int, BOOLEAN, const coeffs r)
Definition: numbers.cc:103
number(* cfCopy)(number a, const coeffs r)
return a copy of a
Definition: coeffs.h:197
number(* cfExtGcd)(number a, number b, number *s, number *t, const coeffs r)
Definition: coeffs.h:244
numberfunc cfIntMod
Definition: coeffs.h:173
int(* cfDivComp)(number a, number b, const coeffs r)
Definition: coeffs.h:377
static void ndPower(number a, int i, number *res, const coeffs r)
Definition: numbers.cc:72
static number ndParameter(const int, const coeffs r)
Definition: numbers.cc:114
number nNULL
the 0 as constant, NULL by default
Definition: coeffs.h:316
static void ndKillChar(coeffs)
Definition: numbers.cc:237
static BOOLEAN ndDBTest(number, const char *, const int, const coeffs)
Definition: numbers.cc:95
BOOLEAN(* cfDBTest)(number a, const char *f, const int l, const coeffs r)
Test: is "a" a correct number?
Definition: coeffs.h:415
void(* cfMPZ)(mpz_t result, number &n, const coeffs r)
Converts a non-negative number n into a GMP number, 0 if impossible.
Definition: coeffs.h:188
void(* cfSetChar)(const coeffs r)
Definition: coeffs.h:159
number(* cfChineseRemainder)(number *x, number *q, int rl, BOOLEAN sym, const coeffs)
chinese remainder returns X with X mod q[i]=x[i], i=0..rl-1
Definition: coeffs.h:293
static BOOLEAN ndDivBy(number, number, const coeffs)
Definition: numbers.cc:243
char const ** pParameterNames
array containing the names of Parameters (default NULL)
Definition: coeffs.h:322
coeffs next
Definition: coeffs.h:123
static number ndCopy(number a, const coeffs)
Definition: numbers.cc:227
static n_coeffType nLastCoeffs
Definition: numbers.cc:282
void(* cfDelete)(number *a, const coeffs r)
Definition: coeffs.h:268
static void ndNormalize(number &, const coeffs)
Definition: numbers.cc:135
BOOLEAN(*)(*)(*)(*) cfIsOne(number a, const coeffs r)
Definition: coeffs.h:227
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
number(* cfSubringGcd)(number a, number b, const coeffs r)
Definition: coeffs.h:243
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static number ndConvFactoryNSingN(const CanonicalForm, const coeffs)
[in, out] a bigint number >= 0
Definition: numbers.cc:256
numberfunc cfAdd
Definition: coeffs.h:173
BOOLEAN(* cfGreater)(number a, number b, const coeffs r)
Definition: coeffs.h:223
void(* cfNormalize)(number &a, const coeffs r)
Definition: coeffs.h:221
static char * ndCoeffString(const coeffs r)
Definition: numbers.cc:54
number(* cfRePart)(number a, const coeffs r)
Definition: coeffs.h:198
#define TRUE
Definition: auxiliary.h:144
static void ndDelete(number *d, const coeffs)
Definition: numbers.cc:52
static int ndDivComp(number, number, const coeffs)
Definition: numbers.cc:244
void(* cfCoeffWrite)(const coeffs r, BOOLEAN details)
output of coeff description via Print
Definition: coeffs.h:146
void(* cfWriteLong)(number &a, const coeffs r)
print a given number (long format)
Definition: coeffs.h:202
static char * ndCoeffName(const coeffs r)
Definition: numbers.cc:142
BOOLEAN(* cfIsUnit)(number a, const coeffs r)
Definition: coeffs.h:378
number(* cfGetUnit)(number a, const coeffs r)
Definition: coeffs.h:379
number(* cfFarey)(number p, number n, const coeffs)
rational reconstruction: "best" rational a/b with a/b = p mod n
Definition: coeffs.h:287
number(* cfInitMPZ)(mpz_t i, const coeffs r)
init with a GMP integer
Definition: coeffs.h:179
char *(* cfCoeffString)(const coeffs r)
string output of coeff description
Definition: coeffs.h:149
BOOLEAN(* nCoeffIsEqual)(const coeffs r, n_coeffType n, void *parameter)
Definition: coeffs.h:143
static number ndReturn0(number, const coeffs r)
Definition: numbers.cc:136
static void ndInpMult(number &a, number b, const coeffs r)
Definition: numbers.cc:59
number(* cfInit)(long i, const coeffs r)
init with an integer
Definition: coeffs.h:176
number(* cfNormalizeHelper)(number a, number b, const coeffs r)
Definition: coeffs.h:267
static number ndInitMPZ(mpz_t m, const coeffs r)
Definition: numbers.cc:269
static int ndParDeg(number n, const coeffs r)
Definition: numbers.cc:109
BOOLEAN(*)(*)(*)(*)(*)(*) cfGreaterZero(number a, const coeffs r)
Definition: coeffs.h:233
long(* cfInt)(number &n, const coeffs r)
convertion to long, 0 if impossible
Definition: coeffs.h:185
void(* cfInpMult)(number &a, number b, const coeffs r)
Inplace: a *= b.
Definition: coeffs.h:277
numberfunc cfSub
Definition: coeffs.h:173
static void ndClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Definition: numbers.cc:144
static number ndGetDenom(number &, const coeffs r)
Definition: numbers.cc:139
number(* cfImPart)(number a, const coeffs r)
Definition: coeffs.h:199
#define assume(x)
Definition: mod2.h:405
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:193
static int ndSize(number a, const coeffs r)
Definition: numbers.cc:141
int ref
Definition: coeffs.h:124
void(* cfPower)(number a, int i, number *result, const coeffs r)
Definition: coeffs.h:235
nCoeffsEnumeratorFunc cfClearContent
function pointer behind n_ClearContent
Definition: coeffs.h:305
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:206
n_Procs_s * cf_root
Definition: numbers.cc:47
numberfunc cfExactDiv
Definition: coeffs.h:173
static BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void *)
Definition: numbers.cc:275
n_coeffType type
Definition: coeffs.h:126
static CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition: numbers.cc:249
numberfunc cfDiv
Definition: coeffs.h:173
const char *(* cfRead)(const char *s, number *a, const coeffs r)
Definition: coeffs.h:219
numberfunc cfMult
Definition: coeffs.h:173
static number ndGcd(number, number, const coeffs r)
Definition: numbers.cc:137
static number ndExtGcd(number, number, number *, number *, const coeffs r)
Definition: numbers.cc:246
static cfInitCharProc * nInitCharTable
Definition: numbers.cc:312
#define NULL
Definition: omList.c:10
number(* cfGcd)(number a, number b, const coeffs r)
Definition: coeffs.h:242
static void ndSetChar(const coeffs)
Definition: numbers.cc:238
number(* cfLcm)(number a, number b, const coeffs r)
Definition: coeffs.h:266
static void ndInpAdd(number &a, number b, const coeffs r)
Definition: numbers.cc:65
number(* convFactoryNSingN)(const CanonicalForm n, const coeffs r)
conversion to CanonicalForm(factory) to number
Definition: coeffs.h:311
static number ndGetNumerator(number &a, const coeffs r)
Definition: numbers.cc:140
static number ndAnn(number, const coeffs)
Definition: numbers.cc:53
static number ndIntMod(number, number, const coeffs r)
Definition: numbers.cc:138
static number ndFarey(number, number, const coeffs r)
Definition: numbers.cc:98
static void ndClearDenominators(ICoeffsEnumerator &, number &d, const coeffs r)
Definition: numbers.cc:218
nMapFunc(* cfSetMap)(const coeffs src, const coeffs dst)
Definition: coeffs.h:271
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitue cfCoeffWrite, cfCoeffString
Definition: coeffs.h:152
int(* cfSize)(number n, const coeffs r)
how complicated, (0) => 0, or positive
Definition: coeffs.h:182
number(* cfAnn)(number a, const coeffs r)
Definition: coeffs.h:257
number(* cfParameter)(const int i, const coeffs r)
create i^th parameter or NULL if not possible
Definition: coeffs.h:299
BOOLEAN(*)(*)(*)(*)(*) cfIsMOne(number a, const coeffs r)
Definition: coeffs.h:228
CanonicalForm(* convSingNFactoryN)(number n, BOOLEAN setChar, const coeffs r)
Definition: coeffs.h:312
void(* cfKillChar)(coeffs r)
Definition: coeffs.h:157
int BOOLEAN
Definition: auxiliary.h:131
static void ndMPZ(mpz_t result, number &n, const coeffs r)
Converts a non-negative bigint number into a GMP number.
Definition: numbers.cc:264
void Werror(const char *fmt,...)
Definition: reporter.cc:199
void(* cfInpAdd)(number &a, number b, const coeffs r)
Inplace: a += b.
Definition: coeffs.h:280
number(* cfGetNumerator)(number &n, const coeffs r)
Definition: coeffs.h:237
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int iNumberOfParameters
Number of Parameters in the coeffs (default 0)
Definition: coeffs.h:319
number(* cfGetDenom)(number &n, const coeffs r)
Definition: coeffs.h:236
BOOLEAN(*)(*)(*) cfIsZero(number a, const coeffs r)
Definition: coeffs.h:226
BOOLEAN(*)(*) cfEqual(number a, number b, const coeffs r)
tests
Definition: coeffs.h:225
nCoeffsEnumeratorFunc cfClearDenominators
function pointer behind n_ClearDenominators
Definition: coeffs.h:308
#define Warn
Definition: emacs.cc:80
int(* cfParDeg)(number x, const coeffs r)
degree for coeffcients: -1 for 0, 0 for "constants", ...
Definition: coeffs.h:296
void nKillChar ( coeffs  r)

undo all initialisations

Definition at line 477 of file numbers.cc.

479 {
481  if (r!=NULL)
482  {
483  r->ref--;
484  if (r->ref<=0)
485  {
486  n_Procs_s tmp;
487  n_Procs_s* n=&tmp;
488  tmp.next=cf_root;
489  while((n->next!=NULL) && (n->next!=r)) n=n->next;
490  if (n->next==r)
491  {
492  n->next=n->next->next;
493  if (cf_root==r) cf_root=n->next;
494  n_Delete(&(r->nNULL),r);
495  assume (r->cfKillChar!=NULL); r->cfKillChar(r); // STATISTIC(nKillChar);
496  omFreeSize((void *)r, sizeof(n_Procs_s));
497  r=NULL;
498  }
499  else
500  {
501  WarnS("cf_root list destroyed");
502  }
503  }
504  }
#define STATISTIC(f)
Definition: numstats.h:16
coeffs next
Definition: coeffs.h:123
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define WarnS
Definition: emacs.cc:81
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:477
#define assume(x)
Definition: mod2.h:405
n_Procs_s * cf_root
Definition: numbers.cc:47
#define NULL
Definition: omList.c:10
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
void nNew ( number *  a)

Definition at line 49 of file numbers.cc.

49 { *d=NULL; }
#define NULL
Definition: omList.c:10
static FORCE_INLINE void nSetChar ( const coeffs  r)
static

initialisations after each ring change

Definition at line 436 of file coeffs.h.

437 { STATISTIC(nSetChar); assume(r!=NULL); assume(r->cfSetChar != NULL); r->cfSetChar(r); }
#define STATISTIC(f)
Definition: numstats.h:16
static FORCE_INLINE void nSetChar(const coeffs r)
initialisations after each ring change
Definition: coeffs.h:436
#define assume(x)
Definition: mod2.h:405
#define NULL
Definition: omList.c:10
static FORCE_INLINE void number2mpz ( number  n,
coeffs  c,
mpz_t  m 
)
static

Definition at line 986 of file coeffs.h.

986 { n_MPZ(m, n, c); }
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
int m
Definition: cfEzgcd.cc:119
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
Definition: coeffs.h:550

Variable Documentation

unsigned short fftable[]

Definition at line 61 of file ffields.cc.

omBin rnumber_bin

Definition at line 23 of file longrat0.cc.