THE NEW GROEBNER WALK ALGORITHM Groebnerwalk with a recursive "second" alternative GW, called REC_GB_Mwalk that only computes the last reduced GB
| 5026 | // THE NEW GROEBNER WALK ALGORITHM |
| 5027 | // Groebnerwalk with a recursive "second" alternative GW, called REC_GB_Mwalk that only computes the last reduced GB |
| 5028 | ideal MwalkAlt(ideal Go, intvec* curr_weight, intvec* target_weight) |
| 5029 | { |
| 5030 | Set_Error(FALSE); |
| 5031 | Overflow_Error = FALSE; |
| 5032 | //Print("// pSetm_Error = (%d)", ErrorCheck()); |
| 5033 | |
| 5034 | #ifdef TIME_TEST |
| 5035 | clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0; |
| 5036 | tinput = clock(); |
| 5037 | clock_t tim; |
| 5038 | xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; |
| 5039 | #endif |
| 5040 | nstep=0; |
| 5041 | int i; |
| 5042 | int nV = currRing->N; |
| 5043 | int nwalk=0; |
| 5044 | int endwalks=0; |
| 5045 | |
| 5046 | ideal Gomega, M, F, Gomega1, Gomega2, M1, F1, G; |
| 5047 | |
| 5048 | ring newRing, oldRing; |
| 5049 | intvec* ivNull = new intvec(nV); |
| 5050 | intvec* exivlp = Mivlp(nV); |
| 5051 | #ifndef BUCHBERGER_ALG |
| 5052 | intvec* hilb_func; |
| 5053 | #endif |
| 5054 | intvec* tmp_weight = new intvec(nV); |
| 5055 | for(i=nV-1; i>=0; i--) |
| 5056 | (*tmp_weight)[i] = (*curr_weight)[i]; |
| 5057 | |
| 5058 | // to avoid (1,0,...,0) as the target vector |
| 5059 | intvec* last_omega = new intvec(nV); |
| 5060 | for(i=nV-1; i>0; i--) |
| 5061 | (*last_omega)[i] = 1; |
| 5062 | (*last_omega)[0] = 10000; |
| 5063 | |
| 5064 | ring XXRing = currRing; |
| 5065 | |
| 5066 | #ifdef TIME_TEST |
| 5067 | to = clock(); |
| 5068 | #endif |
| 5069 | // the monomial ordering of this current ring would be "dp" |
| 5070 | G = MstdCC(Go); |
| 5071 | #ifdef TIME_TEST |
| 5072 | tostd = clock()-to; |
| 5073 | #endif |
| 5074 | |
| 5075 | if(currRing->order[0] == ringorder_a) |
| 5076 | goto NEXT_VECTOR; |
| 5077 | |
| 5078 | while(1) |
| 5079 | { |
| 5080 | nwalk ++; |
| 5081 | nstep ++; |
| 5082 | #ifdef TIME_TEST |
| 5083 | to = clock(); |
| 5084 | #endif |
| 5085 | // compute an initial form ideal of <G> w.r.t. "curr_vector" |
nothing calls this directly
no test coverage detected