Data Structures | Functions | Variables
numbers.cc File Reference
#include <string.h>
#include <stdlib.h>
#include "misc/auxiliary.h"
#include "misc/mylimits.h"
#include "factory/factory.h"
#include "reporter/reporter.h"
#include "coeffs/coeffs.h"
#include "coeffs/numbers.h"
#include "coeffs/longrat.h"
#include "coeffs/modulop.h"
#include "coeffs/gnumpfl.h"
#include "coeffs/gnumpc.h"
#include "coeffs/ffields.h"
#include "coeffs/shortfl.h"
#include "coeffs/ntupel.h"
#include "coeffs/rmodulo2m.h"
#include "coeffs/rmodulon.h"
#include "coeffs/rintegers.h"
#include "polys/ext_fields/algext.h"
#include "polys/ext_fields/transext.h"

Go to the source code of this file.

Data Structures

struct  nFindCoeffByName_p
 

Functions

void nNew (number *d)
 
static void ndDelete (number *d, const coeffs)
 
static number ndAnn (number, const coeffs)
 
static char * ndCoeffString (const coeffs r)
 
static char * ndCoeffName (const coeffs r)
 
static void ndInpMult (number &a, number b, const coeffs r)
 
static void ndInpAdd (number &a, number b, const coeffs r)
 
static void ndPower (number a, int i, number *res, const coeffs r)
 
static number ndInvers (number a, const coeffs r)
 
static BOOLEAN ndIsUnit (number a, const coeffs r)
 
static BOOLEAN ndDBTest (number, const char *, const int, const coeffs)
 
static number ndFarey (number, number, const coeffs r)
 
static number ndChineseRemainder (number *, number *, int, BOOLEAN, CFArray &, const coeffs r)
 
static int ndParDeg (number n, const coeffs r)
 
static number ndParameter (const int, const coeffs r)
 
BOOLEAN n_IsZeroDivisor (number a, const coeffs r)
 Test whether a is a zero divisor in r i.e. not coprime with char. of r very inefficient implementation: should ONLY be used for debug stuff /tests. More...
 
static void ndNormalize (number &, const coeffs)
 
static number ndReturn0 (number, const coeffs r)
 
number ndGcd (number, number, const coeffs r)
 
static number ndIntMod (number, number, const coeffs r)
 
static number ndGetDenom (number &, const coeffs r)
 
static number ndGetNumerator (number &a, const coeffs r)
 
static int ndSize (number a, const coeffs r)
 
static void ndClearContent (ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
 
static void ndClearDenominators (ICoeffsEnumerator &, number &d, const coeffs r)
 
static number ndCopy (number a, const coeffs)
 
number ndCopyMap (number a, const coeffs aRing, const coeffs r)
 
static void ndKillChar (coeffs)
 
static void ndSetChar (const coeffs)
 
number nd_Copy (number a, const coeffs r)
 
static BOOLEAN ndDivBy (number, number, const coeffs)
 
static int ndDivComp (number, number, const coeffs)
 
static number ndExtGcd (number, number, number *, number *, const coeffs r)
 
CanonicalForm ndConvSingNFactoryN (number, BOOLEAN, const coeffs)
 
static number ndConvFactoryNSingN (const CanonicalForm, const coeffs)
 [in, out] a bigint number >= 0 More...
 
static void ndMPZ (mpz_t result, number &n, const coeffs r)
 Converts a non-negative bigint number into a GMP number. More...
 
static number ndInitMPZ (mpz_t m, const coeffs r)
 
static BOOLEAN ndCoeffIsEqual (const coeffs r, n_coeffType n, void *)
 
static number ndQuotRem (number a, number b, number *r, const coeffs R)
 
coeffs nInitChar (n_coeffType t, void *parameter)
 one-time initialisations for new coeffs in case of an error return NULL More...
 
void nKillChar (coeffs r)
 undo all initialisations More...
 
n_coeffType nRegister (n_coeffType n, cfInitCharProc p)
 
void nRegisterCfByName (cfInitCfByNameProc p, n_coeffType n)
 
coeffs nFindCoeffByName (char *cf_name)
 find an existing coeff by its "CoeffName" More...
 
void n_Print (number &a, const coeffs r)
 print a number (BEWARE of string buffers!) mostly for debugging More...
 
number n_convFactoryNSingN (const CanonicalForm n, const coeffs r)
 
CanonicalForm n_convSingNFactoryN (number n, BOOLEAN setChar, const coeffs r)
 
char * nEati (char *s, int *i, int m)
 divide by the first (leading) number and return it, i.e. make monic More...
 
char * nEatLong (char *s, mpz_ptr i)
 extracts a long integer from s, returns the rest More...
 

Variables

n_Procs_scf_root =NULL
 
static n_coeffType nLastCoeffs =n_CF
 
cfInitCharProc nInitCharTableDefault []
 
static cfInitCharProcnInitCharTable =nInitCharTableDefault
 
nFindCoeffByName_p nFindCoeffByName_Root =NULL
 

Data Structure Documentation

◆ nFindCoeffByName_s

struct nFindCoeffByName_s

Definition at line 571 of file numbers.cc.

Data Fields
n_coeffType n
nFindCoeffByName_p next
cfInitCfByNameProc p

Function Documentation

◆ n_convFactoryNSingN()

number n_convFactoryNSingN ( const CanonicalForm  n,
const coeffs  r 
)

Definition at line 621 of file numbers.cc.

623 { 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:621
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12

◆ n_convSingNFactoryN()

CanonicalForm n_convSingNFactoryN ( number  n,
BOOLEAN  setChar,
const coeffs  r 
)

Definition at line 626 of file numbers.cc.

628 { STATISTIC(n_convSingNFactoryN); assume(r != NULL); assume(r->convSingNFactoryN != NULL); return r->convSingNFactoryN(n, setChar, r); }
#define STATISTIC(f)
Definition: numstats.h:16
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:12
CanonicalForm n_convSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
Definition: numbers.cc:626

◆ n_IsZeroDivisor()

BOOLEAN n_IsZeroDivisor ( number  a,
const coeffs  r 
)

Test whether a is a zero divisor in r i.e. not coprime with char. of r very inefficient implementation: should ONLY be used for debug stuff /tests.

Definition at line 145 of file numbers.cc.

146 {
147  BOOLEAN ret = n_IsZero(a, r);
148  int c = n_GetChar(r);
149  if (ret || (c==0) || (r->is_field))
150  return ret; /*n_IsZero(a, r)*/
151  number ch = n_Init( c, r );
152  number g = n_Gcd( ch, a, r );
153  ret = !n_IsOne (g, r);
154  n_Delete(&ch, r);
155  n_Delete(&g, r);
156  return ret;
157 }
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of &#39;a&#39; and &#39;b&#39; in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
Definition: coeffs.h:686
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:468
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:538
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:444
g
Definition: cfModGcd.cc:4031
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:464
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:455
int BOOLEAN
Definition: auxiliary.h:85

◆ n_Print()

void n_Print ( number &  a,
const coeffs  r 
)

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

Definition at line 610 of file numbers.cc.

612 {
613  assume(r != NULL);
614  n_Test(a,r);
615 
616  StringSetS("");
617  n_Write(a, r);
618  { char* s = StringEndS(); Print("%s", s); omFree(s); }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:80
char * StringEndS()
Definition: reporter.cc:151
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:390
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:591
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:738
#define NULL
Definition: omList.c:12

◆ nd_Copy()

number nd_Copy ( number  a,
const coeffs  r 
)

Definition at line 264 of file numbers.cc.

264 { return r->cfCopy(a, r); }

◆ ndAnn()

static number ndAnn ( number  ,
const coeffs   
)
static

Definition at line 54 of file numbers.cc.

54 { return NULL;}
#define NULL
Definition: omList.c:12

◆ ndChineseRemainder()

static number ndChineseRemainder ( number *  ,
number *  ,
int  ,
BOOLEAN  ,
CFArray ,
const coeffs  r 
)
static

Definition at line 128 of file numbers.cc.

129 {
130  Werror("ChineseRemainder not implemented for %s (c=%d)",r->cfCoeffString(r),getCoeffType(r));
131  return r->cfInit(0,r);
132 }
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ ndClearContent()

static void ndClearContent ( ICoeffsEnumerator numberCollectionEnumerator,
number &  c,
const coeffs  r 
)
static

TODO: move to a separate implementation

Definition at line 167 of file numbers.cc.

168 {
169  assume(r != NULL);
170 
171  // no fractions
172  assume(!( nCoeff_is_Q(r) ));
173  // all coeffs are given by integers!!!
174 
175  numberCollectionEnumerator.Reset();
176 
177  if( !numberCollectionEnumerator.MoveNext() ) // empty zero polynomial?
178  {
179  c = n_Init(1, r);
180  return;
181  }
182 
183  number &curr = numberCollectionEnumerator.Current();
184 
185 #ifdef HAVE_RINGS
186  /// TODO: move to a separate implementation
187  if (nCoeff_is_Ring(r))
188  {
189  if (nCoeff_has_Units(r))
190  {
191  c = n_GetUnit(curr, r);
192 
193  if (!n_IsOne(c, r))
194  {
195  number inv = n_Invers(c, r);
196 
197  n_InpMult(curr, inv, r);
198 
199  while( numberCollectionEnumerator.MoveNext() )
200  {
201  number &n = numberCollectionEnumerator.Current();
202  n_Normalize(n, r); // ?
203  n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
204  }
205 
206  n_Delete(&inv, r);
207  }
208  } else c = n_Init(1, r);
209 
210  return;
211  }
212 #endif
213 
214  assume(!nCoeff_is_Ring(r));
216 
217  n_Normalize(curr, r); // Q: good/bad/ugly??
218 
219  if (!n_IsOne(curr, r))
220  {
221  number t = curr; // takes over the curr! note: not a reference!!!
222 
223  curr = n_Init(1, r); // ???
224 
225  number inv = n_Invers(t, r);
226 
227  while( numberCollectionEnumerator.MoveNext() )
228  {
229  number &n = numberCollectionEnumerator.Current();
230  n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
231 // n_Normalize(n, r); // ?
232  }
233 
234  n_Delete(&inv, r);
235 
236  c = t;
237  } else
238  c = n_Copy(curr, r); // c == 1 and nothing else to do...
239 }
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:532
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition: coeffs.h:854
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:822
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition: coeffs.h:881
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of &#39;a&#39; and &#39;b&#39;; replacement of &#39;a&#39; by the product a*b
Definition: coeffs.h:641
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:468
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:538
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:578
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:828
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:752
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection...
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
returns TRUE, if r is not a field and r has non-trivial units
Definition: coeffs.h:819
virtual reference Current()=0
Gets the current element in the collection (read and write).
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of &#39;a&#39;; raise an error if &#39;a&#39; is not invertible ...
Definition: coeffs.h:564
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:861
#define NULL
Definition: omList.c:12
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:451
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algext(const coeffs r)
is it an alg. ext. of Q?
Definition: coeffs.h:936
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:455

◆ ndClearDenominators()

static void ndClearDenominators ( ICoeffsEnumerator ,
number &  d,
const coeffs  r 
)
static

Definition at line 241 of file numbers.cc.

242 {
243  assume( r != NULL );
246 
247  d = n_Init(1, r);
248 }
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition: coeffs.h:854
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:822
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:538
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:828
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:752
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:932
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:940
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:861
#define NULL
Definition: omList.c:12

◆ ndCoeffIsEqual()

static BOOLEAN ndCoeffIsEqual ( const coeffs  r,
n_coeffType  n,
void *   
)
static

Definition at line 298 of file numbers.cc.

300 {
301  /* test, if r is an instance of nInitCoeffs(n,parameter) */
302  /* if parameter is not needed */
303  return (n==r->type);

◆ ndCoeffName()

static char* ndCoeffName ( const coeffs  r)
static

Definition at line 60 of file numbers.cc.

61 {
62  static char s[20];
63  snprintf(s,11,"Coeffs(%d)",r->type);
64  return s;
65 }
const CanonicalForm int s
Definition: facAbsFact.cc:55

◆ ndCoeffString()

static char* ndCoeffString ( const coeffs  r)
static

Definition at line 55 of file numbers.cc.

56 {
57  char *s=(char *)omAlloc(11);snprintf(s,11,"Coeffs(%d)",r->type);
58  return s;
59 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define omAlloc(size)
Definition: omAllocDecl.h:210

◆ ndConvFactoryNSingN()

static number ndConvFactoryNSingN ( const CanonicalForm  ,
const coeffs   
)
static

[in, out] a bigint number >= 0

[out] the GMP equivalent

Definition at line 279 of file numbers.cc.

◆ ndConvSingNFactoryN()

CanonicalForm ndConvSingNFactoryN ( number  ,
BOOLEAN  ,
const coeffs   
)

Definition at line 272 of file numbers.cc.

273 {
274  CanonicalForm term(0);
275  WerrorS("no conversion to factory");
276  return term;
277 }
Definition: int_poly.h:33
factory&#39;s main class
Definition: canonicalform.h:77
void WerrorS(const char *s)
Definition: feFopen.cc:24

◆ ndCopy()

static number ndCopy ( number  a,
const coeffs   
)
static

Definition at line 250 of file numbers.cc.

250 { return a; }

◆ ndCopyMap()

number ndCopyMap ( number  a,
const coeffs  aRing,
const coeffs  r 
)

Definition at line 251 of file numbers.cc.

252 {
253  // aRing and r need not be the same, but must be the same representation
254  assume(aRing->rep==r->rep);
256  return a;
257  else
258  return r->cfCopy(a, r);
259 }
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete/n_New are empty operations.
Definition: coeffs.h:928

◆ ndDBTest()

static BOOLEAN ndDBTest ( number  ,
const char *  ,
const int  ,
const coeffs   
)
static

Definition at line 120 of file numbers.cc.

120 { return TRUE; }
#define TRUE
Definition: auxiliary.h:98

◆ ndDelete()

static void ndDelete ( number *  d,
const coeffs   
)
static

Definition at line 53 of file numbers.cc.

53 { *d=NULL; }
#define NULL
Definition: omList.c:12

◆ ndDivBy()

static BOOLEAN ndDivBy ( number  ,
number  ,
const coeffs   
)
static

Definition at line 267 of file numbers.cc.

267 { return TRUE; } // assume a,b !=0
#define TRUE
Definition: auxiliary.h:98

◆ ndDivComp()

static int ndDivComp ( number  ,
number  ,
const coeffs   
)
static

Definition at line 268 of file numbers.cc.

268 { return 2; }

◆ ndExtGcd()

static number ndExtGcd ( number  ,
number  ,
number *  ,
number *  ,
const coeffs  r 
)
static

Definition at line 269 of file numbers.cc.

269 { return r->cfInit(1,r); }

◆ ndFarey()

static number ndFarey ( number  ,
number  ,
const coeffs  r 
)
static

Definition at line 123 of file numbers.cc.

124 {
125  Werror("farey not implemented for %s (c=%d)",r->cfCoeffString(r),getCoeffType(r));
126  return NULL;
127 }
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:12
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ ndGcd()

number ndGcd ( number  ,
number  ,
const coeffs  r 
)

Definition at line 161 of file numbers.cc.

161 { return r->cfInit(1,r); }

◆ ndGetDenom()

static number ndGetDenom ( number &  ,
const coeffs  r 
)
static

Definition at line 163 of file numbers.cc.

163 { return r->cfInit(1,r); }

◆ ndGetNumerator()

static number ndGetNumerator ( number &  a,
const coeffs  r 
)
static

Definition at line 164 of file numbers.cc.

164 { return r->cfCopy(a,r); }

◆ ndInitMPZ()

static number ndInitMPZ ( mpz_t  m,
const coeffs  r 
)
static

Definition at line 292 of file numbers.cc.

294 {
295  return r->cfInit( mpz_get_si(m), r);
int m
Definition: cfEzgcd.cc:121

◆ ndInpAdd()

static void ndInpAdd ( number &  a,
number  b,
const coeffs  r 
)
static

Definition at line 72 of file numbers.cc.

73 {
74  number n=r->cfAdd(a,b,r);
75  r->cfDelete(&a,r);
76  a=n;
77 }
CanonicalForm b
Definition: cfModGcd.cc:4044

◆ ndInpMult()

static void ndInpMult ( number &  a,
number  b,
const coeffs  r 
)
static

Definition at line 66 of file numbers.cc.

67 {
68  number n=r->cfMult(a,b,r);
69  r->cfDelete(&a,r);
70  a=n;
71 }
CanonicalForm b
Definition: cfModGcd.cc:4044

◆ ndIntMod()

static number ndIntMod ( number  ,
number  ,
const coeffs  r 
)
static

Definition at line 162 of file numbers.cc.

162 { return r->cfInit(0,r); }

◆ ndInvers()

static number ndInvers ( number  a,
const coeffs  r 
)
static

Definition at line 109 of file numbers.cc.

110 {
111  number one=r->cfInit(1,r);
112  number res=r->cfDiv(one,a,r);
113  r->cfDelete(&one,r);
114  return res;
115 }
CanonicalForm res
Definition: facAbsFact.cc:64

◆ ndIsUnit()

static BOOLEAN ndIsUnit ( number  a,
const coeffs  r 
)
static

Definition at line 117 of file numbers.cc.

117 { return !r->cfIsZero(a,r); }

◆ ndKillChar()

static void ndKillChar ( coeffs  )
static

Definition at line 261 of file numbers.cc.

261 {}

◆ ndMPZ()

static void ndMPZ ( mpz_t  result,
number &  n,
const coeffs  r 
)
static

Converts a non-negative bigint number into a GMP number.

Definition at line 287 of file numbers.cc.

289 {
290  mpz_init_set_si( result, r->cfInt(n, r) );
return result
Definition: facAbsBiFact.cc:76

◆ ndNormalize()

static void ndNormalize ( number &  ,
const coeffs   
)
static

Definition at line 159 of file numbers.cc.

159 { }

◆ ndParameter()

static number ndParameter ( const int  ,
const coeffs  r 
)
static

Definition at line 139 of file numbers.cc.

140 {
141  Werror("ndParameter: n_Parameter is not implemented/relevant for (coeff_type = %d)",getCoeffType(r));
142  return NULL;
143 }
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
#define NULL
Definition: omList.c:12
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ ndParDeg()

static int ndParDeg ( number  n,
const coeffs  r 
)
static

Definition at line 134 of file numbers.cc.

135 {
136  return (-r->cfIsZero(n,r));
137 }

◆ ndPower()

static void ndPower ( number  a,
int  i,
number *  res,
const coeffs  r 
)
static

Definition at line 79 of file numbers.cc.

80 {
81  if (i==0)
82  {
83  *res = r->cfInit(1, r);
84  }
85  else if (i==1)
86  {
87  *res = r->cfCopy(a, r);
88  }
89  else if (i==2)
90  {
91  *res = r->cfMult(a, a, r);
92  }
93  else if (i<0)
94  {
95  number b = r->cfInvers(a, r);
96  ndPower(b, -i, res, r);
97  r->cfDelete(&b, r);
98  }
99  else
100  {
101  ndPower(a, i/2, res, r);
102  r->cfInpMult(*res, *res, r);
103  if (i&1)
104  {
105  r->cfInpMult(*res, a, r);
106  }
107  }
108 }
static void ndPower(number a, int i, number *res, const coeffs r)
Definition: numbers.cc:79
CanonicalForm b
Definition: cfModGcd.cc:4044
CanonicalForm res
Definition: facAbsFact.cc:64
int i
Definition: cfEzgcd.cc:125

◆ ndQuotRem()

static number ndQuotRem ( number  a,
number  b,
number *  r,
const coeffs  R 
)
static

Definition at line 305 of file numbers.cc.

307 {
308  // implementation for a field: r: 0, result: n_Div
309  assume(R->is_field);
310  *r=n_Init(0,R);
311  return n_Div(a,b,R);
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:538
CanonicalForm b
Definition: cfModGcd.cc:4044
#define assume(x)
Definition: mod2.h:390
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:615

◆ ndReturn0()

static number ndReturn0 ( number  ,
const coeffs  r 
)
static

Definition at line 160 of file numbers.cc.

160 { return r->cfInit(0,r); }

◆ ndSetChar()

static void ndSetChar ( const coeffs  )
static

Definition at line 262 of file numbers.cc.

262 {}

◆ ndSize()

static int ndSize ( number  a,
const coeffs  r 
)
static

Definition at line 165 of file numbers.cc.

165 { return (int)r->cfIsZero(a,r)==FALSE; }
#define FALSE
Definition: auxiliary.h:94

◆ nEati()

char* nEati ( char *  s,
int *  i,
int  m 
)

divide by the first (leading) number and return it, i.e. make monic

does nothing (just returns a dummy one number) helper routine: read an int from a string (mod m), return a pointer to the rest

Definition at line 630 of file numbers.cc.

632 {
633 
634  if (((*s) >= '0') && ((*s) <= '9'))
635  {
636  unsigned long ii=0L;
637  do
638  {
639  ii *= 10;
640  ii += *s++ - '0';
641  if ((m!=0) && (ii > (MAX_INT_VAL / 10))) ii = ii % m;
642  }
643  while (((*s) >= '0') && ((*s) <= '9'));
644  if ((m!=0) && (ii>=m)) ii=ii%m;
645  *i=(int)ii;
646  }
647  else (*i) = 1;
648  return s;
const CanonicalForm int s
Definition: facAbsFact.cc:55
const int MAX_INT_VAL
Definition: mylimits.h:12
int m
Definition: cfEzgcd.cc:121
int i
Definition: cfEzgcd.cc:125

◆ nEatLong()

char* nEatLong ( char *  s,
mpz_ptr  i 
)

extracts a long integer from s, returns the rest

Definition at line 651 of file numbers.cc.

653 {
654  const char * start=s;
655 
656  while (*s >= '0' && *s <= '9') s++;
657  if (*s=='\0')
658  {
659  mpz_set_str(i,start,10);
660  }
661  else
662  {
663  char c=*s;
664  *s='\0';
665  mpz_set_str(i,start,10);
666  *s=c;
667  }
668  return s;
const CanonicalForm int s
Definition: facAbsFact.cc:55
int i
Definition: cfEzgcd.cc:125

◆ nFindCoeffByName()

coeffs nFindCoeffByName ( char *  cf_name)

find an existing coeff by its "CoeffName"

Definition at line 588 of file numbers.cc.

590 {
591  n_Procs_s* n=cf_root;
592  // try existings coeffs:
593  while(n!=NULL)
594  {
595  if ((n->cfCoeffName!=NULL)
596  && (strcmp(cf_name,n->cfCoeffName(n))==0)) return n;
597  n=n->next;
598  }
599  // TODO: parametrized cf, e.g. flint:Z/26[a]
600  // try existing types:
601  nFindCoeffByName_p p=nFindCoeffByName_Root;
602  while(p!=NULL)
603  {
604  coeffs cf=p->p(cf_name,p->n);
605  if (cf!=NULL) return cf;
606  p=p->next;
607  }
608  return NULL;
coeffs next
Definition: coeffs.h:125
nFindCoeffByName_p nFindCoeffByName_Root
Definition: numbers.cc:578
The main handler for Singular numbers which are suitable for Singular polynomials.
n_Procs_s * cf_root
Definition: numbers.cc:48
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:12
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitue cfCoeffWrite, cfCoeffString
Definition: coeffs.h:154
int p
Definition: cfModGcd.cc:4019

◆ nInitChar()

coeffs nInitChar ( n_coeffType  t,
void *  parameter 
)

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

Definition at line 349 of file numbers.cc.

351 {
352  n_Procs_s *n=cf_root;
353 
354  while((n!=NULL) && (n->nCoeffIsEqual!=NULL) && (!n->nCoeffIsEqual(n,t,parameter)))
355  n=n->next;
356 
357  if (n==NULL)
358  {
359  n=(n_Procs_s*)omAlloc0(sizeof(n_Procs_s));
360  n->next=cf_root;
361  n->ref=1;
362  n->type=t;
363 
364  // default entries (different from NULL) for some routines:
366  n->cfSize = ndSize;
369  n->cfImPart=ndReturn0;
370  n->cfDelete= ndDelete;
371  n->cfAnn = ndAnn;
372  n->cfCoeffString = ndCoeffString; // should alway be changed!
373  n->cfCoeffName = ndCoeffName; // should alway be changed!
374  n->cfInpMult=ndInpMult;
375  n->cfInpAdd=ndInpAdd;
376  n->cfCopy = ndCopy;
377  n->cfIntMod=ndIntMod; /* dummy !! */
379  n->cfGcd = ndGcd;
380  n->cfNormalizeHelper = ndGcd; /* tricky, isn't it ?*/
381  n->cfLcm = ndGcd; /* tricky, isn't it ?*/
382  n->cfInitMPZ = ndInitMPZ;
383  n->cfMPZ = ndMPZ;
384  n->cfPower = ndPower;
385  n->cfQuotRem = ndQuotRem;
386  n->cfInvers = ndInvers;
387 
388  n->cfKillChar = ndKillChar; /* dummy */
389  n->cfSetChar = ndSetChar; /* dummy */
390  // temp. removed to catch all the coeffs which miss to implement this!
391 
393  n->cfFarey = ndFarey;
394  n->cfParDeg = ndParDeg;
395 
397 
400 
401  n->cfIsUnit = ndIsUnit;
402 #ifdef HAVE_RINGS
403  n->cfDivComp = ndDivComp;
404  n->cfDivBy = ndDivBy;
405  n->cfExtGcd = ndExtGcd;
406  //n->cfGetUnit = (nMapFunc)NULL;
407 #endif
408 
409 #ifdef LDEBUG
410  n->cfDBTest=ndDBTest;
411 #endif
412 
415 
416  BOOLEAN nOK=TRUE;
417  // init
418  if ((t<=nLastCoeffs) && (nInitCharTable[t]!=NULL))
419  nOK = (nInitCharTable[t])(n,parameter);
420  else
421  Werror("Sorry: the coeff type [%d] was not registered: it is missing in nInitCharTable", (int)t);
422  if (nOK)
423  {
424  omFreeSize(n,sizeof(*n));
425  return NULL;
426  }
427  cf_root=n;
428  // post init settings:
429  if (n->cfRePart==NULL) n->cfRePart=n->cfCopy;
430  if (n->cfExactDiv==NULL) n->cfExactDiv=n->cfDiv;
431  if (n->cfSubringGcd==NULL) n->cfSubringGcd=n->cfGcd;
432 
433 #ifdef HAVE_RINGS
434  if (n->cfGetUnit==NULL) n->cfGetUnit=n->cfCopy;
435 #endif
436 
437  if(n->cfWriteShort==NULL)
438  n->cfWriteShort = n->cfWriteLong;
439 
441  assume(n->cfSetChar!=NULL);
444  assume(n->cfMult!=NULL);
445  assume(n->cfSub!=NULL);
446  assume(n->cfAdd!=NULL);
447  assume(n->cfDiv!=NULL);
448  assume(n->cfIntMod!=NULL);
449  assume(n->cfExactDiv!=NULL);
450  assume(n->cfInit!=NULL);
451  assume(n->cfInitMPZ!=NULL);
452  assume(n->cfSize!=NULL);
453  assume(n->cfInt!=NULL);
454  assume(n->cfMPZ!=NULL);
455  //assume(n->n->cfDivComp!=NULL);
456  //assume(n->cfIsUnit!=NULL);
457  //assume(n->cfGetUnit!=NULL);
458  //assume(n->cfExtGcd!=NULL);
459  assume(n->cfInpNeg!=NULL);
460  assume(n->cfCopy!=NULL);
461 
462  assume(n->cfWriteLong!=NULL);
463  assume(n->cfWriteShort!=NULL);
464 
465  assume(n->iNumberOfParameters>= 0);
466 
467  assume( (n->iNumberOfParameters == 0 && n->pParameterNames == NULL) ||
468  (n->iNumberOfParameters > 0 && n->pParameterNames != NULL) );
469 
470  assume(n->cfParameter!=NULL);
471  assume(n->cfParDeg!=NULL);
472 
473  assume(n->cfRead!=NULL);
474  assume(n->cfNormalize!=NULL);
475  assume(n->cfGreater!=NULL);
476  //assume(n->cfDivBy!=NULL);
477  assume(n->cfEqual!=NULL);
478  assume(n->cfIsZero!=NULL);
479  assume(n->cfIsOne!=NULL);
480  assume(n->cfIsMOne!=NULL);
482  assume(n->cfGetDenom!=NULL);
484  assume(n->cfGcd!=NULL);
486  assume(n->cfDelete!=NULL);
487  assume(n->cfSetMap!=NULL);
488  assume(n->cfInpMult!=NULL);
489 // assume(n->cfInit_bigint!=NULL);
490  assume(n->cfCoeffWrite != NULL);
491 
492  assume(n->cfClearContent != NULL);
494 
495  assume(n->type==t);
496 
497 #ifndef SING_NDEBUG
498  if(n->cfKillChar==NULL) Warn("cfKillChar is NULL for coeff %d",t);
499  if(n->cfWriteLong==NULL) Warn("cfWrite is NULL for coeff %d",t);
500  if(n->cfWriteShort==NULL) Warn("cfWriteShort is NULL for coeff %d",t);
501  if(n->cfCoeffString==ndCoeffString) Warn("cfCoeffString is undefined for coeff %d",t);
502 #endif
503  }
504  else
505  {
506  n->ref++;
507  }
508  return n;
static BOOLEAN ndIsUnit(number a, const coeffs r)
Definition: numbers.cc:117
BOOLEAN(* cfDivBy)(number a, number b, const coeffs r)
Definition: coeffs.h:381
number(* cfCopy)(number a, const coeffs r)
return a copy of a
Definition: coeffs.h:199
number(* cfExtGcd)(number a, number b, number *s, number *t, const coeffs r)
Definition: coeffs.h:248
numberfunc cfIntMod
Definition: coeffs.h:175
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:79
static number ndParameter(const int, const coeffs r)
Definition: numbers.cc:139
number ndGcd(number, number, const coeffs r)
Definition: numbers.cc:161
static void ndKillChar(coeffs)
Definition: numbers.cc:261
static number ndQuotRem(number a, number b, number *r, const coeffs R)
Definition: numbers.cc:305
static BOOLEAN ndDBTest(number, const char *, const int, const coeffs)
Definition: numbers.cc:120
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:190
void(* cfSetChar)(const coeffs r)
Definition: coeffs.h:161
static BOOLEAN ndDivBy(number, number, const coeffs)
Definition: numbers.cc:267
number(* cfQuotRem)(number a, number b, number *rem, const coeffs r)
Definition: coeffs.h:269
char const ** pParameterNames
array containing the names of Parameters (default NULL)
Definition: coeffs.h:322
coeffs next
Definition: coeffs.h:125
static number ndInvers(number a, const coeffs r)
Definition: numbers.cc:109
static number ndCopy(number a, const coeffs)
Definition: numbers.cc:250
static n_coeffType nLastCoeffs
Definition: numbers.cc:312
static number ndChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs r)
Definition: numbers.cc:128
void(* cfDelete)(number *a, const coeffs r)
Definition: coeffs.h:272
static void ndNormalize(number &, const coeffs)
Definition: numbers.cc:159
BOOLEAN(*)(*)(*)(*) cfIsOne(number a, const coeffs r)
Definition: coeffs.h:229
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
number(* cfSubringGcd)(number a, number b, const coeffs r)
Definition: coeffs.h:247
static number ndConvFactoryNSingN(const CanonicalForm, const coeffs)
[in, out] a bigint number >= 0
Definition: numbers.cc:279
numberfunc cfAdd
Definition: coeffs.h:175
number(* cfInvers)(number a, const coeffs r)
return 1/a
Definition: coeffs.h:197
BOOLEAN(* cfGreater)(number a, number b, const coeffs r)
Definition: coeffs.h:225
void(* cfNormalize)(number &a, const coeffs r)
Definition: coeffs.h:223
static char * ndCoeffString(const coeffs r)
Definition: numbers.cc:55
number(* cfRePart)(number a, const coeffs r)
Definition: coeffs.h:200
#define TRUE
Definition: auxiliary.h:98
static void ndDelete(number *d, const coeffs)
Definition: numbers.cc:53
static int ndDivComp(number, number, const coeffs)
Definition: numbers.cc:268
void(* cfCoeffWrite)(const coeffs r, BOOLEAN details)
output of coeff description via Print
Definition: coeffs.h:148
static char * ndCoeffName(const coeffs r)
Definition: numbers.cc:60
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:291
number(* cfInitMPZ)(mpz_t i, const coeffs r)
init with a GMP integer
Definition: coeffs.h:181
char *(* cfCoeffString)(const coeffs r)
string output of coeff description
Definition: coeffs.h:151
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition: numbers.cc:272
BOOLEAN(* nCoeffIsEqual)(const coeffs r, n_coeffType n, void *parameter)
Definition: coeffs.h:145
static number ndReturn0(number, const coeffs r)
Definition: numbers.cc:160
static void ndInpMult(number &a, number b, const coeffs r)
Definition: numbers.cc:66
number(* cfInit)(long i, const coeffs r)
init with an integer
Definition: coeffs.h:178
number(* cfNormalizeHelper)(number a, number b, const coeffs r)
Definition: coeffs.h:271
static number ndInitMPZ(mpz_t m, const coeffs r)
Definition: numbers.cc:292
static int ndParDeg(number n, const coeffs r)
Definition: numbers.cc:134
BOOLEAN(*)(*)(*)(*)(*)(*) cfGreaterZero(number a, const coeffs r)
Definition: coeffs.h:237
long(* cfInt)(number &n, const coeffs r)
convertion to long, 0 if impossible
Definition: coeffs.h:187
void(* cfInpMult)(number &a, number b, const coeffs r)
Inplace: a *= b.
Definition: coeffs.h:281
numberfunc cfSub
Definition: coeffs.h:175
static void ndClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Definition: numbers.cc:167
static number ndGetDenom(number &, const coeffs r)
Definition: numbers.cc:163
number(* cfImPart)(number a, const coeffs r)
Definition: coeffs.h:201
#define assume(x)
Definition: mod2.h:390
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:195
static int ndSize(number a, const coeffs r)
Definition: numbers.cc:165
int ref
Definition: coeffs.h:126
void(* cfPower)(number a, int i, number *result, const coeffs r)
Definition: coeffs.h:239
nCoeffsEnumeratorFunc cfClearContent
function pointer behind n_ClearContent
Definition: coeffs.h:309
n_Procs_s * cf_root
Definition: numbers.cc:48
numberfunc cfExactDiv
Definition: coeffs.h:175
static BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void *)
Definition: numbers.cc:298
n_coeffType type
Definition: coeffs.h:128
numberfunc cfDiv
Definition: coeffs.h:175
const char *(* cfRead)(const char *s, number *a, const coeffs r)
Definition: coeffs.h:221
numberfunc cfMult
Definition: coeffs.h:175
static number ndExtGcd(number, number, number *, number *, const coeffs r)
Definition: numbers.cc:269
static cfInitCharProc * nInitCharTable
Definition: numbers.cc:345
#define NULL
Definition: omList.c:12
void(* cfWriteLong)(number a, const coeffs r)
print a given number (long format)
Definition: coeffs.h:204
number(* cfGcd)(number a, number b, const coeffs r)
Definition: coeffs.h:246
static void ndSetChar(const coeffs)
Definition: numbers.cc:262
number(* cfLcm)(number a, number b, const coeffs r)
Definition: coeffs.h:270
static void ndInpAdd(number &a, number b, const coeffs r)
Definition: numbers.cc:72
number(* convFactoryNSingN)(const CanonicalForm n, const coeffs r)
conversion to CanonicalForm(factory) to number
Definition: coeffs.h:315
number(* cfChineseRemainder)(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
chinese remainder returns X with X mod q[i]=x[i], i=0..rl-1
Definition: coeffs.h:297
static number ndGetNumerator(number &a, const coeffs r)
Definition: numbers.cc:164
static number ndAnn(number, const coeffs)
Definition: numbers.cc:54
static number ndIntMod(number, number, const coeffs r)
Definition: numbers.cc:162
static number ndFarey(number, number, const coeffs r)
Definition: numbers.cc:123
static void ndClearDenominators(ICoeffsEnumerator &, number &d, const coeffs r)
Definition: numbers.cc:241
nMapFunc(* cfSetMap)(const coeffs src, const coeffs dst)
Definition: coeffs.h:275
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitue cfCoeffWrite, cfCoeffString
Definition: coeffs.h:154
int(* cfSize)(number n, const coeffs r)
how complicated, (0) => 0, or positive
Definition: coeffs.h:184
number(* cfAnn)(number a, const coeffs r)
Definition: coeffs.h:261
number(* cfParameter)(const int i, const coeffs r)
create i^th parameter or NULL if not possible
Definition: coeffs.h:303
BOOLEAN(*)(*)(*)(*)(*) cfIsMOne(number a, const coeffs r)
Definition: coeffs.h:232
CanonicalForm(* convSingNFactoryN)(number n, BOOLEAN setChar, const coeffs r)
Definition: coeffs.h:316
void(* cfKillChar)(coeffs r)
Definition: coeffs.h:159
int BOOLEAN
Definition: auxiliary.h:85
static void ndMPZ(mpz_t result, number &n, const coeffs r)
Converts a non-negative bigint number into a GMP number.
Definition: numbers.cc:287
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void(* cfInpAdd)(number &a, number b, const coeffs r)
Inplace: a += b.
Definition: coeffs.h:284
number(* cfGetNumerator)(number &n, const coeffs r)
Definition: coeffs.h:241
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:208
#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:240
BOOLEAN(*)(*)(*) cfIsZero(number a, const coeffs r)
Definition: coeffs.h:228
BOOLEAN(*)(*) cfEqual(number a, number b, const coeffs r)
tests
Definition: coeffs.h:227
nCoeffsEnumeratorFunc cfClearDenominators
function pointer behind n_ClearDenominators
Definition: coeffs.h:312
#define Warn
Definition: emacs.cc:77
int(* cfParDeg)(number x, const coeffs r)
degree for coeffcients: -1 for 0, 0 for "constants", ...
Definition: coeffs.h:300

◆ nKillChar()

void nKillChar ( coeffs  r)

undo all initialisations

Definition at line 510 of file numbers.cc.

512 {
514  if (r!=NULL)
515  {
516  r->ref--;
517  if (r->ref<=0)
518  {
519  n_Procs_s tmp;
520  n_Procs_s* n=&tmp;
521  tmp.next=cf_root;
522  while((n->next!=NULL) && (n->next!=r)) n=n->next;
523  if (n->next==r)
524  {
525  n->next=n->next->next;
526  if (cf_root==r) cf_root=n->next;
527  assume (r->cfKillChar!=NULL); r->cfKillChar(r); // STATISTIC(nKillChar);
528  omFreeSize((void *)r, sizeof(n_Procs_s));
529  r=NULL;
530  }
531  else
532  {
533  WarnS("cf_root list destroyed");
534  }
535  }
536  }
#define STATISTIC(f)
Definition: numstats.h:16
coeffs next
Definition: coeffs.h:125
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define WarnS
Definition: emacs.cc:78
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:510
#define assume(x)
Definition: mod2.h:390
n_Procs_s * cf_root
Definition: numbers.cc:48
#define NULL
Definition: omList.c:12

◆ nNew()

void nNew ( number *  d)

Definition at line 50 of file numbers.cc.

50 { *d=NULL; }
#define NULL
Definition: omList.c:12

◆ nRegister()

n_coeffType nRegister ( n_coeffType  n,
cfInitCharProc  p 
)

Definition at line 538 of file numbers.cc.

540 {
541  if (n==n_unknown)
542  {
545  {
547  ((int)nLastCoeffs+1)*sizeof(cfInitCharProc));
549  ((int)nLastCoeffs)*sizeof(cfInitCharProc));
550  }
551  else
552  {
554  ((int)nLastCoeffs)*sizeof(cfInitCharProc),
555  (((int)nLastCoeffs)+1)*sizeof(cfInitCharProc));
556  }
557 
559  return nLastCoeffs;
560  }
561  else
562  {
563  if (nInitCharTable[n]!=NULL) Print("coeff %d already initialized\n",n);
564  nInitCharTable[n]=p;
565  return n;
566  }
#define Print
Definition: emacs.cc:80
static n_coeffType nLastCoeffs
Definition: numbers.cc:312
#define omReallocSize(addr, o_size, size)
Definition: omAllocDecl.h:220
BOOLEAN(* cfInitCharProc)(coeffs, void *)
initialize an object of type coeff, return FALSE in case of success
Definition: numbers.h:94
cfInitCharProc nInitCharTableDefault[]
Definition: numbers.cc:313
n_coeffType
Definition: coeffs.h:27
static cfInitCharProc * nInitCharTable
Definition: numbers.cc:345
#define NULL
Definition: omList.c:12
int p
Definition: cfModGcd.cc:4019
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ nRegisterCfByName()

void nRegisterCfByName ( cfInitCfByNameProc  p,
n_coeffType  n 
)

Definition at line 579 of file numbers.cc.

581 {
582  nFindCoeffByName_p h=(nFindCoeffByName_p)omAlloc0(sizeof(*h));
583  h->p=p;
584  h->n=n;
585  h->next=nFindCoeffByName_Root;
nFindCoeffByName_p nFindCoeffByName_Root
Definition: numbers.cc:578
int p
Definition: cfModGcd.cc:4019
static Poly * h
Definition: janet.cc:971
#define omAlloc0(size)
Definition: omAllocDecl.h:211

Variable Documentation

◆ cf_root

n_Procs_s* cf_root =NULL

Definition at line 48 of file numbers.cc.

◆ nFindCoeffByName_Root

nFindCoeffByName_p nFindCoeffByName_Root =NULL

Definition at line 578 of file numbers.cc.

◆ nInitCharTable

cfInitCharProc* nInitCharTable =nInitCharTableDefault
static

Definition at line 345 of file numbers.cc.

◆ nInitCharTableDefault

cfInitCharProc nInitCharTableDefault[]

Definition at line 313 of file numbers.cc.

◆ nLastCoeffs

n_coeffType nLastCoeffs =n_CF
static

Definition at line 312 of file numbers.cc.