13 #if !defined(NO_KINLINE) || defined(KUTIL_CC) 49 if (i >= 0 && i <=
sl)
52 if ((sri >= 0) && (sri <=
tl))
55 if ((t !=
NULL) && (t->p ==
S[i]))
129 if (!shift)
p_Test(p_in, r);
232 is_normalized =
FALSE;
277 return GetLmCurrRing();
340 is_normalized =
FALSE;
396 if (new_tailBin ==
NULL) new_tailBin = new_tailRing->PolyBin;
414 tailRing, new_tailRing, new_tailBin);
445 FDeg = this->pFDeg();
450 assume(FDeg == this->pFDeg());
459 FDeg = this->pFDeg();
460 long d = this->pLDeg();
515 is_normalized =
TRUE;
568 unsigned l = GetpLength();
569 if (use_bucket && (l > 1))
571 poly tp = GetLmTailRing();
608 poly _p = (t_p !=
NULL ? t_p :
p);
624 poly _p = (t_p !=
NULL ? t_p :
p);
658 poly ret = GetLmTailRing();
685 poly tp = GetLmTailRing();
730 p_shallow_copy_delete);
732 new_tailRing->PolyBin,p_shallow_copy_delete,
756 bucket->buckets_length[i]);
766 poly tp = GetLmTailRing();
771 pNext(tp) = bucket->buckets[
i];
797 FDeg = this->pFDeg();
798 long d = this->pLDeg();
804 FDeg = this->pFDeg();
805 long d = this->pLDeg(use_last);
814 return bucket->buckets_length[
i] + 1;
820 length = this->GetpLength();
828 poly tp = GetLmTailRing();
833 pNext(tp) = bucket->buckets[
i];
852 memset(
this, 0,
sizeof(*
this));
871 if (i_r2 == -1) i_r2 =
kFindInT(p2, strat->
T, strat->
tl);
872 assume(i_r2 >= 0 && i_r2 <= strat->
tl);
888 if (i_r1 == -1) i_r1 =
kFindInT(p1, strat->
T, strat->
tl);
889 if (i_r2 == -1) i_r2 =
kFindInT(p2, strat->
T, strat->
tl);
890 assume(i_r1 >= 0 && i_r1 <= strat->
tl);
891 assume(i_r2 >= 0 && i_r2 <= strat->tl);
892 T_1 = strat->
R[i_r1];
893 T_2 = strat->
R[i_r2];
965 poly &m1, poly &m2,
const ring m_r)
972 m1 =
p_Init(m_r,m_r->PolyBin);
973 m2 =
p_Init(m_r,m_r->PolyBin);
975 for (i = p_r->N; i; i--)
980 if (x > (
long) m_r->bitmask)
goto false_return;
986 if (-x > (
long) m_r->bitmask)
goto false_return;
1008 poly &m1, poly &m2, poly &
lcm,
const ring
tailRing)
1018 m1 =
p_Init(tailRing,tailRing->PolyBin);
1019 m2 =
p_Init(tailRing,tailRing->PolyBin);
1020 lcm =
p_Init(leadRing,leadRing->PolyBin);
1022 for (i = leadRing->N; i>=0; i--)
1065 assume(PR->GetLmCurrRing() != red.GetLmCurrRing());
1078 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1098 assume(PR->GetLmCurrRing() != PW->GetLmCurrRing());
1099 Red->HeadNormalize();
1127 return L.GetLmCurrRing();
1137 return L.GetLmCurrRing();
1147 return L.GetLmCurrRing();
1208 #endif // defined(KINLINE) || defined(KUTIL_CC) KINLINE void Init(ring tailRing=currRing)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
denominator_list_s * denominator_list
static number Copy(number a, const coeffs r)
KINLINE TObject ** initR()
const CanonicalForm int s
int ksReducePolyLC(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
CFArray copy(const CFList &list)
write elements of list into an array
KINLINE BOOLEAN k_GetLeadTerms(const poly p1, const poly p2, const ring p_r, poly &m1, poly &m2, const ring m_r)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
void kBucketShallowCopyDelete(kBucket_pt bucket, ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete)
For changing the ring of the Bpoly to new_tailBin.
KINLINE void SetShortExpVector()
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static CanonicalForm bound(const CFMatrix &M)
static poly p_LmDeleteAndNext(poly p, const ring r)
KINLINE unsigned long * initsevT()
KINLINE poly redtailBba_Z(poly p, int pos, kStrategy strat)
KINLINE void Set(ring r=currRing)
KINLINE poly GetP(omBin lmBin=(omBin) NULL)
KINLINE sLObject & operator=(const sTObject &)
Compatiblity layer for legacy polynomial operations (over currRing)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
KINLINE int ksReducePolyTail(LObject *PR, TObject *PW, LObject *Red)
static BOOLEAN rIsSyzIndexRing(const ring r)
#define TEST_OPT_CONTENTSB
int kFindInT(poly p, TSet T, int tlength)
returns index of p in TSet, or -1 if not found
KINLINE sLObject(ring tailRing=currRing)
KINLINE void Init(ring r=currRing)
KINLINE int ksReducePolyTailLC_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
KINLINE void HeadNormalize()
int p_mFirstVblock(poly p, const ring ri)
static poly p_LmShallowCopyDelete(poly p, const ring r)
KINLINE void CanonicalizeP()
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, kStrategy strat)
static long p_Totaldegree(poly p, const ring r)
void deleteInS(int i, kStrategy strat)
pShallowCopyDeleteProc p_shallow_copy_delete
void kBucketNormalize(kBucket_pt bucket)
apply n_Normalize to all coefficients
void p_Norm(poly p1, const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
KINLINE void Tail_Minus_mm_Mult_qq(poly m, poly qq, int lq, poly spNoether)
int(* red)(LObject *L, kStrategy strat)
KINLINE poly redtailBba(poly p, int pos, kStrategy strat, BOOLEAN normalize)
static void p_LmFree(poly p, ring)
poly kBucketExtractLm(kBucket_pt bucket)
KINLINE void PrepareRed(BOOLEAN use_bucket)
static poly p_Copy(poly p, const ring r)
returns a copy of p
KINLINE void Tail_Mult_nn(number n)
KINLINE void LmDeleteAndIter()
KINLINE void SetLmTail(poly lm, poly new_p, int length, int use_bucket, ring r)
KINLINE sTObject(ring tailRing=currRing)
void p_Cleardenom_n(poly ph, const ring r, number &c)
KINLINE poly redtailBbaBound(poly p, int pos, kStrategy strat, int bound, BOOLEAN normalize)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static long p_GetExpDiff(poly p1, poly p2, int i, ring r)
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
KINLINE TObject * S_2_T(int i)
void kBucketDestroy(kBucket_pt *bucket_pt)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
KINLINE void LmDeleteAndIter()
KINLINE BOOLEAN IsNull() const
KINLINE TObject * T_2(const skStrategy *strat)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
test whether 'a' is divisible 'b'; for r encoding a field: TRUE iff 'b' does not represent zero in Z:...
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
KINLINE void ShallowCopyDelete(ring new_tailRing, omBin new_tailBin, pShallowCopyDeleteProc p_shallow_copy_delete, BOOLEAN set_max=TRUE)
void ksCreateSpoly(LObject *Pair, poly spNoether, int use_buckets, ring tailRing, poly m1, poly m2, TObject **R)
static long p_FDeg(const poly p, const ring r)
KINLINE void SetLmCurrRing()
static FORCE_INLINE number n_QuotRem(number a, number b, number *q, const coeffs r)
static int si_max(const int a, const int b)
static poly p_Mult_nn(poly p, number n, const ring r)
static long p_MinComp(poly p, ring lmRing, ring tailRing)
KINLINE poly k_LmInit_tailRing_2_currRing(poly t_p, ring tailRing, omBin lmBin)
static unsigned pLength(poly a)
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
KINLINE void pCleardenom()
KINLINE poly ksOldSpolyRedNew(poly p1, poly p2, poly spNoether)
static void p_Delete(poly *p, const ring r)
KINLINE poly k_LmShallowCopyDelete_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
static number Init(long i, const coeffs r)
unsigned long p_GetShortExpVector(const poly p, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
KINLINE poly GetLmCurrRing()
KINLINE long pTotalDeg() const
#define __p_Mult_nn(p, n, r)
void mult(unsigned long *result, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
static BOOLEAN rField_is_Ring(const ring r)
KINLINE void Mult_nn(number n)
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
poly p_Last(const poly p, int &l, const ring r)
KINLINE poly GetLmTailRing()
static BOOLEAN length(leftv result, leftv arg)
KINLINE int SetLength(BOOLEAN lengt_pLength=FALSE)
KINLINE long SetDegStuffReturnLDeg()
static poly p_LmInit(poly p, const ring r)
static void p_Setm(poly p, const ring r)
KINLINE void clearS(poly p, unsigned long p_sev, int *at, int *k, kStrategy strat)
KINLINE TObject * s_2_t(int i)
static poly p_Minus_mm_Mult_qq(poly p, const poly m, const poly q, int &lp, int lq, const poly spNoether, const ring r)
KINLINE void k_GetStrongLeadTerms(const poly p1, const poly p2, const ring leadRing, poly &m1, poly &m2, poly &lcm, const ring tailRing)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
KINLINE poly LmExtractAndIter()
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
KINLINE poly GetLm(ring r)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
int kBucketCanonicalize(kBucket_pt bucket)
Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in one bucket: Returns number of bu...
static poly p_Init(const ring r, omBin bin)
KINLINE poly kNoetherTail()
VAR denominator_list DENOMINATOR_LIST
KINLINE BOOLEAN arriRewDummy(poly, unsigned long, poly, kStrategy, int)
KINLINE poly k_LmShallowCopyDelete_tailRing_2_currRing(poly p, ring tailRing, omBin lmBin)
void kBucketDeleteAndDestroy(kBucket_pt *bucket_pt)
KINLINE void T_1_2(const skStrategy *strat, TObject *&T_1, TObject *&T_2)
void p_ProjectiveUnique(poly ph, const ring r)
KINLINE int ksReducePolyTail_Z(LObject *PR, TObject *PW, LObject *Red)
KINLINE long SetDegStuffReturnLDeg()
poly p_GetMaxExpP(poly p, const ring r)
return monomial r such that GetExp(r,i) is maximum of all monomials in p; coeff == 0...
KINLINE long pFDeg() const
KINLINE TObject * T_1(const skStrategy *strat)
KINLINE void ShallowCopyDelete(ring new_tailRing, pShallowCopyDeleteProc p_shallow_copy_delete)
KINLINE long GetpFDeg() const