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 initalized 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
◆ 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 initalized 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 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 173 of file numbers.cc.
174{
177 if (
ret || (c==0) || (r->is_field))
185}
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 189 of file numbers.cc.
189{ return r->cfInit(1,r); }
◆ ndNormalize()
◆ ndQuotRem()
Definition at line 357 of file numbers.cc.
359{
360
362 {
365 }
366 else
367
368 {
373 return d;
374 }
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 152 of file numbers.cc.
153{
154 Warn(
"ReadFd not implemented for %s (c=%d)",r->cfCoeffName(r),
getCoeffType(r));
156}
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
◆ 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 677 of file numbers.cc.
679{
680
681 if (((*
s) >=
'0') && ((*
s) <=
'9'))
682 {
684 do
685 {
689 }
690 while (((*
s) >=
'0') && ((*
s) <=
'9'));
691 if ((
m!=0) && (
ii>=(
unsigned)
m))
ii=
ii%
m;
693 }
const CanonicalForm int s
◆ nEati() [2/2]
Definition at line 697 of file numbers.cc.
699{
700
701 if (((*
s) >=
'0') && ((*
s) <=
'9'))
702 {
704 do
705 {
709 }
710 while (((*
s) >=
'0') && ((*
s) <=
'9'));
713 }
◆ nEatLong()
extracts a long integer from s, returns the rest
Definition at line 718 of file numbers.cc.
720{
721 const char * start=
s;
722
723 while (*
s >=
'0' && *
s <=
'9')
s++;
725 {
727 }
728 else
729 {
734 }
◆ nFindCoeffByName()
find an existing coeff by its "CoeffName"
Definition at line 645 of file numbers.cc.
647{
649
651 {
655 }
656
657
660 {
664 }
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 substitue cfCoeffWrite, cfCoeffString
◆ nRegister()
Definition at line 595 of file numbers.cc.
597{
599 {
602 {
607 }
608 else
609 {
613 }
614
617 }
618 else
619 {
622 return n;
623 }
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