Go to the source code of this file.
|
| #define | nCopy(n) |
| #define | nDelete(n) |
| #define | nMult(n1, n2) |
| #define | nAdd(n1, n2) |
| #define | nIsZero(n) |
| #define | nEqual(n1, n2) |
| #define | nInpNeg(n) |
| #define | nSub(n1, n2) |
| #define | nGetChar() |
| #define | nInit(i) |
| #define | nIsOne(n) |
| #define | nIsMOne(n) |
| #define | nGreaterZero(n) |
| #define | nGreater(a, b) |
| #define | nWrite(n) |
| #define | nNormalize(n) |
| #define | nGcd(a, b) |
| #define | nDiv(a, b) |
| #define | nInvers(a) |
| #define | nExactDiv(a, b) |
| #define | nTest(a) |
| #define | nInpMult(a, b) |
| #define | nPower(a, b, res) |
| #define | nSize(n) |
| #define | nGetDenom(N) |
| #define | nGetNumerator(N) |
| #define | nSetMap(R) |
| #define | nPrint(a) |
| | only for debug, over any initialized currRing
|
| #define | SHORT_REAL_LENGTH 6 |
|
| number | ndGcd (number a, number b, const coeffs) |
| number | ndQuotRem (number a, number b, number *r, const coeffs R) |
| CanonicalForm | ndConvSingNFactoryN (number, BOOLEAN, const coeffs) |
| number | ndReadFd (const ssiInfo *f, const coeffs r) |
| number | ndReadFd_S (char **, 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) |
| n_coeffType | nRegister (n_coeffType n, cfInitCharProc p) |
| void | nRegisterCfByName (cfInitCfByNameProc p, n_coeffType n) |
| coeffs | nFindCoeffByName (char *n) |
| | find an existing coeff by its "CoeffName"
|
| 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
|
◆ nAdd
Value:
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition at line 18 of file numbers.h.
◆ nCopy
Value:
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition at line 15 of file numbers.h.
◆ nDelete
Value:
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition at line 16 of file numbers.h.
◆ nDiv
Value:
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 at line 32 of file numbers.h.
◆ nEqual
| #define nEqual |
( |
| n1, |
|
|
| n2 ) |
Value:
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
Definition at line 20 of file numbers.h.
◆ nExactDiv
| #define nExactDiv |
( |
| a, |
|
|
| b ) |
Value:
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
Definition at line 34 of file numbers.h.
◆ nGcd
Value:
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 at line 31 of file numbers.h.
◆ nGetChar
Value:
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition at line 23 of file numbers.h.
◆ nGetDenom
Value:
const CanonicalForm CFMap CFMap & N
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1)
Definition at line 40 of file numbers.h.
◆ nGetNumerator
| #define nGetNumerator |
( |
| N | ) |
|
Value:
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n)
Definition at line 41 of file numbers.h.
◆ nGreater
| #define nGreater |
( |
| a, |
|
|
| b ) |
Value:
static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
ordered fields: TRUE iff 'a' is larger than 'b'; in Z/pZ: TRUE iff la > lb, where la and lb are the l...
Definition at line 28 of file numbers.h.
◆ nGreaterZero
| #define nGreaterZero |
( |
| n | ) |
|
Value:
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2),...
Definition at line 27 of file numbers.h.
◆ nInit
Value:
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition at line 24 of file numbers.h.
◆ nInpMult
| #define nInpMult |
( |
| a, |
|
|
| b ) |
Value:
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 at line 37 of file numbers.h.
◆ nInpNeg
Value:
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
Definition at line 21 of file numbers.h.
◆ nInvers
Value:
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 at line 33 of file numbers.h.
◆ nIsMOne
Value:
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
Definition at line 26 of file numbers.h.
◆ nIsOne
Value:
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition at line 25 of file numbers.h.
◆ nIsZero
Value:
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition at line 19 of file numbers.h.
◆ nMult
Value:
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 at line 17 of file numbers.h.
◆ nNormalize
Value:
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition at line 30 of file numbers.h.
◆ nPower
| #define nPower |
( |
| a, |
|
|
| b, |
|
|
| res ) |
Value:
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
Definition at line 38 of file numbers.h.
◆ nPrint
Value:
void n_Print(number &a, const coeffs r)
print a number (BEWARE of string buffers!) mostly for debugging
only for debug, over any initialized currRing
Definition at line 46 of file numbers.h.
◆ nSetMap
Value:
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition at line 43 of file numbers.h.
◆ nSize
Value:
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition at line 39 of file numbers.h.
◆ nSub
Value:
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 at line 22 of file numbers.h.
◆ nTest
Value:
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition at line 35 of file numbers.h.
◆ nWrite
Value:
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
static BOOLEAN rShortOut(const ring r)
Definition at line 29 of file numbers.h.
◆ SHORT_REAL_LENGTH
| #define SHORT_REAL_LENGTH 6 |
◆ cfInitCfByNameProc
initialize an object of type coeffs by its name, return NULL otherwise
Definition at line 100 of file numbers.h.
◆ cfInitCharProc
initialize an object of type coeff, return FALSE in case of success
Definition at line 96 of file numbers.h.
◆ n_IsZeroDivisor()
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 177 of file numbers.cc.
178{
181 if (ret || (c==0) || (r->is_field))
182 return ret;
183 number ch =
n_Init( c, r );
184 number
g =
n_Gcd( ch, a, r );
188 return ret;
189}
◆ ndConvSingNFactoryN()
Definition at line 313 of file numbers.cc.
314{
316 WerrorS(
"no conversion to factory");
318}
void WerrorS(const char *s)
◆ ndGcd()
Definition at line 193 of file numbers.cc.
193{ return r->cfInit(1,r); }
◆ ndNormalize()
◆ ndQuotRem()
| number ndQuotRem |
( |
number | a, |
|
|
number | b, |
|
|
number * | r, |
|
|
const coeffs | R ) |
Definition at line 356 of file numbers.cc.
358{
359
361 {
364 }
365 else
366
367 {
372 return d;
373 }
◆ ndReadFd()
Definition at line 150 of file numbers.cc.
151{
152 Warn(
"ReadFd not implemented for %s (c=%d)",r->cfCoeffName(r),
getCoeffType(r));
154}
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
◆ ndReadFd_S()
◆ 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 672 of file numbers.cc.
674{
675
676 if (((*
s) >=
'0') && ((*
s) <=
'9'))
677 {
678 unsigned long ii=0L;
679 do
680 {
681 ii *= 10;
684 }
685 while (((*
s) >=
'0') && ((*
s) <=
'9'));
686 if ((
m!=0) && (ii>=(
unsigned)
m)) ii=ii%
m;
688 }
const CanonicalForm int s
◆ nEati() [2/2]
| char * nEati |
( |
char * | s, |
|
|
long * | i, |
|
|
int | m ) |
Definition at line 692 of file numbers.cc.
694{
695
696 if (((*
s) >=
'0') && ((*
s) <=
'9'))
697 {
698 unsigned long ii=0L;
699 do
700 {
701 ii *= 10;
703 if ((
m!=0) && (ii > (LONG_MAX / 10))) ii = ii %
m;
704 }
705 while (((*
s) >=
'0') && ((*
s) <=
'9'));
706 if ((
m!=0) && (ii>=(
unsigned long)
m)) ii=ii%(
unsigned long)
m;
708 }
◆ nEatLong()
| char * nEatLong |
( |
char * | s, |
|
|
mpz_ptr | i ) |
extracts a long integer from s, returns the rest
Definition at line 713 of file numbers.cc.
715{
716 const char * start=
s;
717
718 while (*
s >=
'0' && *
s <=
'9')
s++;
720 {
721 mpz_set_str(
i,start,10);
722 }
723 else
724 {
727 mpz_set_str(
i,start,10);
729 }
◆ nFindCoeffByName()
| coeffs nFindCoeffByName |
( |
char * | n | ) |
|
find an existing coeff by its "CoeffName"
Definition at line 640 of file numbers.cc.
642{
644
646 {
648 && (strcmp(cf_name,n->
cfCoeffName(n))==0))
return n;
650 }
651
652
655 {
659 }
The main handler for Singular numbers which are suitable for Singular polynomials.
VAR nFindCoeffByName_p nFindCoeffByName_Root
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitute cfCoeffWrite, cfCoeffString
◆ nRegister()
Definition at line 590 of file numbers.cc.
592{
594 {
597 {
602 }
603 else
604 {
608 }
609
612 }
613 else
614 {
615
617 return n;
618 }
STATIC_VAR n_coeffType nLastCoeffs
STATIC_VAR cfInitCharProc * nInitCharTable
VAR cfInitCharProc nInitCharTableDefault[]
BOOLEAN(* cfInitCharProc)(coeffs, void *)
initialize an object of type coeff, return FALSE in case of success
#define omReallocSize(addr, o_size, size)
◆ nRegisterCfByName()
◆ nDivBy0