| 85 | |
| 86 | #ifdef STDZ_EXCHANGE_DURING_REDUCTION |
| 87 | int kFindSameLMInT_Z(const kStrategy strat, const LObject* L, const int start) |
| 88 | { |
| 89 | unsigned long not_sev = ~L->sev; |
| 90 | int j = start; |
| 91 | int o = -1; |
| 92 | |
| 93 | const TSet T=strat->T; |
| 94 | const unsigned long* sevT=strat->sevT; |
| 95 | number gcd, ogcd; |
| 96 | if (L->p!=NULL) |
| 97 | { |
| 98 | const ring r=currRing; |
| 99 | const poly p=L->p; |
| 100 | ogcd = pGetCoeff(p); |
| 101 | |
| 102 | pAssume(~not_sev == p_GetShortExpVector(p, r)); |
| 103 | |
| 104 | loop |
| 105 | { |
| 106 | if (j > strat->tl) return o; |
| 107 | if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r) && p_LmEqual(T[j].p, p, r)) |
| 108 | { |
| 109 | gcd = n_Gcd(pGetCoeff(p), pGetCoeff(T[j].p), r->cf); |
| 110 | if (o == -1 |
| 111 | || n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf)) |
| 112 | { |
| 113 | ogcd = gcd; |
| 114 | o = j; |
| 115 | } |
| 116 | } |
| 117 | j++; |
| 118 | } |
| 119 | } |
| 120 | else |
| 121 | { |
no test coverage detected