 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the documentation of this file.
10 #include "factory/factory.h"
28 #if defined(DO_LINLINE) && defined(P_NUMBERS_H) && !defined(LDEBUG)
29 #define LINLINE static FORCE_INLINE
76 const char *
nlRead (
const char *
s, number *a,
const coeffs r);
92 #define nlTest(a, r) nlDBTest(a,__FILE__,__LINE__, r)
95 #define nlTest(a, r) do {} while (0)
102 #define MAX_NUM_SIZE 60
103 #define POW_2_28 (1L<<60)
104 #define POW_2_28_32 (1L<<28)
107 #define MAX_NUM_SIZE 28
108 #define POW_2_28 (1L<<28)
109 #define POW_2_28_32 (1L<<28)
125 LONG ui=mpz_get_si(
x->z);
126 if ((((ui<<3)>>3)==ui)
127 && (mpz_cmp_si(
x->z,(
long)ui)==0))
140 #ifndef BYTES_PER_MP_LIMB
141 #define BYTES_PER_MP_LIMB sizeof(mp_limb_t)
151 #define mpz_isNeg(A) ((A)->_mp_size<0)
152 #define mpz_limb_size(A) ((A)->_mp_size)
153 #define mpz_limb_d(A) ((A)->_mp_d)
170 #if (__GNU_MP_VERSION*10+__GNU_MP_VERSION_MINOR < 31)
171 void mpz_mul_si (mpz_ptr r, mpz_srcptr
s,
long int si)
206 mpz_init_set(
z->z,(mpz_ptr) from);
230 mpz_init_set_ui(
z->z,(
unsigned long) from);
243 Print(
"!!longrat: NULL in %s:%d\n",
f,
l);
247 if ((((
long)a)&3L)==3L)
249 Print(
" !!longrat:ptr(3) in %s:%d\n",
f,
l);
252 if ((((
long)a)&3L)==1L)
254 if (((((
LONG)(
long)a)<<1)>>1)!=((
LONG)(
long)a))
256 Print(
" !!longrat:arith:%lx in %s:%d\n",(
long)a,
f,
l);
266 if (a->debug!=123456)
268 Print(
"!!longrat:debug:%d in %s:%d\n",a->debug,
f,
l);
272 if ((a->s<0)||(a->s>4))
274 Print(
"!!longrat:s=%d in %s:%d\n",a->s,
f,
l);
282 if (a->z[0]._mp_alloc==0)
283 Print(
"!!longrat:z->alloc=0 in %s:%d\n",
f,
l);
287 if ((a->n[0]._mp_d[0]==0)&&(a->n[0]._mp_alloc<=1))
289 Print(
"!!longrat: n==0 in %s:%d\n",
f,
l);
297 if (a->z[0]._mp_alloc==0)
298 Print(
"!!longrat:n->alloc=0 in %s:%d\n",
f,
l);
299 if ((
mpz_size1(a->n) ==1) && (mpz_cmp_si(a->n,1L)==0))
301 Print(
"!!longrat:integer as rational in %s:%d\n",
f,
l);
302 mpz_clear(a->n); a->s=3;
307 Print(
"!!longrat:div. by negative in %s:%d\n",
f,
l);
321 if ((((ui<<3)>>3)==ui)
322 && (mpz_cmp_si(a->z,(
long)ui)==0))
324 Print(
"!!longrat:im int %d in %s:%d\n",ui,
f,
l);
346 long lz=mpz_get_si(
n->z);
347 if (mpz_cmp_si(
n->z,lz)==0)
term=lz;
350 mpz_init_set( dummy,
n->z );
359 mpz_init_set(
num,
n->z );
360 mpz_init_set(
den,
n->n );
382 if (
f.den().isOne() )
410 mpz_init_set_ui(h1,1);
411 while((FLT_RADIX*
f) < DBL_MAX &&
i<DBL_MANT_DIG)
414 mpz_mul_ui(h1,h1,FLT_RADIX);
419 memcpy(&(re->n),&h1,
sizeof(h1));
421 if(f_sign==-1) re=
nlNeg(re,dst);
438 size = (*f)[0]._mp_size;
456 e=(*f)[0]._mp_exp-
size;
463 void* (*allocfunc) (size_t);
464 mp_get_memory_functions (&allocfunc,
NULL,
NULL);
467 al = dest->_mp_size =
size;
469 dd = (mp_ptr)allocfunc(
sizeof(mp_limb_t)*al);
472 nn = (mp_ptr)allocfunc(
sizeof(mp_limb_t)*bl);
476 ndest->_mp_alloc = ndest->_mp_size = bl;
481 al = dest->_mp_size =
size+e;
483 dd = (mp_ptr)allocfunc(
sizeof(mp_limb_t)*al);
485 for (
i=0;
i<e;
i++) dd[
i] = 0;
490 dest->_mp_alloc = al;
575 int s=a->z[0]._mp_alloc;
584 int d=a->n[0]._mp_alloc;
609 long ul=mpz_get_si(
i->z);
610 if (mpz_cmp_si(
i->z,ul)!=0)
return 0;
616 mpz_tdiv_q(tmp,
i->z,
i->n);
621 if (mpz_cmp_si(tmp,ul)!=0) ul=0;
640 mpz_tdiv_q(tmp->z,
i->z,
i->n);
670 mpz_init_set_ui(
n->z,1L);
675 mpz_init_set_si(
n->z,-1L);
686 mpz_init_set(
n->n,a->z);
692 mpz_init_set(
n->z,a->n);
698 if (mpz_cmp_ui(
n->n,1L)==0)
711 mpz_init_set_si(
n->z,-1L);
715 mpz_init_set_ui(
n->z,1L);
770 mpz_divexact(u->z,a->z,
b->z);
815 if (rr<0) rr+=
ABS(bb);
845 mpz_init_set(u->z,a->z);
850 else mpz_sub(u->z,u->z,rr->z);
851 mpz_divexact(u->z,u->z,
b->z);
898 mpz_init_set_si(aa, ai);
905 mpz_mod(u->z, aa,
b->z);
923 mpz_mod(u->z, a->z,
b->z);
945 return (mpz_divisible_ui_p(a->z,
SR_TO_INT(
b))!=0);
948 return mpz_divisible_p(a->z,
b->z) != 0;
970 long ch = r->cfInt(c, r);
981 mpz_init_set_ui(dummy, ch);
984 info.exp = (
unsigned long) 1;
1015 if (
j==1L)
return a;
1030 mpz_init_set_si(u->z,(
long)
i);
1031 mpz_init_set_si(u->n,(
long)
j);
1054 if (mpz_cmp(u->z,
b->z)==0)
1060 mpz_init_set(u->n,
b->z);
1069 mpz_init_set(u->n,a->n);
1089 mpz_init_set(u->n,
b->z);
1090 if (a->s<2) mpz_mul(u->n,u->n,a->n);
1091 if (
b->s<2) mpz_mul(u->z,u->z,
b->n);
1099 if (mpz_cmp_si(u->n,1L)==0)
1133 mpz_pow_ui((*u)->z,
x->z,(
unsigned long)
exp);
1136 if (mpz_cmp_si(
x->n,1L)==0)
1144 mpz_pow_ui((*u)->n,
x->n,(
unsigned long)
exp);
1220 if((
i==0L)||(
j==0L))
1243 unsigned long t=mpz_gcd_ui(
NULL,
b->z,(
long)aa);
1253 unsigned long t=mpz_gcd_ui(
NULL,a->z,(
long)bb);
1273 static int int_extgcd(
int a,
int b,
int * u,
int*
x,
int *
v,
int*
y)
1333 if (mpz_cmp(
x->z,
x->n)==0)
1356 if (mpz_cmp_si(
x->n,1L)==0)
1366 mpz_gcd(
gcd,
x->z,
x->n);
1368 if (mpz_cmp_si(
gcd,1L)!=0)
1370 mpz_divexact(
x->z,
x->z,
gcd);
1371 mpz_divexact(
x->n,
x->n,
gcd);
1372 if (mpz_cmp_si(
x->n,1L)==0)
1410 mpz_gcd(
gcd,a->z,
b->n);
1411 if (mpz_cmp_si(
gcd,1L)!=0)
1415 mpz_divexact(bt,
b->n,
gcd);
1419 mpz_mul(
result->z,bt,a->z);
1451 const unsigned long PP =
p;
1454 number
z =
n_Init( static_cast<long>(mpz_fdiv_ui(q->z, PP)), Zp );
1460 number
n =
n_Init( static_cast<long>(mpz_fdiv_ui(q->n, PP)), Zp );
1489 WarnS(
"Omitted denominator during coefficient mapping !");
1515 mpz_init_set(u->z,
n->n);
1542 mpz_init_set(u->z,
n->z);
1565 if (a->s!=0)
return FALSE;
1566 number
n=
b;
b=a; a=
n;
1580 bo=(mpz_cmp(bb,
b->z)==0);
1585 if (((a->s==1) && (
b->s==3))
1586 || ((
b->s==1) && (a->s==3)))
1594 mpz_init_set(aa,a->z);
1595 mpz_init_set(bb,
b->z);
1596 if (a->s<2) mpz_mul(bb,bb,a->n);
1597 if (
b->s<2) mpz_mul(aa,aa,
b->n);
1598 bo=(mpz_cmp(aa,bb)==0);
1617 mpz_init_set(
b->n,a->n);
1619 mpz_init_set(
b->z,a->z);
1641 memset(*a,0,
sizeof(**a));
1660 #define GCD_NORM_COND(OLD,NEW) (mpz_size1(NEW->z)>mpz_size1(OLD->z))
1666 mpz_gcd(
gcd,
x->z,
x->n);
1668 if (mpz_cmp_si(
gcd,1L)!=0)
1670 mpz_divexact(
x->z,
x->z,
gcd);
1671 mpz_divexact(
x->n,
x->n,
gcd);
1672 if (mpz_cmp_si(
x->n,1L)==0)
1705 mpz_add(u->z,
b->z,
x);
1713 if (mpz_cmp(u->z,
b->n)==0)
1719 mpz_init_set(u->n,
b->n);
1751 mpz_mul(
x,
b->z,a->n);
1752 mpz_mul(u->z,a->z,
b->n);
1753 mpz_add(u->z,u->z,
x);
1763 mpz_mul(u->n,a->n,
b->n);
1764 if (mpz_cmp(u->z,u->n)==0)
1777 mpz_mul(u->z,
b->z,a->n);
1778 mpz_add(u->z,u->z,a->z);
1785 if (mpz_cmp(u->z,a->n)==0)
1791 mpz_init_set(u->n,a->n);
1806 mpz_mul(u->z,a->z,
b->n);
1807 mpz_add(u->z,u->z,
b->z);
1814 if (mpz_cmp(u->z,
b->n)==0)
1820 mpz_init_set(u->n,
b->n);
1827 mpz_add(u->z,a->z,
b->z);
1852 mpz_add(a->z,a->z,
x);
1886 mpz_add(u->z,
b->z,
x);
1889 mpz_init_set(u->n,
b->n);
1925 mpz_mul(
x,
b->z,a->n);
1926 mpz_mul(
y,a->z,
b->n);
1930 mpz_mul(a->n,a->n,
b->n);
1940 mpz_mul(
x,
b->z,a->n);
1941 mpz_add(a->z,a->z,
x);
1960 mpz_mul(
x,a->z,
b->n);
1961 mpz_add(a->z,
b->z,
x);
1963 mpz_init_set(a->n,
b->n);
1971 mpz_add(a->z,a->z,
b->z);
2000 mpz_sub(u->z,
x,
b->z);
2008 if (mpz_cmp(u->z,
b->n)==0)
2014 mpz_init_set(u->n,
b->n);
2047 mpz_sub(u->z,a->z,
x);
2055 if (mpz_cmp(u->z,a->n)==0)
2061 mpz_init_set(u->n,a->n);
2098 mpz_mul(
x,
b->z,a->n);
2099 mpz_mul(
y,a->z,
b->n);
2110 mpz_mul(u->n,a->n,
b->n);
2111 if (mpz_cmp(u->z,u->n)==0)
2126 mpz_mul(
x,
b->z,a->n);
2127 mpz_sub(u->z,a->z,
x);
2135 if (mpz_cmp(u->z,a->n)==0)
2141 mpz_init_set(u->n,a->n);
2158 mpz_mul(
x,a->z,
b->n);
2159 mpz_sub(u->z,
x,
b->z);
2167 if (mpz_cmp(u->z,
b->n)==0)
2173 mpz_init_set(u->n,
b->n);
2180 mpz_sub(u->z,a->z,
b->z);
2224 if (u->s==1) u->s=0;
2227 mpz_mul_ui(u->z,
b->z,(
unsigned long)
SR_TO_INT(a));
2239 mpz_mul_ui(u->z,
b->z,(
unsigned long)-
SR_TO_INT(a));
2245 if (mpz_cmp(u->z,
b->n)==0)
2251 mpz_init_set(u->n,
b->n);
2261 mpz_mul(u->z,a->z,
b->z);
2271 if (mpz_cmp(u->z,
b->n)==0)
2277 mpz_init_set(u->n,
b->n);
2285 if (mpz_cmp(u->z,a->n)==0)
2291 mpz_init_set(u->n,a->n);
2297 mpz_mul(u->n,a->n,
b->n);
2298 if (mpz_cmp(u->z,u->n)==0)
2367 mpz_init_set_si(
z->z,
i);
2381 mpz_init_set_si(
z->z,(
long)
i);
2382 mpz_init_set_si(
z->n,(
long)
j);
2394 mpz_init_set(
z->z,
i);
2395 mpz_init_set(
z->n,
j);
2421 #if defined(DO_LINLINE) || !defined(P_NUMBERS_H)
2440 #if MAX_NUM_SIZE == 60
2445 if ( ((((
long)ii)==
i) && ((ii << 3) >> 3) == ii ))
n=
INT_TO_SR(ii);
2469 if (mpz_cmp_si(a->z,0L)==0)
2471 printf(
"gmp-0 in nlIsZero\n");
2537 if ( ((r << 1) >> 1) == r )
2538 return (number)(long)r;
2556 if ( ((r << 1) >> 1) == r )
2579 number u=((number) ((r>>1)+
SR_INT));
2603 if ( ((r << 1) >> 1) == r )
2605 return (number)(long)r;
2627 mpz_mul(aa->z,a->z,
b->z);
2632 mpz_init_set(a->n,
b->n);
2640 mpz_mul(a->n,a->n,
b->n);
2646 #endif // DO_LINLINE
2655 else mpz_init_set(
m, (mpz_ptr)
n->z);
2666 mpz_init_set(
z->z,
m);
2671 number
nlXExtGcd (number a, number
b, number *
s, number *t, number *u, number *
v,
const coeffs r)
2692 mpz_init_set(aa, a->z);
2700 mpz_init_set(bb,
b->z);
2702 mpz_t erg; mpz_t bs; mpz_t bt;
2707 mpz_gcdext(erg, bs, bt, aa, bb);
2709 mpz_div(aa, aa, erg);
2752 rr = mpz_divmod_ui(qq, rrr, a->z, (
unsigned long)
ABS(
SR_TO_INT(
b)));
2766 mpz_divmod(qq, rr, a->z,
b->z);
2786 mpz_gcd(a->z,a->z,
b->z);
2803 else mpz_sub(a->z,a->z,rr->z);
2804 mpz_divexact(a->z,a->z,
b->z);
2811 mpz_t
A,
B,C,
D,
E,
N,P,tmp;
2813 else mpz_init_set(P,nP->z);
2814 const mp_bitcnt_t bits=2*(
mpz_size1(P)+1)*GMP_LIMB_BITS;
2817 else mpz_set(
N,nN->z);
2820 mpz_init2(
A,bits); mpz_set_ui(
A,0L);
2821 mpz_init2(
B,bits); mpz_set_ui(
B,1L);
2822 mpz_init2(C,bits); mpz_set_ui(C,0L);
2824 mpz_init2(
E,bits); mpz_set(
E,P);
2825 mpz_init2(tmp,bits);
2830 mpz_add(tmp,tmp,tmp);
2831 if (mpz_cmp(tmp,P)<0)
2840 if (mpz_cmp_ui(tmp,1)==0)
2847 mpz_init_set(
z->z,
N);
2848 mpz_init_set(
z->n,
B);
2861 mpz_divmod(tmp,
D,
E,
N);
2884 mpz_init((*s)->z); (*s)->s=3;
2886 mpz_init((*t)->z); (*t)->s=3;
2888 mpz_init(
g->z);
g->s=3;
2896 aa=(mpz_ptr)
omAlloc(
sizeof(mpz_t));
2905 bb=(mpz_ptr)
omAlloc(
sizeof(mpz_t));
2912 mpz_gcdext(
g->z,(*s)->z,(*t)->z,aa,bb);
2945 for(
i=rl-1;
i>=0;
i--)
2947 X[
i]=CF->convSingNFactoryN(
x[
i],
FALSE,CF);
2948 Q[
i]=CF->convSingNFactoryN(q[
i],
FALSE,CF);
2955 number
n=CF->convFactoryNSingN(xnew,CF);
2958 number
p=CF->convFactoryNSingN(qnew,CF);
2961 else p2=CF->cfDiv(
p,CF->cfInit(2, CF),CF);
2962 if (CF->cfGreater(
n,p2,CF))
2964 number n2=CF->cfSub(
n,
p,CF);
2965 CF->cfDelete(&
n,CF);
2968 CF->cfDelete(&p2,CF);
2969 CF->cfDelete(&
p,CF);
2971 CF->cfNormalize(
n,CF);
2975 number nlChineseRemainder(number *
x, number *q,
int rl,
const coeffs C)
2986 numberCollectionEnumerator.
Reset();
2988 if( !numberCollectionEnumerator.
MoveNext() )
3003 int normalcount = 0;
3006 number&
n = numberCollectionEnumerator.
Current();
3018 }
while (numberCollectionEnumerator.
MoveNext() );
3025 numberCollectionEnumerator.
Reset();
3027 while (numberCollectionEnumerator.
MoveNext() )
3029 number&
n = numberCollectionEnumerator.
Current();
3031 if( (--normalcount) <= 0)
3045 numberCollectionEnumerator.
Reset();
3047 while (numberCollectionEnumerator.
MoveNext() )
3049 number& nn = numberCollectionEnumerator.
Current();
3062 numberCollectionEnumerator.
Reset();
3064 while (numberCollectionEnumerator.
MoveNext() )
3066 number&
n = numberCollectionEnumerator.
Current();
3077 numberCollectionEnumerator.
Reset();
3079 if( !numberCollectionEnumerator.
MoveNext() )
3102 number& cand1 = numberCollectionEnumerator.
Current();
3112 mpz_init_set(
cand->z, cand1->n);
3117 mpz_lcm(
cand->z,
cand->z, cand1->n);
3122 while (numberCollectionEnumerator.
MoveNext() );
3137 numberCollectionEnumerator.
Reset();
3138 while (numberCollectionEnumerator.
MoveNext() )
3140 number&
n = numberCollectionEnumerator.
Current();
3152 numberCollectionEnumerator.
Reset();
3159 while (numberCollectionEnumerator.
MoveNext() )
3161 number &
n = numberCollectionEnumerator.
Current();
3169 if (r->cfDiv==
nlDiv)
return (
char*)
"QQ";
3170 else return (
char*)
"ZZ";
3184 #if SIZEOF_LONG == 4
3191 fprintf(d->
f_write,
"4 %d ",nnn);
3196 mpz_init_set_si(tmp,nn);
3248 #if SIZEOF_LONG == 8
3277 #if SIZEOF_LONG == 8
3283 default:
Werror(
"error in reading number: invalid subtype %d",sub_type);
3347 r->cfSubringGcd =
nlGcd;
3370 r->cfInpNeg =
nlNeg;
3414 r->has_simple_Alloc=
FALSE;
3415 r->has_simple_Inverse=
FALSE;
3422 number nlMod(number a, number
b)
3444 mpz_mod(r->z,al->z,bl->z);
3449 LONG ui=(int)mpz_get_si(&r->z);
3450 if ((((ui<<3)>>3)==ui)
3451 && (mpz_cmp_si(
x->z,(
long)ui)==0))
3461 #endif // not P_NUMBERS_H
3462 #endif // LONGRAT_CC
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static number nlLcm(number a, number b, const coeffs r)
(mpz_ptr), see rmodulon,h
#define omCheckAddrSize(addr, size)
only used if HAVE_RINGS is defined
BOOLEAN nlIsUnit(number a, const coeffs)
LINLINE BOOLEAN nlIsZero(number za, const coeffs r)
static const int SW_RATIONAL
set to 1 for computations over Q
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
coeffs nlQuot1(number c, const coeffs r)
LINLINE number nl_Copy(number a, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
virtual reference Current()=0
Gets the current element in the collection (read and write).
LINLINE void nlInpMult(number &a, number b, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
nMapFunc nlSetMap(const coeffs src, const coeffs dst)
long nlInt(number &n, const coeffs r)
const CanonicalForm int const CFList const Variable & y
number nlMapZ(number from, const coeffs src, const coeffs dst)
number nlExtGcd(number a, number b, number *s, number *t, const coeffs)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
LINLINE BOOLEAN nlIsOne(number a, const coeffs r)
number nlChineseRemainderSym(number *x, number *q, int rl, BOOLEAN sym, CFArray &inv_cache, const coeffs CF)
LINLINE number nlCopy(number a, const coeffs r)
number _nlMult_aNoImm_OR_bNoImm(number a, number b)
BOOLEAN nlIsMOne(number a, const coeffs r)
char * nlCoeffName(const coeffs r)
void nlCoeffWrite(const coeffs r, BOOLEAN details)
void _nlDelete_NoImm(number *a)
static number nlMapR(number from, const coeffs src, const coeffs dst)
int nlDivComp(number a, number b, const coeffs r)
number nlCopyMap(number a, const coeffs, const coeffs)
SI_FLOAT nrFloat(number n)
Converts a n_R number into a float. Needed by Maps.
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
REvaluation E(1, terms.length(), IntRandom(25))
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
BOOLEAN nlDivBy(number a, number b, const coeffs)
number nlMapMachineInt(number from, const coeffs, const coeffs)
CanonicalForm make_cf(const mpz_ptr n)
number nlShort1(number x)
const CanonicalForm CFMap CFMap & N
LINLINE void nlInpAdd(number &a, number b, const coeffs r)
number _nlSub_aNoImm_OR_bNoImm(number a, number b)
LINLINE number nlInit(long i, const coeffs r)
LINLINE number nlSub(number la, number li, const coeffs r)
void s_readmpz(s_buff F, mpz_t a)
BOOLEAN nlDBTest(number a, const char *f, const int l)
real floating point (GMP) numbers
virtual void Reset()=0
Sets the enumerator to its initial position: -1, which is before the first element in the collection.
int nlSize(number a, const coeffs)
LINLINE BOOLEAN nlEqual(number a, number b, const coeffs r)
static number nlRandom(siRandProc p, number v2, number, const coeffs cf)
void nlPower(number x, int exp, number *lu, const coeffs r)
static void nlClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
static int int_extgcd(int a, int b, int *u, int *x, int *v, int *y)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const char *const nDivBy0
void PrintS(const char *s)
#define omFreeSize(addr, size)
void nlWriteFd(number n, const ssiInfo *d, const coeffs)
static void nlClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
void nlWrite(number a, const coeffs r)
number nlXExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
number nlGetUnit(number n, const coeffs cf)
number nlNormalizeHelper(number a, number b, const coeffs r)
static number nlConvFactoryNSingN(const CanonicalForm f, const coeffs r)
static void nlNormalize_Gcd(number &x)
static void nlMPZ(mpz_t m, number &n, const coeffs r)
number nlGcd(number a, number b, const coeffs r)
static CanonicalForm nlConvSingNFactoryN(number n, const BOOLEAN setChar, const coeffs)
static number nlInitMPZ(mpz_t m, const coeffs)
void nlNormalize(number &x, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
void chineseRemainderCached(CFArray &a, CFArray &n, CanonicalForm &xnew, CanonicalForm &prod, CFArray &inv)
number nlGetNumerator(number &n, const coeffs r)
void chineseRemainder(const CanonicalForm &x1, const CanonicalForm &q1, const CanonicalForm &x2, const CanonicalForm &q2, CanonicalForm &xnew, CanonicalForm &qnew)
void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2,...
number nlGetDenom(number &n, const coeffs r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
long s_readlong(s_buff F)
number nlModP(number q, const coeffs, const coeffs Zp)
number nlQuotRem(number a, number b, number *r, const coeffs R)
BOOLEAN nlGreaterZero(number za, const coeffs r)
BOOLEAN _nlEqual_aNoImm_OR_bNoImm(number a, number b)
number nlIntMod(number a, number b, const coeffs r)
number nlMapGMP(number from, const coeffs src, const coeffs dst)
number _nlMult_aImm_bImm_rNoImm(number a, number b)
single prescision (6,6) real numbers
gmp_float exp(const gmp_float &a)
long npInt(number &n, const coeffs r)
const CanonicalForm const CanonicalForm const CanonicalForm const CanonicalForm & cand
void nlInpGcd(number &a, number b, const coeffs r)
void mpz_mul_si(mpz_ptr r, mpz_srcptr s, long int si)
number nlDiv(number a, number b, const coeffs r)
virtual bool MoveNext()=0
Advances the enumerator to the next element of the collection. returns true if the enumerator was suc...
number _nlCopy_NoImm(number a)
LINLINE number nlAdd(number la, number li, const coeffs r)
void Werror(const char *fmt,...)
number nlInvers(number a, const coeffs r)
number nlBigInt(number &n)
void nlInpIntDiv(number &a, number b, const coeffs r)
void WerrorS(const char *s)
static number nlShort3(number x)
number nlFarey(number nN, number nP, const coeffs CF)
#define omCheckIf(cond, test)
number nlInit2(int i, int j, const coeffs r)
create a rational i/j (implicitly) over Q NOTE: make sure to use correct Q in debug mode
const char * nlRead(const char *s, number *a, const coeffs r)
static number nlMapP(number from, const coeffs src, const coeffs dst)
void _nlInpAdd_aNoImm_OR_bNoImm(number &a, number b)
number nlIntDiv(number a, number b, const coeffs r)
void gmp_denominator(const CanonicalForm &f, mpz_ptr result)
void gmp_numerator(const CanonicalForm &f, mpz_ptr result)
number nlShort3_noinline(number x)
const Variable & v
< [in] a sqrfree bivariate poly
LINLINE number nlMult(number a, number b, const coeffs r)
number nlInit2gmp(mpz_t i, mpz_t j, const coeffs r)
create a rational i/j (implicitly) over Q NOTE: make sure to use correct Q in debug mode
LINLINE number nlNeg(number za, const coeffs r)
const CanonicalForm int s
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...
void s_readmpz_base(s_buff F, mpz_ptr a, int base)
LINLINE void nlDelete(number *a, const coeffs r)
static number nlMapLongR(number from, const coeffs src, const coeffs dst)
BOOLEAN nlInitChar(coeffs r, void *p)
number _nlNeg_NoImm(number a)
const ExtensionInfo & info
< [in] sqrfree poly
number nlExactDiv(number a, number b, const coeffs r)
BOOLEAN nlCoeffIsEqual(const coeffs r, n_coeffType n, void *p)
#define GCD_NORM_COND(OLD, NEW)
BOOLEAN nlGreater(number a, number b, const coeffs r)
number nlReadFd(const ssiInfo *d, const coeffs)
static char * nlCoeffString(const coeffs r)
number _nlAdd_aNoImm_OR_bNoImm(number a, number b)
void nlGMP(number &i, mpz_t n, const coeffs r)
(), see rinteger.h, new impl.