| 117 | |
| 118 | |
| 119 | static int doRed (LObject* h, TObject* with,BOOLEAN intoT,kStrategy strat, bool redMoraNF) |
| 120 | { |
| 121 | int ret; |
| 122 | #if KDEBUG > 0 |
| 123 | kTest_L(h); |
| 124 | kTest_T(with); |
| 125 | #endif |
| 126 | // Hmmm ... why do we do this -- polys from T should already be normalized |
| 127 | if (!TEST_OPT_INTSTRATEGY) |
| 128 | with->pNorm(); |
| 129 | #ifdef KDEBUG |
| 130 | if (TEST_OPT_DEBUG) |
| 131 | { |
| 132 | PrintS("reduce ");h->wrp();PrintS(" with ");with->wrp();PrintLn(); |
| 133 | } |
| 134 | #endif |
| 135 | if (intoT) |
| 136 | { |
| 137 | // need to do it exactly like this: otherwise |
| 138 | // we might get errors |
| 139 | LObject L= *h; |
| 140 | L.Copy(); |
| 141 | h->GetP(); |
| 142 | h->length=h->pLength=pLength(h->p); |
| 143 | ret = ksReducePoly(&L, with, strat->kNoetherTail(), NULL, NULL, strat); |
| 144 | if (ret) |
| 145 | { |
| 146 | if (ret < 0) return ret; |
| 147 | if (h->tailRing != strat->tailRing) |
| 148 | h->ShallowCopyDelete(strat->tailRing, |
| 149 | pGetShallowCopyDeleteProc(h->tailRing, |
| 150 | strat->tailRing)); |
| 151 | } |
| 152 | if(redMoraNF && (rField_is_Ring(currRing))) |
| 153 | enterT_strong(*h,strat); |
| 154 | else |
| 155 | enterT(*h,strat); |
| 156 | *h = L; |
| 157 | } |
| 158 | else |
| 159 | ret = ksReducePoly(h, with, strat->kNoetherTail(), NULL, NULL, strat); |
| 160 | #ifdef KDEBUG |
| 161 | if (TEST_OPT_DEBUG) |
| 162 | { |
| 163 | PrintS("to ");h->wrp();PrintLn(); |
| 164 | } |
| 165 | #endif |
| 166 | return ret; |
| 167 | } |
| 168 | |
| 169 | int redEcart (LObject* h,kStrategy strat) |
| 170 | { |
no test coverage detected