* The implementation of the fractal walk algorithm with random element * * * * The main procedur Mfwalk calls the recursive Subroutine * * rec_r_fractal_call to compute the wanted Groebner basis. * * At the main procedure we compute the reduced Groebner basis w.r.t. a "fast
| 8211 | * of a matrix. This matrix defines the given monomial order, e.g. "lp" * |
| 8212 | *******************************************************************************/ |
| 8213 | ideal Mfrwalk(ideal G, intvec* ivstart, intvec* ivtarget, |
| 8214 | int weight_rad, int reduction, int printout) |
| 8215 | { |
| 8216 | BITSET save1 = si_opt_1; // save current options |
| 8217 | //check that weight radius is valid |
| 8218 | if(weight_rad < 0) |
| 8219 | { |
| 8220 | WerrorS("Invalid radius.\n"); |
| 8221 | return NULL; |
| 8222 | } |
| 8223 | if(reduction == 0) |
| 8224 | { |
| 8225 | si_opt_1 &= (~Sy_bit(OPT_REDSB)); // no reduced Groebner basis |
| 8226 | si_opt_1 &= (~Sy_bit(OPT_REDTAIL)); // not tail reductions |
| 8227 | } |
| 8228 | Set_Error(FALSE); |
| 8229 | Overflow_Error = FALSE; |
| 8230 | //Print("// pSetm_Error = (%d)", ErrorCheck()); |
| 8231 | //Print("\n// ring ro = %s;", rString(currRing)); |
| 8232 | |
| 8233 | nnflow = 0; |
| 8234 | Xngleich = 0; |
| 8235 | Xcall = 0; |
| 8236 | #ifdef TIME_TEST |
| 8237 | xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0; |
| 8238 | xftinput = clock(); |
| 8239 | #endif |
| 8240 | ring oldRing = currRing; |
| 8241 | int i, nV = currRing->N; |
| 8242 | XivNull = new intvec(nV); |
| 8243 | Xivinput = ivtarget; |
| 8244 | ngleich = 0; |
| 8245 | #ifdef TIME_TEST |
| 8246 | to=clock(); |
| 8247 | #endif |
| 8248 | ideal I = MstdCC(G); |
| 8249 | G = NULL; |
| 8250 | #ifdef TIME_TEST |
| 8251 | xftostd=clock()-to; |
| 8252 | #endif |
| 8253 | Xsigma = ivstart; |
| 8254 | |
| 8255 | Xnlev=nV; |
| 8256 | |
| 8257 | #ifdef FIRST_STEP_FRACTAL |
| 8258 | ideal Gw = MwalkInitialForm(I, ivstart); |
| 8259 | for(i=IDELEMS(Gw)-1; i>=0; i--) |
| 8260 | { |
| 8261 | if((Gw->m[i]!=NULL) // len >=0 |
| 8262 | && (Gw->m[i]->next!=NULL) // len >=1 |
| 8263 | && (Gw->m[i]->next->next!=NULL)) // len >=2 |
| 8264 | { |
| 8265 | intvec* iv_dp = MivUnit(nV); // define (1,1,...,1) |
| 8266 | intvec* Mdp; |
| 8267 | if(ivstart->length() == nV) |
| 8268 | { |
| 8269 | if(MivSame(ivstart, iv_dp) != 1) |
| 8270 | Mdp = MivWeightOrderdp(ivstart); |
no test coverage detected