My Project
Loading...
Searching...
No Matches
generics.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/*
5* ABSTRACT: numbers (integers)
6*/
7
8#include "misc/auxiliary.h"
9
10#include "factory/factory.h"
11
12#include "misc/mylimits.h"
13#include "reporter/reporter.h"
14
15#include "coeffs/coeffs.h"
16#include "coeffs/longrat.h"
17#include "coeffs/numbers.h"
18
19#include "coeffs/si_gmp.h"
20
21#include "coeffs/generics.h"
22
23#include "coeffs/rintegers.h"
24
25#include <string.h>
26
28{
29 number a1;
30 number a2;
31};
32typedef struct generic_pair *gcp;
34
35static void gCoeffWrite(const coeffs r, BOOLEAN b)
36{
37 printf("debug: ");
38 coeffs1->cfCoeffWrite(coeffs1,b);
39}
40
41static char* gCoeffName(const coeffs r)
42{
43 return coeffs1->cfCoeffName(coeffs1);
44}
45static void gKillChar(coeffs r)
46{
47 coeffs1->cfKillChar(coeffs1);
48 coeffs2->cfKillChar(coeffs2);
49}
50static void gSetChar(coeffs r)
51{
52 coeffs1->cfSetChar(coeffs1);
53 coeffs2->cfSetChar(coeffs2);
54}
55
56static number gMult (number a, number b, const coeffs cf)
57{
58 gcp aa=(gcp)a;
59 gcp bb=(gcp)b;
60 gcp cc=(gcp)omalloc(sizeof(*cc));
61 cc->a1=coeffs1->cfMult(aa->a1,bb->a1,coeffs1);
62 cc->a2=coeffs2->cfMult(aa->a2,bb->a2,coeffs2);
63 n_Test((number)cc,cf);
64 return (number)cc;
65}
66static number gSub (number a, number b, const coeffs cf)
67{
68 gcp aa=(gcp)a;
69 gcp bb=(gcp)b;
70 gcp cc=(gcp)omalloc(sizeof(*cc));
71 cc->a1=coeffs1->cfSub(aa->a1,bb->a1,coeffs1);
72 cc->a2=coeffs2->cfSub(aa->a2,bb->a2,coeffs2);
73 n_Test((number)cc,cf);
74 return (number)cc;
75}
76static number gAdd (number a, number b, const coeffs cf)
77{
78 gcp aa=(gcp)a;
79 gcp bb=(gcp)b;
80 gcp cc=(gcp)omalloc(sizeof(*cc));
81 cc->a1=coeffs1->cfAdd(aa->a1,bb->a1,coeffs1);
82 cc->a2=coeffs2->cfAdd(aa->a2,bb->a2,coeffs2);
83 n_Test((number)cc,cf);
84 return (number)cc;
85}
86static number gDiv (number a, number b, const coeffs cf)
87{
88 gcp aa=(gcp)a;
89 gcp bb=(gcp)b;
90 gcp cc=(gcp)omalloc(sizeof(*cc));
91 cc->a1=coeffs1->cfDiv(aa->a1,bb->a1,coeffs1);
92 cc->a2=coeffs2->cfDiv(aa->a2,bb->a2,coeffs2);
93 n_Test((number)cc,cf);
94 return (number)cc;
95}
96static number gIntMod (number a, number b, const coeffs cf)
97{
98 gcp aa=(gcp)a;
99 gcp bb=(gcp)b;
100 gcp cc=(gcp)omalloc(sizeof(*cc));
101 cc->a1=coeffs1->cfIntMod(aa->a1,bb->a1,coeffs1);
102 cc->a2=coeffs2->cfIntMod(aa->a2,bb->a2,coeffs2);
103 n_Test((number)cc,cf);
104 return (number)cc;
105}
106static number gExactDiv (number a, number b, const coeffs cf)
107{
108 gcp aa=(gcp)a;
109 gcp bb=(gcp)b;
110 gcp cc=(gcp)omalloc(sizeof(*cc));
111 cc->a1=coeffs1->cfExactDiv(aa->a1,bb->a1,coeffs1);
112 cc->a2=coeffs2->cfExactDiv(aa->a2,bb->a2,coeffs2);
113 n_Test((number)cc,cf);
114 return (number)cc;
115}
116static number gInit (long i, const coeffs cf)
117{
118 gcp cc=(gcp)omalloc(sizeof(*cc));
119 cc->a1=coeffs1->cfInit(i,coeffs1);
120 cc->a2=coeffs2->cfInit(i,coeffs2);
121 n_Test((number)cc,cf);
122 return (number)cc;
123}
124static number gInitMPZ (mpz_t i, const coeffs cf)
125{
126 gcp cc=(gcp)omalloc(sizeof(*cc));
127 cc->a1=coeffs1->cfInitMPZ(i,coeffs1);
128 cc->a2=coeffs2->cfInitMPZ(i,coeffs2);
129 n_Test((number)cc,cf);
130 return (number)cc;
131}
132static int gSize (number a, const coeffs)
133{
134 gcp aa=(gcp)a;
135 int s1=coeffs1->cfSize(aa->a1,coeffs1);
136 int s2=coeffs2->cfSize(aa->a2,coeffs2);
137 if (s1!=s2)
138 {
139 printf("gSize: %d, %d\n",s1,s2);
140 }
141 return s1;
142}
143static long gInt (number &a, const coeffs)
144{
145 gcp aa=(gcp)a;
146 long s1=coeffs1->cfInt(aa->a1,coeffs1);
147 long s2=coeffs2->cfInt(aa->a2,coeffs2);
148 if (s1!=s2)
149 {
150 printf("gInt: %ld, %ld\n",s1,s2);
151 }
152 return s1;
153}
154static void gMPZ(mpz_t result, number &n, const coeffs r)
155{
156 coeffs1->cfMPZ(result,n,coeffs1);
157 mpz_t r2;
158 coeffs2->cfMPZ(r2,n,coeffs2);
159 if(mpz_cmp(result,r2)!=0)
160 {
161 printf("gMPZ\n");
162 }
163 mpz_clear(r2);
164}
165static number gInpNeg(number a, const coeffs r)
166{
167 gcp aa=(gcp)a;
168 aa->a1=coeffs1->cfInpNeg(aa->a1,coeffs1);
169 aa->a2=coeffs2->cfInpNeg(aa->a2,coeffs2);
170 return (number)aa;
171}
172static number gInvers(number a, const coeffs r)
173{
174 gcp aa=(gcp)a;
175 gcp cc=(gcp)omalloc(sizeof(*cc));
176 cc->a1=coeffs1->cfInvers(aa->a1,coeffs1);
177 cc->a2=coeffs2->cfInvers(aa->a2,coeffs2);
178 return (number)cc;
179}
180static number gCopy(number a, const coeffs r)
181{
182 gcp aa=(gcp)a;
183 gcp cc=(gcp)omalloc(sizeof(*cc));
184 cc->a1=coeffs1->cfCopy(aa->a1,coeffs1);
185 cc->a2=coeffs2->cfCopy(aa->a2,coeffs2);
186 return (number)cc;
187}
188static number gRePart(number a, const coeffs r)
189{
190 gcp aa=(gcp)a;
191 gcp cc=(gcp)omalloc(sizeof(*cc));
192 cc->a1=coeffs1->cfRePart(aa->a1,coeffs1);
193 cc->a2=coeffs2->cfRePart(aa->a2,coeffs2);
194 return (number)cc;
195}
196static number gImPart(number a, const coeffs r)
197{
198 gcp aa=(gcp)a;
199 gcp cc=(gcp)omalloc(sizeof(*cc));
200 cc->a1=coeffs1->cfRePart(aa->a1,coeffs1);
201 cc->a2=coeffs2->cfRePart(aa->a2,coeffs2);
202 return (number)cc;
203}
204static void gWriteLong(number a, const coeffs r)
205{
206 gcp aa=(gcp)a;
207 coeffs1->cfWriteLong(aa->a1,coeffs1);
208}
209static void gWriteShort(number a, const coeffs r)
210{
211 gcp aa=(gcp)a;
212 coeffs1->cfWriteShort(aa->a1,coeffs1);
213}
214static const char *gRead(const char * s, number * a, const coeffs r)
215{
216 gcp cc=(gcp)omalloc(sizeof(*cc));
217 const char* ss=coeffs1->cfRead(s,&(cc->a1),coeffs1);
218 number tmp=coeffs2->cfInit(1,coeffs2);
219 mpz_ptr tt=(mpz_ptr)tmp;
220 coeffs1->cfMPZ(tt,cc->a1,coeffs1);
221 cc->a2=(number)tt;
222 *a=(number)cc;
223 return ss;
224}
225static void gNormalize(number &a, const coeffs r)
226{
227 gcp aa=(gcp)a;
228 coeffs1->cfNormalize(aa->a1,coeffs1);
229 coeffs2->cfNormalize(aa->a2,coeffs2);
230}
231static BOOLEAN gGreater(number a,number b, const coeffs r)
232{
233 gcp aa=(gcp)a;
234 gcp bb=(gcp)b;
235 BOOLEAN b1=coeffs1->cfGreater(aa->a1,bb->a1,coeffs1);
236 BOOLEAN b2=coeffs2->cfGreater(aa->a2,bb->a2,coeffs2);
237 if (b1!=b2)
238 {
239 printf("gGreater\n");
240 }
241 return b1;
242}
243static BOOLEAN gEqual(number a,number b, const coeffs r)
244{
245 gcp aa=(gcp)a;
246 gcp bb=(gcp)b;
247 BOOLEAN b1=coeffs1->cfEqual(aa->a1,bb->a1,coeffs1);
248 BOOLEAN b2=coeffs2->cfEqual(aa->a2,bb->a2,coeffs2);
249 if (b1!=b2)
250 {
251 printf("gEqual\n");
252 }
253 return b1;
254}
255static BOOLEAN gIsZero(number a, const coeffs r)
256{
257 if (a==NULL) return TRUE;
258 gcp aa=(gcp)a;
259 BOOLEAN b1=coeffs1->cfIsZero(aa->a1,coeffs1);
260 BOOLEAN b2=coeffs2->cfIsZero(aa->a2,coeffs2);
261 if (b1!=b2)
262 {
263 printf("gIsZero\n");
264 }
265 return b1;
266}
267static BOOLEAN gIsOne(number a, const coeffs r)
268{
269 gcp aa=(gcp)a;
270 BOOLEAN b1=coeffs1->cfIsOne(aa->a1,coeffs1);
271 BOOLEAN b2=coeffs2->cfIsOne(aa->a2,coeffs2);
272 if (b1!=b2)
273 {
274 printf("gIsOne\n");
275 }
276 return b1;
277}
278static BOOLEAN gIsMOne(number a, const coeffs r)
279{
280 gcp aa=(gcp)a;
281 BOOLEAN b1=coeffs1->cfIsMOne(aa->a1,coeffs1);
282 BOOLEAN b2=coeffs2->cfIsMOne(aa->a2,coeffs2);
283 if (b1!=b2)
284 {
285 printf("gIsMOne\n");
286 }
287 return b1;
288}
289static BOOLEAN gGreaterZero(number a, const coeffs r)
290{
291 gcp aa=(gcp)a;
292 BOOLEAN b1=coeffs1->cfGreaterZero(aa->a1,coeffs1);
293 BOOLEAN b2=coeffs2->cfGreaterZero(aa->a2,coeffs2);
294 if (b1!=b2)
295 {
296 printf("gGreaterZero\n");
297 }
298 return b1;
299}
300static void gPower(number a, int i, number * result, const coeffs r)
301{
302 gcp aa=(gcp)a;
303 gcp cc=(gcp)omalloc(sizeof(*cc));
304 coeffs1->cfPower(aa->a1,i,&cc->a1,coeffs1);
305 coeffs2->cfPower(aa->a2,i,&cc->a2,coeffs2);
306 *result=(number)cc;
307}
308static number gGcd (number a, number b, const coeffs)
309{
310 gcp aa=(gcp)a;
311 gcp bb=(gcp)b;
312 gcp cc=(gcp)omalloc(sizeof(*cc));
313 cc->a1=coeffs1->cfGcd(aa->a1,bb->a1,coeffs1);
314 cc->a2=coeffs2->cfGcd(aa->a2,bb->a2,coeffs2);
315 return (number)cc;
316}
317static number gSubringGcd (number a, number b, const coeffs)
318{
319 gcp aa=(gcp)a;
320 gcp bb=(gcp)b;
321 gcp cc=(gcp)omalloc(sizeof(*cc));
322 cc->a1=coeffs1->cfSubringGcd(aa->a1,bb->a1,coeffs1);
323 cc->a2=coeffs2->cfSubringGcd(aa->a2,bb->a2,coeffs2);
324 return (number)cc;
325}
326static number gGetDenom (number &a, const coeffs)
327{
328 gcp aa=(gcp)a;
329 gcp cc=(gcp)omalloc(sizeof(*cc));
330 cc->a1=coeffs1->cfGetDenom(aa->a1,coeffs1);
331 cc->a2=coeffs2->cfGetDenom(aa->a2,coeffs2);
332 return (number)cc;
333}
334static number gGetNumerator (number &a, const coeffs)
335{
336 gcp aa=(gcp)a;
337 gcp cc=(gcp)omalloc(sizeof(*cc));
338 cc->a1=coeffs1->cfGetNumerator(aa->a1,coeffs1);
339 cc->a2=coeffs2->cfGetNumerator(aa->a2,coeffs2);
340 return (number)cc;
341}
342static number gQuotRem(number a, number b, number *rem, const coeffs r)
343{
344 printf("gQuotRem\n");
345 return NULL;
346}
347static number gLcm(number a, number b, const coeffs r)
348{
349 gcp aa=(gcp)a;
350 gcp bb=(gcp)b;
351 gcp cc=(gcp)omalloc(sizeof(*cc));
352 cc->a1=coeffs1->cfLcm(aa->a1,bb->a1,coeffs1);
353 cc->a2=coeffs2->cfLcm(aa->a2,bb->a2,coeffs2);
354 return (number)cc;
355}
356static number gNormalizeHelper(number a, number b, const coeffs r)
357{
358 gcp aa=(gcp)a;
359 gcp bb=(gcp)b;
360 gcp cc=(gcp)omalloc(sizeof(*cc));
361 cc->a1=coeffs1->cfNormalizeHelper(aa->a1,bb->a1,coeffs1);
362 cc->a2=coeffs2->cfNormalizeHelper(aa->a2,bb->a2,coeffs2);
363 return (number)cc;
364}
365static void gDelete(number * a, const coeffs r)
366{
367 if (*a!=NULL)
368 {
369 gcp aa=(gcp)*a;
370 coeffs1->cfDelete(&aa->a1,coeffs1);
371 coeffs2->cfDelete(&aa->a2,coeffs2);
372 omFree(aa);
373 *a=NULL;
374 }
375}
376static nMapFunc gSetMap(const coeffs src, const coeffs dst)
377{
378 printf("gSetMap\n");
379 return NULL;
380}
381static void gWriteFd(number a, FILE *f, const coeffs r)
382{
383 printf("gWriteFd\n");
384}
385static number gReadFd( s_buff f, const coeffs r)
386{
387 printf("gReadFd\n");
388 return NULL;
389}
390static number gFarey(number p, number n, const coeffs)
391{
392 gcp aa=(gcp)p;
393 gcp cc=(gcp)omalloc(sizeof(*cc));
394 cc->a1=coeffs1->cfFarey(aa->a1,n,coeffs1);
395 cc->a2=coeffs2->cfFarey(aa->a2,n,coeffs2);
396 return (number)cc;
397}
398static number gChineseRemainder(number *x, number *q,int rl, BOOLEAN sym,CFArray &inv_cache,const coeffs)
399{
400 printf("gChineseREmainder\n");
401 return NULL;
402}
403static number gRandom(siRandProc p, number p1, number p2, const coeffs cf)
404{
405 printf("gRandom\n");
406 return NULL;
407}
408static BOOLEAN gDivBy (number a,number b, const coeffs)
409{
410 gcp aa=(gcp)a;
411 gcp bb=(gcp)b;
412 BOOLEAN b1=coeffs1->cfDivBy(aa->a1,bb->a1,coeffs1);
413 BOOLEAN b2=coeffs2->cfDivBy(aa->a2,bb->a2,coeffs2);
414 if (b1!=b2)
415 {
416 printf("gDivBy:%d,%d\n",b1,b2);
417 }
418 return b1;
419}
420static number gExtGcd (number a, number b, number *s, number *t, const coeffs)
421{
422 gcp aa=(gcp)a;
423 gcp bb=(gcp)b;
424 gcp cc=(gcp)omalloc(sizeof(*cc));
425 gcp ss=(gcp)omalloc(sizeof(*ss));
426 gcp tt=(gcp)omalloc(sizeof(*ss));
427 cc->a1=coeffs1->cfExtGcd(aa->a1,bb->a1,&ss->a1,&tt->a1,coeffs1);
428 cc->a2=coeffs2->cfExtGcd(aa->a2,bb->a2,&ss->a2,&tt->a2,coeffs2);
429 return (number)cc;
430}
431static number gGetUnit (number n, const coeffs r)
432{
433 gcp aa=(gcp)n;
434 gcp cc=(gcp)omalloc(sizeof(*cc));
435 cc->a1=coeffs1->cfGetUnit(aa->a1,coeffs1);
436 cc->a2=coeffs2->cfGetUnit(aa->a2,coeffs2);
437 return (number)cc;
438}
439static BOOLEAN gIsUnit (number a, const coeffs)
440{
441 gcp aa=(gcp)a;
442 BOOLEAN b1=coeffs1->cfIsUnit(aa->a1,coeffs1);
443 BOOLEAN b2=coeffs2->cfIsUnit(aa->a2,coeffs2);
444 if (b1!=b2)
445 {
446 printf("gIsUnit:%d,%d\n",b1,b2);
447 }
448 return b1;
449}
450static int gDivComp(number a, number b, const coeffs r)
451{
452 gcp aa=(gcp)a;
453 gcp bb=(gcp)b;
454 int i1=coeffs1->cfDivComp(aa->a1,bb->a1,coeffs1);
455 int i2=coeffs2->cfDivComp(aa->a2,bb->a2,coeffs2);
456 if (i1!=i2)
457 {
458 printf("gDivComp:%d,%d\n",i1,i2);
459 }
460 return i1;
461}
462static BOOLEAN gDBTest(number a, const char *f, const int l, const coeffs r)
463{
464 if (a==NULL)
465 printf("NULL in %s:%d\n",f,l);
466 return TRUE;
467}
469{
470 coeffs1=nInitChar(n_Z_1,(void*)1);
471 coeffs2=nInitChar(n_Z_2,(void*)1);
472 r->is_field=FALSE;
473 r->is_domain=TRUE;
474 r->rep=n_rep_unknown;
475 r->ch = 0;
476 r->cfKillChar=gKillChar;
477 //r->nCoeffIsEqual=gCoeffsEqual;
478 r->cfCoeffName=gCoeffName;
479 r->cfCoeffWrite=gCoeffWrite;
480
481 r->cfMult = gMult;
482 r->cfSub = gSub;
483 r->cfAdd = gAdd;
484 r->cfDiv = gDiv;
485 r->cfInit = gInit;
486 r->cfSize = gSize;
487 r->cfInt = gInt;
488 #ifdef HAVE_RINGS
489 r->cfDivComp = gDivComp;
490 r->cfIsUnit = gIsUnit;
491 r->cfGetUnit = gGetUnit;
492 r->cfExtGcd = gExtGcd;
493 r->cfDivBy = gDivBy;
494 #endif
495 r->cfInpNeg = gInpNeg;
496 r->cfInvers= gInvers;
497 r->cfCopy = gCopy;
498 r->cfRePart = gCopy;
499 //r->cfImPart = ndReturn0;
500 r->cfWriteLong = gWriteLong;
501 r->cfWriteShort = gWriteShort;
502 r->cfRead = gRead;
503 r->cfNormalize=gNormalize;
504 r->cfGreater = gGreater;
505 r->cfEqual = gEqual;
506 r->cfIsZero = gIsZero;
507 r->cfIsOne = gIsOne;
508 r->cfIsMOne = gIsMOne;
509 r->cfGreaterZero = gGreaterZero;
510 r->cfPower = gPower;
511 r->cfGetDenom = gGetDenom;
512 r->cfGetNumerator = gGetNumerator;
513 r->cfGcd = gGcd;
514 r->cfLcm = gGcd;
515 r->cfDelete= gDelete;
516 r->cfSetMap = gSetMap;
517 //r->cfInpMult=ndInpMult;
518 r->cfRandom=gRandom;
519 r->cfWriteFd=gWriteFd;
520 r->cfReadFd=gReadFd;
521 r->type=n_Z;
522 #ifdef LDEBUG
523 r->cfDBTest=gDBTest;
524 #endif
525 return FALSE;
526}
527
All the auxiliary stuff.
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
Variable x
Definition: cfModGcd.cc:4082
int p
Definition: cfModGcd.cc:4078
CanonicalForm cf
Definition: cfModGcd.cc:4083
CanonicalForm b
Definition: cfModGcd.cc:4103
FILE * f
Definition: checklibs.c:9
Coefficient rings, fields and other domains suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:709
@ n_Z
only used if HAVE_RINGS is defined
Definition: coeffs.h:43
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:413
@ n_rep_unknown
Definition: coeffs.h:109
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
return result
Definition: facAbsBiFact.cc:75
const CanonicalForm int s
Definition: facAbsFact.cc:51
static int gDivComp(number a, number b, const coeffs r)
Definition: generics.cc:450
static void gWriteFd(number a, FILE *f, const coeffs r)
Definition: generics.cc:381
static number gCopy(number a, const coeffs r)
Definition: generics.cc:180
static number gGcd(number a, number b, const coeffs)
Definition: generics.cc:308
static number gImPart(number a, const coeffs r)
Definition: generics.cc:196
static number gMult(number a, number b, const coeffs cf)
Definition: generics.cc:56
static BOOLEAN gIsMOne(number a, const coeffs r)
Definition: generics.cc:278
static void gWriteShort(number a, const coeffs r)
Definition: generics.cc:209
static BOOLEAN gDivBy(number a, number b, const coeffs)
Definition: generics.cc:408
static void gNormalize(number &a, const coeffs r)
Definition: generics.cc:225
static long gInt(number &a, const coeffs)
Definition: generics.cc:143
static number gExactDiv(number a, number b, const coeffs cf)
Definition: generics.cc:106
static number gAdd(number a, number b, const coeffs cf)
Definition: generics.cc:76
static number gRePart(number a, const coeffs r)
Definition: generics.cc:188
static BOOLEAN gIsUnit(number a, const coeffs)
Definition: generics.cc:439
static void gPower(number a, int i, number *result, const coeffs r)
Definition: generics.cc:300
static number gInpNeg(number a, const coeffs r)
Definition: generics.cc:165
VAR coeffs coeffs1
Definition: generics.cc:33
static number gFarey(number p, number n, const coeffs)
Definition: generics.cc:390
static BOOLEAN gGreaterZero(number a, const coeffs r)
Definition: generics.cc:289
static void gKillChar(coeffs r)
Definition: generics.cc:45
static number gGetUnit(number n, const coeffs r)
Definition: generics.cc:431
static number gInit(long i, const coeffs cf)
Definition: generics.cc:116
static number gNormalizeHelper(number a, number b, const coeffs r)
Definition: generics.cc:356
static void gCoeffWrite(const coeffs r, BOOLEAN b)
Definition: generics.cc:35
static number gIntMod(number a, number b, const coeffs cf)
Definition: generics.cc:96
number a2
Definition: generics.cc:30
static number gGetDenom(number &a, const coeffs)
Definition: generics.cc:326
static BOOLEAN gEqual(number a, number b, const coeffs r)
Definition: generics.cc:243
static void gSetChar(coeffs r)
Definition: generics.cc:50
static number gGetNumerator(number &a, const coeffs)
Definition: generics.cc:334
static number gRandom(siRandProc p, number p1, number p2, const coeffs cf)
Definition: generics.cc:403
static BOOLEAN gGreater(number a, number b, const coeffs r)
Definition: generics.cc:231
static number gExtGcd(number a, number b, number *s, number *t, const coeffs)
Definition: generics.cc:420
static void gWriteLong(number a, const coeffs r)
Definition: generics.cc:204
static number gChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs)
Definition: generics.cc:398
static BOOLEAN gDBTest(number a, const char *f, const int l, const coeffs r)
Definition: generics.cc:462
VAR coeffs coeffs2
Definition: generics.cc:33
static void gMPZ(mpz_t result, number &n, const coeffs r)
Definition: generics.cc:154
static number gSubringGcd(number a, number b, const coeffs)
Definition: generics.cc:317
BOOLEAN gInitChar(coeffs r, void *p)
Definition: generics.cc:468
static const char * gRead(const char *s, number *a, const coeffs r)
Definition: generics.cc:214
static number gReadFd(s_buff f, const coeffs r)
Definition: generics.cc:385
static number gLcm(number a, number b, const coeffs r)
Definition: generics.cc:347
static nMapFunc gSetMap(const coeffs src, const coeffs dst)
Definition: generics.cc:376
static BOOLEAN gIsZero(number a, const coeffs r)
Definition: generics.cc:255
static char * gCoeffName(const coeffs r)
Definition: generics.cc:41
number a1
Definition: generics.cc:29
static number gInvers(number a, const coeffs r)
Definition: generics.cc:172
static number gQuotRem(number a, number b, number *rem, const coeffs r)
Definition: generics.cc:342
static void gDelete(number *a, const coeffs r)
Definition: generics.cc:365
static number gInitMPZ(mpz_t i, const coeffs cf)
Definition: generics.cc:124
static int gSize(number a, const coeffs)
Definition: generics.cc:132
static number gSub(number a, number b, const coeffs cf)
Definition: generics.cc:66
static number gDiv(number a, number b, const coeffs cf)
Definition: generics.cc:86
static BOOLEAN gIsOne(number a, const coeffs r)
Definition: generics.cc:267
#define VAR
Definition: globaldefs.h:5
void rem(unsigned long *a, unsigned long *q, unsigned long p, int &dega, int degq)
Definition: minpoly.cc:572
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omalloc(size)
Definition: omAllocDecl.h:228
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:12
int(* siRandProc)(void)
Definition: sirandom.h:9