| 3223 | } |
| 3224 | |
| 3225 | poly kNF(ideal F, ideal Q, poly p,int syzComp, int lazyReduce) |
| 3226 | { |
| 3227 | if (p==NULL) |
| 3228 | return NULL; |
| 3229 | |
| 3230 | poly pp = p; |
| 3231 | |
| 3232 | #ifdef HAVE_PLURAL |
| 3233 | if(rIsSCA(currRing)) |
| 3234 | { |
| 3235 | const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing); |
| 3236 | const unsigned int m_iLastAltVar = scaLastAltVar(currRing); |
| 3237 | pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing); |
| 3238 | |
| 3239 | if(Q == currRing->qideal) |
| 3240 | Q = SCAQuotient(currRing); |
| 3241 | } |
| 3242 | #endif |
| 3243 | if((Q!=NULL) &&(idIs0(Q))) Q=NULL; |
| 3244 | |
| 3245 | if ((idIs0(F))&&(Q==NULL)) |
| 3246 | { |
| 3247 | #ifdef HAVE_PLURAL |
| 3248 | if(p != pp) |
| 3249 | return pp; |
| 3250 | #endif |
| 3251 | return pCopy(p); /*F+Q=0*/ |
| 3252 | } |
| 3253 | |
| 3254 | kStrategy strat=new skStrategy; |
| 3255 | strat->syzComp = syzComp; |
| 3256 | strat->ak = si_max(id_RankFreeModule(F,currRing),pMaxComp(p)); |
| 3257 | poly res; |
| 3258 | |
| 3259 | if (rHasLocalOrMixedOrdering(currRing)) |
| 3260 | { |
| 3261 | #ifdef HAVE_SHIFTBBA |
| 3262 | if (currRing->isLPring) |
| 3263 | { |
| 3264 | WerrorS("No local ordering possible for shift algebra"); |
| 3265 | return(NULL); |
| 3266 | } |
| 3267 | #endif |
| 3268 | res=kNF1(F,Q,pp,strat,lazyReduce); |
| 3269 | } |
| 3270 | else |
| 3271 | res=kNF2(F,Q,pp,strat,lazyReduce); |
| 3272 | delete(strat); |
| 3273 | |
| 3274 | #ifdef HAVE_PLURAL |
| 3275 | if(pp != p) |
| 3276 | p_Delete(&pp, currRing); |
| 3277 | #endif |
| 3278 | return res; |
| 3279 | } |
| 3280 | |
| 3281 | poly kNFBound(ideal F, ideal Q, poly p,int bound,int syzComp, int lazyReduce) |
| 3282 | { |