* Implementation of the first alternative Groebner Walk Algorithm * *******************************************************************/
| 9670 | * Implementation of the first alternative Groebner Walk Algorithm * |
| 9671 | *******************************************************************/ |
| 9672 | ideal MAltwalk1(ideal Go, int op_deg, int tp_deg, intvec* curr_weight, |
| 9673 | intvec* target_weight) |
| 9674 | { |
| 9675 | Set_Error(FALSE ); |
| 9676 | Overflow_Error = FALSE; |
| 9677 | #ifdef TIME_TEST |
| 9678 | BOOLEAN nOverflow_Error = FALSE; |
| 9679 | #endif |
| 9680 | // Print("// pSetm_Error = (%d)", ErrorCheck()); |
| 9681 | |
| 9682 | #ifdef TIME_TEST |
| 9683 | xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0; |
| 9684 | xftinput = clock(); |
| 9685 | clock_t tostd, tproc; |
| 9686 | #endif |
| 9687 | |
| 9688 | nstep = 0; |
| 9689 | int i, nV = currRing->N; |
| 9690 | int nwalk=0, endwalks=0; |
| 9691 | int op_tmp = op_deg; |
| 9692 | ideal Gomega, M, F, G, Gomega1, Gomega2, M1, F1; |
| 9693 | ring newRing, oldRing; |
| 9694 | intvec* next_weight; |
| 9695 | intvec* iv_M_dp; |
| 9696 | intvec* ivNull = new intvec(nV); |
| 9697 | intvec* iv_dp = MivUnit(nV);// define (1,1,...,1) |
| 9698 | intvec* exivlp = Mivlp(nV); |
| 9699 | //intvec* extra_curr_weight = new intvec(nV); |
| 9700 | #ifndef BUCHBERGER_ALG |
| 9701 | intvec* hilb_func; |
| 9702 | #endif |
| 9703 | intvec* cw_tmp = curr_weight; |
| 9704 | |
| 9705 | // to avoid (1,0,...,0) as the target vector |
| 9706 | intvec* last_omega = new intvec(nV); |
| 9707 | for(i=nV-1; i>0; i--) |
| 9708 | { |
| 9709 | (*last_omega)[i] = 1; |
| 9710 | } |
| 9711 | (*last_omega)[0] = 10000; |
| 9712 | |
| 9713 | ring XXRing = currRing; |
| 9714 | |
| 9715 | #ifdef TIME_TEST |
| 9716 | to=clock(); |
| 9717 | #endif |
| 9718 | /* compute a pertubed weight vector of the original weight vector. |
| 9719 | The perturbation degree is recursive decrease until that vector |
| 9720 | stays inn the correct cone. */ |
| 9721 | while(1) |
| 9722 | { |
| 9723 | if(Overflow_Error == FALSE) |
| 9724 | { |
| 9725 | if(MivComp(curr_weight, iv_dp) == 1) |
| 9726 | { |
| 9727 | //rOrdStr(currRing) = "dp" |
| 9728 | if(op_tmp == op_deg) |
| 9729 | { |
no test coverage detected