numbers.h
Go to the documentation of this file.
1 #ifndef NUMBERS_H
2 #define NUMBERS_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT: compatility interface to coeffs
8 */
9 #include <coeffs/coeffs.h>
10 
11 // the access methods
12 //
13 // the routines w.r.t. currRing:
14 // (should only be used in the context of currRing, i.e. in t
15 #define nCopy(n) n_Copy(n, currRing->cf)
16 #define nDelete(n) n_Delete(n, currRing->cf)
17 #define nMult(n1, n2) n_Mult(n1, n2, currRing->cf)
18 #define nAdd(n1, n2) n_Add(n1, n2, currRing->cf)
19 #define nIsZero(n) n_IsZero(n, currRing->cf)
20 #define nEqual(n1, n2) n_Equal(n1, n2, currRing->cf)
21 #define nInpNeg(n) n_InpNeg(n, currRing->cf)
22 #define nSub(n1, n2) n_Sub(n1, n2, currRing->cf)
23 #define nGetChar() n_GetChar(currRing->cf)
24 #define nInit(i) n_Init(i, currRing->cf)
25 #define nIsOne(n) n_IsOne(n, currRing->cf)
26 #define nIsMOne(n) n_IsMOne(n, currRing->cf)
27 #define nGreaterZero(n) n_GreaterZero(n, currRing->cf)
28 #define nGreater(a, b) n_Greater (a,b,currRing->cf)
29 #define nWrite(n) n_Write(n, currRing->cf, rShortOut(currRing))
30 #define nNormalize(n) n_Normalize(n,currRing->cf)
31 #define nGcd(a,b) n_Gcd(a,b,currRing->cf)
32 #define nDiv(a, b) n_Div(a,b,currRing->cf)
33 #define nInvers(a) n_Invers(a,currRing->cf)
34 #define nExactDiv(a, b) n_ExactDiv(a,b,currRing->cf)
35 #define nTest(a) n_Test(a,currRing->cf)
36 
37 #define nInpMult(a, b) n_InpMult(a,b,currRing->cf)
38 #define nPower(a, b, res) n_Power(a,b,res,currRing->cf)
39 #define nSize(n) n_Size(n,currRing->cf)
40 #define nGetDenom(N) n_GetDenom((N),currRing->cf)
41 #define nGetNumerator(N) n_GetNumerator((N),currRing->cf)
42 
43 #define nSetMap(R) n_SetMap(R,currRing->cf)
44 
45 /// only for debug, over any initalized currRing
46 #define nPrint(a) n_Print(a,currRing->cf)
47 
48 
49 
50 
51 // --------------------------------------------------------------
52 // internal to coeffs, but public for all realizations
53 
54 #define SHORT_REAL_LENGTH 6 // use short reals for real <= 6 digits
55 
56 /* the dummy routines: */
57 // void nDummy1(number* d);
58 // void ndDelete(number* d, const coeffs r);
59 // number ndGcd(number a, number b, const coeffs);
60 // number ndCopy(number a, const coeffs r);
61 number ndCopyMap(number a, const coeffs src, const coeffs dst);
62 // int ndSize(number a, const coeffs r);
63 // number ndGetDenom(number &n, const coeffs r);
64 // number ndGetNumerator(number &a,const coeffs r);
65 // number ndReturn0(number n, const coeffs r);
66 // number ndIntMod(number a, number b, const coeffs r);
67 
68 // void ndInpMult(number &a, number b, const coeffs r);
69 // void ndInpAdd(number &a, number b, const coeffs r);
70 
71 // void ndKillChar(coeffs);
72 
73 // number ndInit_bigint(number i, const coeffs dummy, const coeffs dst);
74 
75 // BOOLEAN ndCoeffIsEqual(const coeffs r, n_coeffType n, void * parameter);
76 
77 /// Test whether a is a zero divisor in r
78 /// i.e. not coprime with char. of r
79 /// very inefficient implementation:
80 /// should ONLY be used for debug stuff /tests
81 BOOLEAN n_IsZeroDivisor( number a, const coeffs r);
82 
83 const char* const nDivBy0 = "div by 0";
84 
85 // dummy routines
86 // void ndNormalize(number& d, const coeffs); // nNormalize...
87 
88 /// initialize an object of type coeff, return FALSE in case of success
89 typedef BOOLEAN (*cfInitCharProc)(coeffs, void *);
91 
92 /// find an existing coeff by its "CoeffName"
93 coeffs nFindCoeffByName(const char *n);
94 
95 /// divide by the first (leading) number and return it, i.e. make monic
96 // void ndClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r);
97 
98 /// does nothing (just returns a dummy one number)
99 // void ndClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, number& d, const coeffs r);
100 
101 #endif
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
coeffs nFindCoeffByName(const char *n)
find an existing coeff by its "CoeffName"
Definition: numbers.cc:563
BOOLEAN(* cfInitCharProc)(coeffs, void *)
initialize an object of type coeff, return FALSE in case of success
Definition: numbers.h:89
const ring r
Definition: syzextra.cc:208
Coefficient rings, fields and other domains suitable for Singular polynomials.
The main handler for Singular numbers which are suitable for Singular polynomials.
const char *const nDivBy0
Definition: numbers.h:83
n_coeffType nRegister(n_coeffType n, cfInitCharProc p)
Definition: numbers.cc:533
number ndCopyMap(number a, const coeffs src, const coeffs dst)
Definition: numbers.cc:244
n_coeffType
Definition: coeffs.h:27
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 implementatio...
Definition: numbers.cc:137
int BOOLEAN
Definition: auxiliary.h:85