Go to the source code of this file.
|
| #define | nCopy(n) n_Copy(n, currRing->cf) |
| |
| #define | nDelete(n) n_Delete(n, currRing->cf) |
| |
| #define | nMult(n1, n2) n_Mult(n1, n2, currRing->cf) |
| |
| #define | nAdd(n1, n2) n_Add(n1, n2, currRing->cf) |
| |
| #define | nIsZero(n) n_IsZero(n, currRing->cf) |
| |
| #define | nEqual(n1, n2) n_Equal(n1, n2, currRing->cf) |
| |
| #define | nInpNeg(n) n_InpNeg(n, currRing->cf) |
| |
| #define | nSub(n1, n2) n_Sub(n1, n2, currRing->cf) |
| |
| #define | nGetChar() n_GetChar(currRing->cf) |
| |
| #define | nInit(i) n_Init(i, currRing->cf) |
| |
| #define | nIsOne(n) n_IsOne(n, currRing->cf) |
| |
| #define | nIsMOne(n) n_IsMOne(n, currRing->cf) |
| |
| #define | nGreaterZero(n) n_GreaterZero(n, currRing->cf) |
| |
| #define | nGreater(a, b) n_Greater (a,b,currRing->cf) |
| |
| #define | nWrite(n) n_Write(n, currRing->cf, rShortOut(currRing)) |
| |
| #define | nNormalize(n) n_Normalize(n,currRing->cf) |
| |
| #define | nGcd(a, b) n_Gcd(a,b,currRing->cf) |
| |
| #define | nDiv(a, b) n_Div(a,b,currRing->cf) |
| |
| #define | nInvers(a) n_Invers(a,currRing->cf) |
| |
| #define | nExactDiv(a, b) n_ExactDiv(a,b,currRing->cf) |
| |
| #define | nTest(a) n_Test(a,currRing->cf) |
| |
| #define | nInpMult(a, b) n_InpMult(a,b,currRing->cf) |
| |
| #define | nPower(a, b, res) n_Power(a,b,res,currRing->cf) |
| |
| #define | nSize(n) n_Size(n,currRing->cf) |
| |
| #define | nGetDenom(N) n_GetDenom((N),currRing->cf) |
| |
| #define | nGetNumerator(N) n_GetNumerator((N),currRing->cf) |
| |
| #define | nSetMap(R) n_SetMap(R,currRing->cf) |
| |
| #define | nPrint(a) n_Print(a,currRing->cf) |
| | 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
◆ nCopy
◆ nDelete
◆ nDiv
◆ nEqual
◆ nExactDiv
◆ nGcd
◆ nGetChar
◆ nGetDenom
◆ nGetNumerator
◆ nGreater
◆ nGreaterZero
◆ nInit
◆ nInpMult
◆ nInpNeg
◆ nInvers
◆ nIsMOne
◆ nIsOne
◆ nIsZero
◆ nMult
◆ nNormalize
◆ nPower
◆ nPrint
only for debug, over any initialized currRing
Definition at line 46 of file numbers.h.
◆ nSetMap
◆ nSize
◆ nSub
◆ nTest
◆ nWrite
◆ SHORT_REAL_LENGTH
◆ 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))
189}
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,...
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
◆ 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()
Definition at line 356 of file numbers.cc.
358{
359
361 {
364 }
365 else
366
367 {
372 return d;
373 }
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
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...
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
◆ 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]
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 {
679 do
680 {
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]
Definition at line 692 of file numbers.cc.
694{
695
696 if (((*
s) >=
'0') && ((*
s) <=
'9'))
697 {
699 do
700 {
704 }
705 while (((*
s) >=
'0') && ((*
s) <=
'9'));
706 if ((
m!=0) && (
ii>=(
unsigned long)
m))
ii=
ii%(
unsigned long)
m;
708 }
◆ nEatLong()
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 {
722 }
723 else
724 {
729 }
◆ nFindCoeffByName()
find an existing coeff by its "CoeffName"
Definition at line 640 of file numbers.cc.
642{
644
646 {
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