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) |
|
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 99 of file numbers.h.
◆ cfInitCharProc
initialize an object of type coeff, return FALSE in case of success
Definition at line 95 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 171 of file numbers.cc.
172{
175 if (ret || (c==0) || (r->is_field))
176 return ret;
177 number ch =
n_Init( c, r );
178 number
g =
n_Gcd( ch, a, r );
182 return ret;
183}
◆ ndConvSingNFactoryN()
Definition at line 307 of file numbers.cc.
308{
310 WerrorS(
"no conversion to factory");
312}
void WerrorS(const char *s)
◆ ndGcd()
Definition at line 187 of file numbers.cc.
187{ return r->cfInit(1,r); }
◆ ndNormalize()
◆ ndQuotRem()
number ndQuotRem |
( |
number | a, |
|
|
number | b, |
|
|
number * | r, |
|
|
const coeffs | R ) |
Definition at line 350 of file numbers.cc.
352{
353
355 {
358 }
359 else
360
361 {
366 return d;
367 }
◆ 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.
◆ 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;
677 }
678 while (((*
s) >=
'0') && ((*
s) <=
'9'));
679 if ((
m!=0) && (ii>=(
unsigned)
m)) ii=ii%
m;
681 }
const CanonicalForm int s
◆ 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;
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;
701 }
◆ 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++;
713 {
714 mpz_set_str(
i,start,10);
715 }
716 else
717 {
720 mpz_set_str(
i,start,10);
722 }
◆ nFindCoeffByName()
coeffs nFindCoeffByName |
( |
char * | n | ) |
|
find an existing coeff by its "CoeffName"
Definition at line 633 of file numbers.cc.
635{
637
639 {
641 && (strcmp(cf_name,n->
cfCoeffName(n))==0))
return n;
643 }
644
645
648 {
652 }
char *(* cfCoeffName)(const coeffs r)
default name of cf, should substitute cfCoeffWrite, cfCoeffString
The main handler for Singular numbers which are suitable for Singular polynomials.
VAR nFindCoeffByName_p nFindCoeffByName_Root
◆ nRegister()
Definition at line 583 of file numbers.cc.
585{
587 {
590 {
595 }
596 else
597 {
601 }
602
605 }
606 else
607 {
608
610 return n;
611 }
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