| 26 | #endif |
| 27 | |
| 28 | static 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 | } |
| 64 | static poly kSplitAt(int k,LObject* h,kStrategy strat) |
| 65 | { |
| 66 | poly p,pr,t=NULL; |
no test coverage detected