MCPcopy Create free account
hub / github.com/Singular/Singular / kSplitAt

Function kSplitAt

kernel/GBEngine/kLiftstd.cc:28–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#endif
27
28static poly kSplitAt(int k,TObject* h,kStrategy strat)
29{
30 poly p;
31 if (h->t_p==NULL)
32 {
33 if (currRing!=strat->tailRing)
34 {
35 h->t_p=k_LmInit_currRing_2_tailRing(h->p, strat->tailRing);
36 p=h->t_p;
37 }
38 else
39 p=h->p;
40 }
41 else
42 p=h->t_p;
43 if (p->next==NULL) return NULL;
44 const ring tailRing=strat->tailRing;
45 while(p_GetComp(p->next,tailRing)<=k)
46 {
47 pIter(p);
48 if ((p==NULL)||(p->next==NULL))
49 {
50 h->pLength=0; // force re-computation
51 return NULL;
52 }
53 }
54 poly t=p->next;
55 p->next=NULL;
56 h->pLength=0; // force re-computation
57 if ((h->p!=NULL) && (h->t_p!=NULL)
58 && (pNext(h->p)!=pNext(h->t_p)))
59 {
60 pNext(h->p)=pNext(h->t_p);
61 }
62 return t;
63}
64static poly kSplitAt(int k,LObject* h,kStrategy strat)
65{
66 poly p,pr,t=NULL;

Callers 2

redLiftstdFunction · 0.85
kLiftstd.ccFile · 0.85

Calls 4

pLengthFunction · 0.85
kBucketInitFunction · 0.85
kBucketClearFunction · 0.50

Tested by

no test coverage detected