101 if (
p->next==
NULL)
break;
132static poly
lazyComp(number*
A, poly*
M,poly*
T,
int index,poly
s,
int *
l,
const ring tailR)
138 for(
int i=0;
i<index;
i++)
141 n_Delete(&
A[
i],tailR->cf);
146 int dummy=pLength(tt);
149 p_Delete(&
M[
i],tailR);
169 if (strat->
tl<0)
return 1;
173 int i,
j,pass,ei, ii, h_d,ci;
174 unsigned long not_sev;
176 #define START_REDUCE 512
178 number *
A=(number*)
omAlloc0(red_size*
sizeof(number));
179 poly *C=(poly*)
omAlloc0(red_size*
sizeof(poly));
180 poly *
T=(poly*)
omAlloc0(red_size*
sizeof(poly));
181 const ring tailRing=strat->
tailRing;
184 d = reddeg =
h->GetpFDeg() +
h->ecart;
185 h->SetShortExpVector();
187 h_p =
h->GetLmTailRing();
210 ei = strat->
T[
j].ecart;
211 li = strat->
T[
j].pLength;
212 ci =
nSize(pGetCoeff(strat->
T[
j].p));
221 if (li<=0) li=strat->
T[
j].GetpLength();
231 if ((((strat->
T[
i].ecart < ei) && (ei>
h->ecart))
232 || ((strat->
T[
i].ecart <=
h->ecart)
233 && (strat->
T[
i].pLength <= li)
234 && (
nSize(pGetCoeff(strat->
T[
i].p)) <ci)))
236 p_LmShortDivisibleBy(strat->
T[
i].GetLmTailRing(), strat->
sevT[
i],
237 h_p, not_sev, tailRing))
242 ei = strat->
T[
i].ecart;
243 li = strat->
T[
i].pLength;
244 if (li<=0) li=strat->
T[
i].GetpLength();
259 Print(
"\nwith T[%d]:",ii);
268 int l_orig=strat->
T[ii].pLength;
275 strat->
T[ii].pLength=l_orig;
290 for(
int i=0;
i<=pass;
i++)
292 n_Delete(&
A[
i],tailRing->cf);
293 p_Delete(&C[
i],tailRing);
295 p_Delete(&h_tail,tailRing);
303 h->SetShortExpVector();
310 h->ecart = d-h_d+ei-
h->ecart;
322 if (pass>=red_size-1)
324 A=(number*)
omRealloc0Size(
A,red_size*
sizeof(number),2*red_size*
sizeof(number));
325 C=(poly*)
omRealloc0Size(C,red_size*
sizeof(poly),2*red_size*
sizeof(poly));
339 for(
int i=e-1;
i>=0;
i--)
360 if (
k==0) { lsmod=1;
k=1;}
371 if (orig_ring != syz_ring)
384 p_Shift(&s_quot->m[
i],lsmod,syz_ring);
386 p_SetComp(
p,
k+
i+2,syz_ring);
388 s_quot->m[
i]=p_Add_q(s_quot->m[
i],
p,syz_ring);
405 p_SetComp(
p,u_k+
i,syz_ring);
407 s_A->m[
i]=p_Add_q(s_A->m[
i],
p,syz_ring);
428 ideal rest=
kNF(s_quot,syz_ring->qideal,s_A,0,lazyReduce);
457 d=p_Add_q(d,q,syz_ring);
515 d=p_Add_q(d,q,syz_ring);
525 if (orig_ring != syz_ring)
532 *unit=
idrMoveR(*unit, syz_ring, orig_ring);
const CanonicalForm int s
void ipPrint_MA0(matrix m, const char *name)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
KINLINE poly k_LmInit_currRing_2_tailRing(poly p, ring tailRing, omBin tailBin)
int redLiftstd(LObject *h, kStrategy strat)
static poly lazyComp(number *A, poly *M, poly *T, int index, poly s, int *l, const ring tailR)
static void kAppend(poly t, TObject *h)
ideal idDivRem(ideal A, const ideal quot, ideal &factor, ideal *unit, int lazyReduce)
static void setUnit(int e, ideal *unit)
static poly kSplitAt(int k, TObject *h, kStrategy strat)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
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...
void kBucket_Mult_n(kBucket_pt bucket, number n)
Multiply Bucket by number ,i.e. Bpoly == n*Bpoly.
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
int kBucketCanonicalize(kBucket_pt bucket)
Canonicalizes Bpoly, i.e. converts polys of buckets into one poly in one bucket: Returns number of bu...
int ksReducePoly(LObject *PR, TObject *PW, poly spNoether, number *coef, poly *mon, kStrategy strat, BOOLEAN reduce)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
int kFindDivisibleByInT(const kStrategy strat, const LObject *L, const int start)
return -1 if no divisor is found number of first divisor in T, otherwise
#define omFreeSize(addr, size)
#define omRealloc0Size(addr, o_size, size)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing).
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
void PrintS(const char *s)
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
void rDelete(ring r)
unconditionally deletes fields in r
void rSetSyzComp(int k, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
matrix id_Module2Matrix(ideal mod, const ring R)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int name
New type name for int.