* THE GROEBNER WALK ALGORITHM * *******************************/
| 5301 | * THE GROEBNER WALK ALGORITHM * |
| 5302 | *******************************/ |
| 5303 | ideal Mwalk(ideal Go, intvec* orig_M, intvec* target_M, |
| 5304 | ring baseRing, int reduction, int printout) |
| 5305 | { |
| 5306 | // save current options |
| 5307 | BITSET save1 = si_opt_1; |
| 5308 | if(reduction == 0) |
| 5309 | { |
| 5310 | si_opt_1 &= (~Sy_bit(OPT_REDSB)); // no reduced Groebner basis |
| 5311 | si_opt_1 &= (~Sy_bit(OPT_REDTAIL)); // not tail reductions |
| 5312 | } |
| 5313 | Set_Error(FALSE); |
| 5314 | Overflow_Error = FALSE; |
| 5315 | //BOOLEAN endwalks = FALSE; |
| 5316 | #ifdef TIME_TEST |
| 5317 | clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0; |
| 5318 | xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; |
| 5319 | tinput = clock(); |
| 5320 | clock_t tim; |
| 5321 | #endif |
| 5322 | nstep=0; |
| 5323 | int i,nwalk; |
| 5324 | int nV = baseRing->N; |
| 5325 | |
| 5326 | ideal Gomega, M, F, FF, Gomega1, Gomega2, M1; |
| 5327 | ring newRing; |
| 5328 | ring XXRing = baseRing; |
| 5329 | ring targetRing; |
| 5330 | intvec* ivNull = new intvec(nV); |
| 5331 | intvec* curr_weight = new intvec(nV); |
| 5332 | intvec* target_weight = new intvec(nV); |
| 5333 | intvec* exivlp = Mivlp(nV); |
| 5334 | /* |
| 5335 | intvec* tmp_weight = new intvec(nV); |
| 5336 | for(i=0; i<nV; i++) |
| 5337 | { |
| 5338 | (*tmp_weight)[i] = (*orig_M)[i]; |
| 5339 | } |
| 5340 | */ |
| 5341 | for(i=0; i<nV; i++) |
| 5342 | { |
| 5343 | (*curr_weight)[i] = (*orig_M)[i]; |
| 5344 | (*target_weight)[i] = (*target_M)[i]; |
| 5345 | } |
| 5346 | #ifndef BUCHBERGER_ALG |
| 5347 | intvec* hilb_func; |
| 5348 | // to avoid (1,0,...,0) as the target vector |
| 5349 | intvec* last_omega = new intvec(nV); |
| 5350 | for(i=nV-1; i>0; i--) |
| 5351 | { |
| 5352 | (*last_omega)[i] = 1; |
| 5353 | } |
| 5354 | (*last_omega)[0] = 10000; |
| 5355 | #endif |
| 5356 | rComplete(currRing); |
| 5357 | #ifdef CHECK_IDEAL_MWALK |
| 5358 | if(printout > 2) |
| 5359 | { |
| 5360 | idString(Go,"//** Mwalk: Go"); |
no test coverage detected