My Project
Loading...
Searching...
No Matches
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/flintcf_Qrat.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

static void ndDelete (number *d, const coeffs)
 
static number ndAnn (number, const coeffs cf)
 
static char * ndCoeffString (const coeffs r)
 
static void ndCoeffWrite (const coeffs r, BOOLEAN)
 
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 number ndInvers_Ring (number a, const coeffs r)
 
static BOOLEAN ndIsUnit_Ring (number a, const coeffs r)
 
static BOOLEAN ndIsUnit_Field (number a, const coeffs r)
 
static number ndGetUnit_Ring (number, const coeffs r)
 
static number ndRandom (siRandProc p, number, number, const coeffs cf)
 
static number ndEucNorm (number a, const coeffs cf)
 
static BOOLEAN ndDBTest (number, const char *, const int, const coeffs)
 
static number ndFarey (number, number, const coeffs r)
 
static number ndXExtGcd (number, number, number *, number *, number *, number *, const coeffs r)
 
static number ndChineseRemainder (number *, number *, int, BOOLEAN, CFArray &, const coeffs r)
 
number ndReadFd (const ssiInfo *, const coeffs r)
 
static void ndWriteFd (number, const ssiInfo *, 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.
 
void ndNormalize (number &, const coeffs)
 
static number ndReturn0 (number, const coeffs r)
 
number ndGcd (number, number, const coeffs r)
 
static number ndIntMod (number a, number b, 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)
 
number ndCopyMap (number a, const coeffs aRing, const coeffs r)
 
static void ndKillChar (coeffs)
 
static void ndSetChar (const coeffs)
 
static number ndCopy (number a, 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 r)
 [in, out] a bigint number >= 0
 
static void ndMPZ (mpz_t result, number &n, const coeffs r)
 Converts a non-negative bigint number into a GMP number.
 
static number ndInitMPZ (mpz_t m, const coeffs r)
 
static const char * ndRead (const char *s, number *n, const coeffs r)
 
static nMapFunc ndSetMap (const coeffs src, const coeffs dst)
 
static BOOLEAN ndCoeffIsEqual (const coeffs r, n_coeffType n, void *d)
 
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
 
void nKillChar (coeffs r)
 undo all initialisations
 
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"
 
void n_Print (number &a, const coeffs r)
 print a number (BEWARE of string buffers!) mostly for debugging
 
char * nEati (char *s, int *i, int m)
 divide by the first (leading) number and return it, i.e. make monic
 
char * nEati (char *s, long *i, int m)
 
char * nEatLong (char *s, mpz_ptr i)
 extracts a long integer from s, returns the rest
 

Variables

VAR n_Procs_scf_root =NULL
 
STATIC_VAR n_coeffType nLastCoeffs =n_Nemo_Ring
 
VAR cfInitCharProc nInitCharTableDefault []
 
STATIC_VAR cfInitCharProcnInitCharTable =nInitCharTableDefault
 
VAR nFindCoeffByName_p nFindCoeffByName_Root =NULL
 

Data Structure Documentation

◆ nFindCoeffByName_s

struct nFindCoeffByName_s

Definition at line 616 of file numbers.cc.

Data Fields
n_coeffType n
nFindCoeffByName_p next
cfInitCfByNameProc p

Function Documentation

◆ 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 171 of file numbers.cc.

172{
173 BOOLEAN ret = n_IsZero(a, r);
174 int c = n_GetChar(r);
175 if (ret || (c==0) || (r->is_field))
176 return ret; /*n_IsZero(a, r)*/
177 number ch = n_Init( c, r );
178 number g = n_Gcd( ch, a, r );
179 ret = !n_IsOne (g, r);
180 n_Delete(&ch, r);
181 n_Delete(&g, r);
182 return ret;
183}
int BOOLEAN
Definition auxiliary.h:88
g
Definition cfModGcd.cc:4098
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:665
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition coeffs.h:468
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition coeffs.h:448
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:459
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:539
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition coeffs.h:472

◆ n_Print()

void n_Print ( number & a,
const coeffs r )

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

Definition at line 655 of file numbers.cc.

657{
658 assume(r != NULL);
659 n_Test(a,r);
660
661 StringSetS("");
662 n_Write(a, r);
663 { char* s = StringEndS(); Print("%s", s); omFree(s); }
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition coeffs.h:713
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition coeffs.h:592
#define Print
Definition emacs.cc:80
const CanonicalForm int s
Definition facAbsFact.cc:51
#define assume(x)
Definition mod2.h:389
#define omFree(addr)
#define NULL
Definition omList.c:12
void StringSetS(const char *st)
Definition reporter.cc:128
char * StringEndS()
Definition reporter.cc:151

◆ nd_Copy()

number nd_Copy ( number a,
const coeffs r )

Definition at line 301 of file numbers.cc.

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

◆ ndAnn()

static number ndAnn ( number ,
const coeffs cf )
static

Definition at line 46 of file numbers.cc.

46{ WarnS("cfAnn undefined"); return n_Init(0,cf); }
CanonicalForm cf
Definition cfModGcd.cc:4091
#define WarnS
Definition emacs.cc:78

◆ ndChineseRemainder()

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

Definition at line 145 of file numbers.cc.

146{
147 Werror("ChineseRemainder not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
148 return r->cfInit(0,r);
149}
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:429
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 206 of file numbers.cc.

207{
208 assume(r != NULL);
209
210 // no fractions
211 assume(!( nCoeff_is_Q(r) ));
212 // all coeffs are given by integers!!!
213
214 numberCollectionEnumerator.Reset();
215
216 if( !numberCollectionEnumerator.MoveNext() ) // empty zero polynomial?
217 {
218 c = n_Init(1, r);
219 return;
220 }
221
222 number &curr = numberCollectionEnumerator.Current();
223
224 /// TODO: move to a separate implementation
225 if (nCoeff_is_Ring(r))
226 {
227 if (nCoeff_has_Units(r))
228 {
229 c = n_GetUnit(curr, r);
230
231 if (!n_IsOne(c, r))
232 {
233 number inv = n_Invers(c, r);
234
235 n_InpMult(curr, inv, r);
236
237 while( numberCollectionEnumerator.MoveNext() )
238 {
239 number &n = numberCollectionEnumerator.Current();
240 n_Normalize(n, r); // ?
241 n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
242 }
243
244 n_Delete(&inv, r);
245 }
246 } else c = n_Init(1, r);
247
248 return;
249 }
250
253
254 n_Normalize(curr, r); // Q: good/bad/ugly??
255
256 if (!n_IsOne(curr, r))
257 {
258 number t = curr; // takes over the curr! note: not a reference!!!
259
260 curr = n_Init(1, r); // ???
261
262 number inv = n_Invers(t, r);
263
264 while( numberCollectionEnumerator.MoveNext() )
265 {
266 number &n = numberCollectionEnumerator.Current();
267 n_InpMult(n, inv, r); // TODO: either this or directly divide!!!?
268// n_Normalize(n, r); // ?
269 }
270
271 n_Delete(&inv, r);
272
273 c = t;
274 } else
275 c = n_Copy(curr, r); // c == 1 and nothing else to do...
276}
virtual reference Current()=0
Gets the current element in the collection (read and write).
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:455
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:790
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition coeffs.h:832
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:565
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition coeffs.h:825
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition coeffs.h:852
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition coeffs.h:799
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:535
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition coeffs.h:730
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition coeffs.h:793
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:642
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition coeffs.h:579
static FORCE_INLINE BOOLEAN nCoeff_is_Q_algExt(const coeffs r)
is it an alg. ext. of Q?
Definition coeffs.h:907

◆ ndClearDenominators()

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

Definition at line 278 of file numbers.cc.

279{
280 assume( r != NULL );
283
284 d = n_Init(1, r);
285}
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition coeffs.h:903
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition coeffs.h:911

◆ ndCoeffIsEqual()

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

Definition at line 344 of file numbers.cc.

346{
347 /* test, if r is an instance of nInitCoeffs(n,parameter) */
348 return (n==r->type) &&(r->data==d);

◆ ndCoeffName()

static char * ndCoeffName ( const coeffs r)
static

Definition at line 55 of file numbers.cc.

56{
57 STATIC_VAR char s[20];
58 snprintf(s,11,"Coeffs(%d)",r->type);
59 return s;
60}
#define STATIC_VAR
Definition globaldefs.h:7

◆ ndCoeffString()

static char * ndCoeffString ( const coeffs r)
static

Definition at line 47 of file numbers.cc.

48{
49 return omStrDup(r->cfCoeffName(r));
50}
#define omStrDup(s)

◆ ndCoeffWrite()

static void ndCoeffWrite ( const coeffs r,
BOOLEAN  )
static

Definition at line 51 of file numbers.cc.

52{
53 PrintS(r->cfCoeffName(r));
54}
void PrintS(const char *s)
Definition reporter.cc:284

◆ ndConvFactoryNSingN()

static number ndConvFactoryNSingN ( const CanonicalForm ,
const coeffs r )
static

[in, out] a bigint number >= 0

[out] the GMP equivalent

Definition at line 314 of file numbers.cc.

◆ ndConvSingNFactoryN()

CanonicalForm ndConvSingNFactoryN ( number ,
BOOLEAN ,
const coeffs  )

Definition at line 307 of file numbers.cc.

308{
310 WerrorS("no conversion to factory");
311 return term;
312}
factory's main class
void WerrorS(const char *s)
Definition feFopen.cc:24

◆ ndCopy()

static number ndCopy ( number a,
const coeffs  )
static

Definition at line 300 of file numbers.cc.

300{ return a; }

◆ ndCopyMap()

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

Definition at line 287 of file numbers.cc.

288{
289 // aRing and r need not be the same, but must be the same representation
290 assume(aRing->rep==r->rep);
292 return a;
293 else
294 return r->cfCopy(a, r);
295}
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete is empty operation.
Definition coeffs.h:899

◆ ndDBTest()

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

Definition at line 132 of file numbers.cc.

132{ return TRUE; }
#define TRUE
Definition auxiliary.h:101

◆ ndDelete()

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

Definition at line 45 of file numbers.cc.

45{ *d=NULL; }

◆ ndDivBy()

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

Definition at line 303 of file numbers.cc.

303{ return TRUE; } // assume a,b !=0

◆ ndDivComp()

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

Definition at line 304 of file numbers.cc.

304{ return 2; }

◆ ndEucNorm()

static number ndEucNorm ( number a,
const coeffs cf )
static

Definition at line 128 of file numbers.cc.

129{ return cf->cfInit(cf->cfSize(a,cf),cf); }

◆ ndExtGcd()

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

Definition at line 305 of file numbers.cc.

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

◆ ndFarey()

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

Definition at line 135 of file numbers.cc.

136{
137 Werror("farey not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
138 return n_Init(0,r);
139}

◆ ndGcd()

number ndGcd ( number a,
number b,
const coeffs r )

Definition at line 187 of file numbers.cc.

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

◆ ndGetDenom()

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

Definition at line 202 of file numbers.cc.

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

◆ ndGetNumerator()

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

Definition at line 203 of file numbers.cc.

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

◆ ndGetUnit_Ring()

static number ndGetUnit_Ring ( number ,
const coeffs r )
static

Definition at line 124 of file numbers.cc.

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

◆ ndInitMPZ()

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

Definition at line 327 of file numbers.cc.

329{
330 return r->cfInit( mpz_get_si(m), r);
int m
Definition cfEzgcd.cc:128

◆ ndInpAdd()

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

Definition at line 67 of file numbers.cc.

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

◆ ndInpMult()

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

Definition at line 61 of file numbers.cc.

62{
63 number n=r->cfMult(a,b,r);
64 r->cfDelete(&a,r);
65 a=n;
66}

◆ ndIntMod()

static number ndIntMod ( number a,
number b,
const coeffs R )
static

Definition at line 188 of file numbers.cc.

189{
190 if (R->is_field)
191 return R->cfInit(0,R);
192 else // implementation for a non-field:
193 {
194 number d=n_Div(a,b,R);
195 number p=n_Mult(b,d,R);
196 number r=n_Sub(a,p,R);
197 n_Delete(&p,R);
198 n_Delete(&d,R);
199 return r;
200 }
201}
int p
Definition cfModGcd.cc:4086
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:637
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:616
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:656
#define R
Definition sirandom.c:27

◆ ndInvers()

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

Definition at line 104 of file numbers.cc.

105{
106 number one=r->cfInit(1,r);
107 number res=r->cfDiv(one,a,r);
108 r->cfDelete(&one,r);
109 return res;
110}
CanonicalForm res
Definition facAbsFact.cc:60

◆ ndInvers_Ring()

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

Definition at line 111 of file numbers.cc.

112{
113 if (!r->cfIsUnit(a,r)) Print("ndInvers_Ring used with non-unit\n");
114 number one=r->cfInit(1,r);
115 number res=r->cfDiv(one,a,r);
116 r->cfDelete(&one,r);
117 return res;
118}

◆ ndIsUnit_Field()

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

Definition at line 122 of file numbers.cc.

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

◆ ndIsUnit_Ring()

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

Definition at line 120 of file numbers.cc.

121{ return r->cfIsOne(a,r)|| r->cfIsMOne(a,r); }

◆ ndKillChar()

static void ndKillChar ( coeffs )
static

Definition at line 297 of file numbers.cc.

297{}

◆ 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 322 of file numbers.cc.

324{
325 mpz_init_set_si( result, r->cfInt(n, r) );
return result

◆ ndNormalize()

void ndNormalize ( number & ,
const coeffs  )

Definition at line 185 of file numbers.cc.

185{ }

◆ ndParameter()

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

Definition at line 166 of file numbers.cc.

167{
168 return r->cfInit(1,r);
169}

◆ ndParDeg()

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

Definition at line 161 of file numbers.cc.

162{
163 return (-r->cfIsZero(n,r));
164}

◆ ndPower()

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

Definition at line 74 of file numbers.cc.

75{
76 if (i==0)
77 {
78 *res = r->cfInit(1, r);
79 }
80 else if (i==1)
81 {
82 *res = r->cfCopy(a, r);
83 }
84 else if (i==2)
85 {
86 *res = r->cfMult(a, a, r);
87 }
88 else if (i<0)
89 {
90 number b = r->cfInvers(a, r);
91 ndPower(b, -i, res, r);
92 r->cfDelete(&b, r);
93 }
94 else
95 {
96 ndPower(a, i/2, res, r);
97 r->cfInpMult(*res, *res, r);
98 if (i&1)
99 {
100 r->cfInpMult(*res, a, r);
101 }
102 }
103}
int i
Definition cfEzgcd.cc:132
static void ndPower(number a, int i, number *res, const coeffs r)
Definition numbers.cc:74

◆ ndQuotRem()

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

Definition at line 350 of file numbers.cc.

352{
353 // implementation for a field: r: 0, result: n_Div
354 if(R->is_field)
355 {
356 *r=n_Init(0,R);
357 return n_Div(a,b,R);
358 }
359 else
360 // implementation for a non-field:
361 {
362 number d=n_Div(a,b,R);
363 number p=n_Mult(b,d,R);
364 *r=n_Sub(a,p,R);
365 n_Delete(&p,R);
366 return d;
367 }

◆ ndRandom()

static number ndRandom ( siRandProc p,
number ,
number ,
const coeffs cf )
static

Definition at line 126 of file numbers.cc.

127{ return cf->cfInit(p(),cf); }

◆ ndRead()

static const char * ndRead ( const char * s,
number * n,
const coeffs r )
static

Definition at line 332 of file numbers.cc.

334{
335 *n=n_Init(1,r);
336 return s;

◆ ndReadFd()

number ndReadFd ( const ssiInfo * f,
const coeffs r )

Definition at line 150 of file numbers.cc.

151{
152 Warn("ReadFd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
153 return n_Init(0,r);
154}
#define Warn
Definition emacs.cc:77

◆ ndReturn0()

static number ndReturn0 ( number ,
const coeffs r )
static

Definition at line 186 of file numbers.cc.

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

◆ ndSetChar()

static void ndSetChar ( const coeffs )
static

Definition at line 298 of file numbers.cc.

298{}

◆ ndSetMap()

static nMapFunc ndSetMap ( const coeffs src,
const coeffs dst )
static

Definition at line 337 of file numbers.cc.

339{
340 if (src==dst) return ndCopyMap;
341 Werror("cfSetMap is undefined for %s",nCoeffString(dst));
342 return ndCopyMap;
number ndCopyMap(number a, const coeffs src, const coeffs dst)
Definition numbers.cc:287
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:956

◆ ndSize()

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

Definition at line 204 of file numbers.cc.

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

◆ ndWriteFd()

static void ndWriteFd ( number ,
const ssiInfo * ,
const coeffs r )
static

Definition at line 156 of file numbers.cc.

157{
158 Warn("WriteFd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
159}

◆ ndXExtGcd()

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

Definition at line 140 of file numbers.cc.

141{
142 Werror("XExtGcd not implemented for %s (c=%d)",r->cfCoeffName(r),getCoeffType(r));
143 return n_Init(0,r);
144}

◆ nEati() [1/2]

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 665 of file numbers.cc.

667{
668
669 if (((*s) >= '0') && ((*s) <= '9'))
670 {
671 unsigned long ii=0L;
672 do
673 {
674 ii *= 10;
675 ii += *s++ - '0';
676 if ((m!=0) && (ii > (MAX_INT_VAL / 10))) ii = ii % m;
677 }
678 while (((*s) >= '0') && ((*s) <= '9'));
679 if ((m!=0) && (ii>=(unsigned)m)) ii=ii%m;
680 *i=(int)ii;
681 }
682 else (*i) = 1;
683 return s;
const int MAX_INT_VAL
Definition mylimits.h:12

◆ nEati() [2/2]

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

Definition at line 685 of file numbers.cc.

687{
688
689 if (((*s) >= '0') && ((*s) <= '9'))
690 {
691 unsigned long ii=0L;
692 do
693 {
694 ii *= 10;
695 ii += *s++ - '0';
696 if ((m!=0) && (ii > (LONG_MAX / 10))) ii = ii % m;
697 }
698 while (((*s) >= '0') && ((*s) <= '9'));
699 if ((m!=0) && (ii>=(unsigned long)m)) ii=ii%(unsigned long)m;
700 *i=ii;
701 }
702 else (*i) = 1L;
703 return s;

◆ nEatLong()

char * nEatLong ( char * s,
mpz_ptr i )

extracts a long integer from s, returns the rest

Definition at line 706 of file numbers.cc.

708{
709 const char * start=s;
710
711 while (*s >= '0' && *s <= '9') s++;
712 if (*s=='\0')
713 {
714 mpz_set_str(i,start,10);
715 }
716 else
717 {
718 char c=*s;
719 *s='\0';
720 mpz_set_str(i,start,10);
721 *s=c;
722 }
723 return s;

◆ nFindCoeffByName()

coeffs nFindCoeffByName ( char * cf_name)

find an existing coeff by its "CoeffName"

Definition at line 633 of file numbers.cc.

635{
637 // try existings coeffs:
638 while(n!=NULL)
639 {
640 if ((n->cfCoeffName!=NULL)
641 && (strcmp(cf_name,n->cfCoeffName(n))==0)) return n;
642 n=n->next;
643 }
644 // TODO: parametrized cf, e.g. flint:Z/26[a]
645 // try existing types:
646 nFindCoeffByName_p p=nFindCoeffByName_Root;
647 while(p!=NULL)
648 {
649 coeffs cf=p->p(cf_name,p->n);
650 if (cf!=NULL) return cf;
651 p=p->next;
652 }
653 return NULL;
coeffs next
Definition coeffs.h:132
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitute cfCoeffWrite, cfCoeffString
Definition coeffs.h:161
The main handler for Singular numbers which are suitable for Singular polynomials.
VAR nFindCoeffByName_p nFindCoeffByName_Root
Definition numbers.cc:623
VAR n_Procs_s * cf_root
Definition numbers.cc:43

◆ nInitChar()

coeffs nInitChar ( n_coeffType t,
void * parameter )

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

Definition at line 406 of file numbers.cc.

408{
410
411 while((n!=NULL) && (n->nCoeffIsEqual!=NULL) && (!n->nCoeffIsEqual(n,t,parameter)))
412 n=n->next;
413
414 if (n==NULL)
415 {
416 n=(n_Procs_s*)omAlloc0(sizeof(n_Procs_s));
417 n->next=cf_root;
418 n->ref=1;
419 n->type=t;
420
421 // default entries (different from NULL) for some routines:
423 n->cfSize = ndSize;
427 n->cfDelete= ndDelete;
428 n->cfAnn = ndAnn;
431 n->cfCoeffName = ndCoeffName; // should always be changed!
434 n->cfCopy = ndCopy;
435 n->cfIntMod=ndIntMod; /* dummy !! */
437 n->cfGcd = ndGcd;
438 n->cfNormalizeHelper = ndGcd; /* tricky, isn't it ?*/
439 n->cfLcm = ndGcd; /* tricky, isn't it ?*/
440 n->cfInitMPZ = ndInitMPZ;
441 n->cfMPZ = ndMPZ;
442 n->cfPower = ndPower;
443 n->cfQuotRem = ndQuotRem;
444 n->cfInvers = ndInvers;
445 n->cfRandom = ndRandom;
446
447 n->cfKillChar = ndKillChar; /* dummy */
448 n->cfSetChar = ndSetChar; /* dummy */
449 // temp. removed to catch all the coeffs which miss to implement this!
450
451 n->cfChineseRemainder = ndChineseRemainder; /* not implemented */
452 n->cfFarey = ndFarey; /* not implemented */
453 n->cfParDeg = ndParDeg; /* not implemented */
454 n->cfReadFd = ndReadFd; /* not implemented */
455 n->cfWriteFd = ndWriteFd; /* not implemented */
456
458
461
462 n->cfEucNorm = ndEucNorm;
463 n->cfDivComp = ndDivComp;
464 n->cfDivBy = ndDivBy;
465 n->cfExtGcd = ndExtGcd;
466 n->cfXExtGcd = ndXExtGcd;
467 //n->cfGetUnit = ndGetUnit_Ring;// set afterwards
468
469 // report error, if not redefined
470 n->cfRead=ndRead;
472
473#ifdef LDEBUG
475#endif
476
479
480 BOOLEAN nOK=TRUE;
481 // init
482 if ((t<=nLastCoeffs) && (nInitCharTable[t]!=NULL))
483 nOK = (nInitCharTable[t])(n,parameter);
484 else
485 Werror("Sorry: the coeff type [%d] was not registered: it is missing in nInitCharTable", (int)t);
486 if (nOK)
487 {
488 omFreeSize(n,sizeof(*n));
489 return NULL;
490 }
491 cf_root=n;
492 // post init settings:
493 if (n->cfRePart==NULL) n->cfRePart=n->cfCopy;
494 if (n->cfExactDiv==NULL) n->cfExactDiv=n->cfDiv;
495 if (n->cfSubringGcd==NULL) n->cfSubringGcd=n->cfGcd;
496 if (n->cfWriteShort==NULL) n->cfWriteShort = n->cfWriteLong;
497 if (n->cfIsUnit==NULL)
498 {
500 else n->cfIsUnit=ndIsUnit_Ring;
501 }
502 if (n->cfGetUnit==NULL)
503 {
504 if (n->is_field) n->cfGetUnit=n->cfCopy;
506 }
507 if ((n->cfInvers==ndInvers)&&(n->is_field))
508 {
510 }
511
512 if(n->cfMult==NULL) PrintS("cfMult missing\n");
513 if(n->cfSub==NULL) PrintS("cfSub missing\n");
514 if(n->cfAdd==NULL) PrintS("cfAdd missing\n");
515 if(n->cfDiv==NULL) PrintS("cfDiv missing\n");
516 if(n->cfExactDiv==NULL) PrintS("cfExactDiv missing\n");
517 if(n->cfInit==NULL) PrintS("cfInit missing\n");
518 if(n->cfInt==NULL) PrintS("cfInt missing\n");
519 if(n->cfIsUnit==NULL) PrintS("cfIsUnit missing\n");
520 if(n->cfGetUnit==NULL) PrintS("cfGetUnit missing\n");
521 if(n->cfInpNeg==NULL) PrintS("cfInpNeg missing\n");
522 if(n->cfXExtGcd==NULL) PrintS("cfXExtGcd missing\n");
523 if(n->cfAnn==NULL) PrintS("cfAnn missing\n");
524 if(n->cfWriteLong==NULL) PrintS("cfWriteLong missing\n");
525
527
528 assume( (n->iNumberOfParameters == 0 && n->pParameterNames == NULL) ||
529 (n->iNumberOfParameters > 0 && n->pParameterNames != NULL) );
530
531
532 if(n->cfGreater==NULL) PrintS("cfGreater missing\n");
533 if(n->cfEqual==NULL) PrintS("cfEqual missing\n");
534 if(n->cfIsZero==NULL) PrintS("cfIsZero missing\n");
535 if(n->cfIsOne==NULL) PrintS("cfIsOne missing\n");
536 if(n->cfIsMOne==NULL) PrintS("cfIsMOne missing\n");
537 if(n->cfGreaterZero==NULL) PrintS("cfGreaterZero missing\n");
538 /* error reporter:
539 if(n->cfRead==ndRead) PrintS("cfRead missing\n");
540 if(n->cfSetMap==ndSetMap) PrintS("cfSetMap missing\n");
541 */
542
543 assume(n->type==t);
544
545#ifndef SING_NDEBUG
546 if(n->cfWriteLong==NULL) Warn("cfWrite is NULL for coeff %d",t);
547 if(n->cfWriteShort==NULL) Warn("cfWriteShort is NULL for coeff %d",t);
548#endif
549 }
550 else
551 {
552 n->ref++;
553 }
554 return n;
CanonicalForm(* convSingNFactoryN)(number n, BOOLEAN setChar, const coeffs r)
Definition coeffs.h:323
number(* cfInitMPZ)(mpz_t i, const coeffs r)
init with a GMP integer
Definition coeffs.h:188
number(* cfImPart)(number a, const coeffs r)
Definition coeffs.h:208
char *(* cfCoeffString)(const coeffs r)
string output of coeff description
Definition coeffs.h:158
number(* cfLcm)(number a, number b, const coeffs r)
Definition coeffs.h:277
int iNumberOfParameters
Number of Parameters in the coeffs (default 0)
Definition coeffs.h:326
number(* cfSubringGcd)(number a, number b, const coeffs r)
Definition coeffs.h:254
BOOLEAN(* cfIsMOne)(number a, const coeffs r)
Definition coeffs.h:239
void(* cfWriteFd)(number a, const ssiInfo *f, const coeffs r)
Definition coeffs.h:284
BOOLEAN(* cfIsZero)(number a, const coeffs r)
Definition coeffs.h:235
number(* cfInvers)(number a, const coeffs r)
return 1/a
Definition coeffs.h:204
void(* cfMPZ)(mpz_t result, number &n, const coeffs r)
Converts a (integer) number n into a GMP number, 0 if impossible.
Definition coeffs.h:197
number(* cfAnn)(number a, const coeffs r)
Definition coeffs.h:268
numberfunc cfSub
Definition coeffs.h:182
numberfunc cfDiv
Definition coeffs.h:182
number(* cfQuotRem)(number a, number b, number *rem, const coeffs r)
Definition coeffs.h:276
number(* cfParameter)(const int i, const coeffs r)
create i^th parameter or NULL if not possible
Definition coeffs.h:310
BOOLEAN(* cfIsUnit)(number a, const coeffs r)
Definition coeffs.h:385
number(* cfNormalizeHelper)(number a, number b, const coeffs r)
Definition coeffs.h:278
number(* cfRandom)(siRandProc p, number p1, number p2, const coeffs cf)
a function returning random elements
Definition coeffs.h:313
BOOLEAN(* cfDivBy)(number a, number b, const coeffs r)
test if b divides a cfDivBy(zero,b,r) is true, if b is a zero divisor
Definition coeffs.h:389
void(* cfCoeffWrite)(const coeffs r, BOOLEAN details)
output of coeff description via Print
Definition coeffs.h:155
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:202
number(* cfGcd)(number a, number b, const coeffs r)
Definition coeffs.h:253
n_coeffType type
Definition coeffs.h:135
void(* cfSetChar)(const coeffs r)
Definition coeffs.h:168
numberfunc cfAdd
Definition coeffs.h:182
nCoeffsEnumeratorFunc cfClearContent
function pointer behind n_ClearContent
Definition coeffs.h:316
int(* cfDivComp)(number a, number b, const coeffs r)
Definition coeffs.h:384
number(* cfReadFd)(const ssiInfo *f, const coeffs r)
Definition coeffs.h:285
const char *(* cfRead)(const char *s, number *a, const coeffs r)
Definition coeffs.h:228
number(* convFactoryNSingN)(const CanonicalForm n, const coeffs r)
conversion to CanonicalForm(factory) to number
Definition coeffs.h:322
BOOLEAN(* cfEqual)(number a, number b, const coeffs r)
tests
Definition coeffs.h:234
void(* cfWriteLong)(number a, const coeffs r)
print a given number (long format)
Definition coeffs.h:211
void(* cfDelete)(number *a, const coeffs r)
Definition coeffs.h:279
BOOLEAN(* nCoeffIsEqual)(const coeffs r, n_coeffType n, void *parameter)
Definition coeffs.h:152
nCoeffsEnumeratorFunc cfClearDenominators
function pointer behind n_ClearDenominators
Definition coeffs.h:319
numberfunc cfExactDiv
Definition coeffs.h:182
char const ** pParameterNames
array containing the names of Parameters (default NULL)
Definition coeffs.h:329
number(* cfEucNorm)(number a, const coeffs r)
Definition coeffs.h:265
BOOLEAN(* cfGreaterZero)(number a, const coeffs r)
Definition coeffs.h:244
void(* cfInpAdd)(number &a, number b, const coeffs r)
Inplace: a += b.
Definition coeffs.h:291
number(* cfExtGcd)(number a, number b, number *s, number *t, const coeffs r)
Definition coeffs.h:255
number(* cfFarey)(number p, number n, const coeffs)
rational reconstruction: "best" rational a/b with a/b = p mod n
Definition coeffs.h:298
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:215
nMapFunc(* cfSetMap)(const coeffs src, const coeffs dst)
Definition coeffs.h:282
int(* cfParDeg)(number x, const coeffs r)
degree for coefficients: -1 for 0, 0 for "constants", ...
Definition coeffs.h:307
number(* cfInit)(long i, const coeffs r)
init with an integer
Definition coeffs.h:185
void(* cfInpMult)(number &a, number b, const coeffs r)
Inplace: a *= b.
Definition coeffs.h:288
void(* cfKillChar)(coeffs r)
Definition coeffs.h:166
BOOLEAN is_field
TRUE, if cf is a field.
Definition coeffs.h:147
long(* cfInt)(number &n, const coeffs r)
conversion to long, 0 if impossible
Definition coeffs.h:194
void(* cfPower)(number a, int i, number *result, const coeffs r)
Definition coeffs.h:246
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:304
BOOLEAN(* cfGreater)(number a, number b, const coeffs r)
Definition coeffs.h:232
BOOLEAN(* cfDBTest)(number a, const char *f, const int l, const coeffs r)
Test: is "a" a correct number?
Definition coeffs.h:423
number(* cfRePart)(number a, const coeffs r)
Definition coeffs.h:207
int ref
Definition coeffs.h:133
numberfunc cfMult
Definition coeffs.h:182
number(* cfGetUnit)(number a, const coeffs r)
Definition coeffs.h:386
number(* cfCopy)(number a, const coeffs r)
return a copy of a
Definition coeffs.h:206
void(* cfNormalize)(number &a, const coeffs r)
Definition coeffs.h:230
numberfunc cfIntMod
Definition coeffs.h:182
number(* cfGetDenom)(number &n, const coeffs r)
Definition coeffs.h:247
BOOLEAN(* cfIsOne)(number a, const coeffs r)
Definition coeffs.h:236
number(* cfXExtGcd)(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
Definition coeffs.h:263
number(* cfGetNumerator)(number &n, const coeffs r)
Definition coeffs.h:248
int(* cfSize)(number n, const coeffs r)
how complicated, (0) => 0, or positive
Definition coeffs.h:191
static BOOLEAN ndIsUnit_Field(number a, const coeffs r)
Definition numbers.cc:122
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
Definition numbers.cc:307
number ndReadFd(const ssiInfo *, const coeffs r)
Definition numbers.cc:150
static int ndDivComp(number, number, const coeffs)
Definition numbers.cc:304
static number ndEucNorm(number a, const coeffs cf)
Definition numbers.cc:128
static number ndGetUnit_Ring(number, const coeffs r)
Definition numbers.cc:124
static BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void *d)
Definition numbers.cc:344
static BOOLEAN ndDBTest(number, const char *, const int, const coeffs)
Definition numbers.cc:132
number ndGcd(number, number, const coeffs r)
Definition numbers.cc:187
static void ndKillChar(coeffs)
Definition numbers.cc:297
static void ndClearDenominators(ICoeffsEnumerator &, number &d, const coeffs r)
Definition numbers.cc:278
static void ndClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Definition numbers.cc:206
static int ndParDeg(number n, const coeffs r)
Definition numbers.cc:161
static BOOLEAN ndIsUnit_Ring(number a, const coeffs r)
Definition numbers.cc:120
void ndNormalize(number &, const coeffs)
Definition numbers.cc:185
static int ndSize(number a, const coeffs r)
Definition numbers.cc:204
static number ndFarey(number, number, const coeffs r)
Definition numbers.cc:135
static number ndRandom(siRandProc p, number, number, const coeffs cf)
Definition numbers.cc:126
static void ndMPZ(mpz_t result, number &n, const coeffs r)
Converts a non-negative bigint number into a GMP number.
Definition numbers.cc:322
STATIC_VAR n_coeffType nLastCoeffs
Definition numbers.cc:368
static number ndGetDenom(number &, const coeffs r)
Definition numbers.cc:202
static void ndDelete(number *d, const coeffs)
Definition numbers.cc:45
STATIC_VAR cfInitCharProc * nInitCharTable
Definition numbers.cc:402
static number ndInvers_Ring(number a, const coeffs r)
Definition numbers.cc:111
static number ndParameter(const int, const coeffs r)
Definition numbers.cc:166
static number ndCopy(number a, const coeffs)
Definition numbers.cc:300
static void ndInpMult(number &a, number b, const coeffs r)
Definition numbers.cc:61
static void ndWriteFd(number, const ssiInfo *, const coeffs r)
Definition numbers.cc:156
static number ndChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs r)
Definition numbers.cc:145
static char * ndCoeffString(const coeffs r)
Definition numbers.cc:47
static number ndGetNumerator(number &a, const coeffs r)
Definition numbers.cc:203
static BOOLEAN ndDivBy(number, number, const coeffs)
Definition numbers.cc:303
static number ndInitMPZ(mpz_t m, const coeffs r)
Definition numbers.cc:327
static void ndInpAdd(number &a, number b, const coeffs r)
Definition numbers.cc:67
static nMapFunc ndSetMap(const coeffs src, const coeffs dst)
Definition numbers.cc:337
static number ndAnn(number, const coeffs cf)
Definition numbers.cc:46
static number ndInvers(number a, const coeffs r)
Definition numbers.cc:104
static number ndIntMod(number a, number b, const coeffs R)
Definition numbers.cc:188
static void ndCoeffWrite(const coeffs r, BOOLEAN)
Definition numbers.cc:51
static number ndConvFactoryNSingN(const CanonicalForm, const coeffs r)
[in, out] a bigint number >= 0
Definition numbers.cc:314
static number ndReturn0(number, const coeffs r)
Definition numbers.cc:186
static number ndExtGcd(number, number, number *, number *, const coeffs r)
Definition numbers.cc:305
static const char * ndRead(const char *s, number *n, const coeffs r)
Definition numbers.cc:332
static char * ndCoeffName(const coeffs r)
Definition numbers.cc:55
static void ndSetChar(const coeffs)
Definition numbers.cc:298
static number ndXExtGcd(number, number, number *, number *, number *, number *, const coeffs r)
Definition numbers.cc:140
number ndQuotRem(number a, number b, number *r, const coeffs R)
Definition numbers.cc:350
#define omFreeSize(addr, size)
#define omAlloc0(size)

◆ nKillChar()

void nKillChar ( coeffs r)

undo all initialisations

Definition at line 556 of file numbers.cc.

558{
559 if (r!=NULL)
560 {
561 r->ref--;
562 if (r->ref<=0)
563 {
564 n_Procs_s tmp;
565 n_Procs_s* n=&tmp;
566 tmp.next=cf_root;
567 while((n->next!=NULL) && (n->next!=r)) n=n->next;
568 if (n->next==r)
569 {
570 n->next=n->next->next;
571 if (cf_root==r) cf_root=n->next;
572 assume (r->cfKillChar!=NULL); r->cfKillChar(r);
573 omFreeSize((void *)r, sizeof(n_Procs_s));
574 r=NULL;
575 }
576 else
577 {
578 WarnS("cf_root list destroyed");
579 }
580 }
581 }

◆ nRegister()

n_coeffType nRegister ( n_coeffType n,
cfInitCharProc p )

Definition at line 583 of file numbers.cc.

585{
586 if (n==n_unknown)
587 {
590 {
592 ((int)nLastCoeffs+1)*sizeof(cfInitCharProc));
594 ((int)nLastCoeffs)*sizeof(cfInitCharProc));
595 }
596 else
597 {
599 ((int)nLastCoeffs)*sizeof(cfInitCharProc),
600 (((int)nLastCoeffs)+1)*sizeof(cfInitCharProc));
601 }
602
604 return nLastCoeffs;
605 }
606 else
607 {
608 //if (nInitCharTable[n]!=NULL) Print("coeff %d already initialized\n",n);
609 nInitCharTable[n]=p;
610 return n;
611 }
n_coeffType
Definition coeffs.h:27
@ n_unknown
Definition coeffs.h:28
VAR cfInitCharProc nInitCharTableDefault[]
Definition numbers.cc:369
BOOLEAN(* cfInitCharProc)(coeffs, void *)
initialize an object of type coeff, return FALSE in case of success
Definition numbers.h:95
#define omReallocSize(addr, o_size, size)

◆ nRegisterCfByName()

void nRegisterCfByName ( cfInitCfByNameProc p,
n_coeffType n )

Definition at line 624 of file numbers.cc.

626{
627 nFindCoeffByName_p h=(nFindCoeffByName_p)omAlloc0(sizeof(*h));
628 h->p=p;
629 h->n=n;
STATIC_VAR Poly * h
Definition janet.cc:971

Variable Documentation

◆ cf_root

VAR n_Procs_s* cf_root =NULL

Definition at line 43 of file numbers.cc.

◆ nFindCoeffByName_Root

VAR nFindCoeffByName_p nFindCoeffByName_Root =NULL

Definition at line 623 of file numbers.cc.

◆ nInitCharTable

Definition at line 402 of file numbers.cc.

◆ nInitCharTableDefault

VAR cfInitCharProc nInitCharTableDefault[]

Definition at line 369 of file numbers.cc.

371{ NULL, /*n_unknown */
372 npInitChar, /* n_Zp */
373 nlInitChar, /* n_Q */
374 nrInitChar, /* n_R */
375 nfInitChar, /* n_GF */
376 ngfInitChar, /* n_long_R */
377 #ifdef HAVE_POLYEXTENSIONS
378 n2pInitChar, /* n_polyExt */
379 naInitChar, /* n_algExt */
380 ntInitChar, /* n_transExt */
381 #else
382 NULL, /* n_polyExt */
383 NULL, /* n_algExt */
384 NULL, /* n_transExt */
385 #endif
386 ngcInitChar, /* n_long_C */
387 nnInitChar, /* n_nTupel */
388 nrzInitChar, /* n_Z */
389 nrnInitChar, /* n_Zn */
390 nrnInitChar, /* n_Znm */
391 nr2mInitChar, /* n_Z2m */
392 flintQrat_InitChar, /* n_FlintQrat */
393 NULL, /* n_CF */
394 NULL, /* n_Nemo_AnticNumberField */
395 NULL, /* n_Nemo_QQField */
396 NULL, /* n_Nemo_ZZRing */
397 NULL, /* n_Nemo_FqPolyRepField */
398 NULL, /* n_Nemo_fqPolyRepField */
399 NULL, /* n_Nemo_Field */
400 NULL /* n_Nemo_Ring */
BOOLEAN naInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition algext.cc:1386
BOOLEAN n2pInitChar(coeffs cf, void *infoStruct)
Definition algext.cc:1640
BOOLEAN nfInitChar(coeffs r, void *parameter)
Definition ffields.cc:855
BOOLEAN flintQrat_InitChar(coeffs cf, void *infoStruct)
BOOLEAN ngcInitChar(coeffs n, void *parameter)
Initialize r (n_long_C)
Definition gnumpc.cc:560
BOOLEAN ngfInitChar(coeffs n, void *parameter)
Initialize r.
Definition gnumpfl.cc:511
BOOLEAN nlInitChar(coeffs r, void *p)
Definition longrat.cc:3463
BOOLEAN npInitChar(coeffs r, void *p)
Definition modulop.cc:338
BOOLEAN nnInitChar(coeffs n, void *p)
Initialize r.
Definition ntupel.cc:616
BOOLEAN nrzInitChar(coeffs r, void *parameter)
BOOLEAN nr2mInitChar(coeffs r, void *p)
Definition rmodulo2m.cc:797
BOOLEAN nrnInitChar(coeffs r, void *p)
Definition rmodulon.cc:991
BOOLEAN nrInitChar(coeffs n, void *p)
Initialize r.
Definition shortfl.cc:658
BOOLEAN ntInitChar(coeffs cf, void *infoStruct)
Initialize the coeffs object.
Definition transext.cc:2636

◆ nLastCoeffs

Definition at line 368 of file numbers.cc.