6410 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
6412 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
6418 int i, ntwC=1, ntestw=1, nV =
currRing->N;
6428 if(op_deg < 1 || tp_deg < 1 || op_deg > nV || tp_deg > nV)
6430 WerrorS(
"Invalid perturbation degree.\n");
6436 ideal Gomega,
M, F, FF,
G, Gomega1, Gomega2, M1,F1,Eresult,ssG;
6437 ring newRing, oldRing, TargetRing;
6446 (*curr_weight)[
i] = (*orig_M)[
i];
6447 (*target_weight)[
i] = (*target_M)[
i];
6449 intvec* orig_target = target_weight;
6450 intvec* pert_target_vector = target_weight;
6453 #ifndef BUCHBERGER_ALG 6460 for(
i=nV-1;
i>0;
i--)
6461 (*last_omega)[
i] = 1;
6462 (*last_omega)[0] = 10000;
6467 if(orig_M->
length() == nV)
6469 if(
MivComp(curr_weight, iv_dp) == 1)
6525 if(op_deg != 1)
delete iv_M_dp;
6530 if(target_M->
length() == nV)
6532 if(tp_deg > 1 && tp_deg <= nV)
6541 if(
MivSame(target_weight, exivlp) == 1)
6552 pert_target_vector = target_weight;
6559 if(tp_deg > 1 && tp_deg <= nV)
6569 Print(
"\n//** Mprwalk: Random Perturbation Walk of degree (%d,%d):",op_deg,tp_deg);
6570 ivString(curr_weight,
"//** Mprwalk: new current weight");
6571 ivString(target_weight,
"//** Mprwalk: new target weight");
6579 tif = tif + clock()-to;
6585 #ifdef CHECK_IDEAL_MWALK 6588 idString(Gomega,
"//** Mprwalk: Gomega");
6605 if(endwalks ==
TRUE)
6616 #ifndef BUCHBERGER_ALG 6617 if(isNolVector(curr_weight) == 0)
6621 #endif // BUCHBERGER_ALG 6625 if(target_M->
length() == nV)
6642 if(endwalks ==
TRUE)
6651 PrintS(
"\n// compute a rGB of Gw:\n");
6653 #ifndef BUCHBERGER_ALG 6663 #ifdef BUCHBERGER_ALG 6669 #ifdef CHECK_IDEAL_MWALK 6676 if(endwalks ==
TRUE)
6678 xtstd = xtstd+clock()-to;
6680 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6681 ((
double) clock())/1000000 -((
double)tim) /1000000);
6685 tstd=tstd+clock()-to;
6699 if(endwalks ==
FALSE)
6700 tlift = tlift+clock()-to;
6704 #ifdef CHECK_IDEAL_MWALK 6726 PrintS(
"\n //** Mprwalk: reduce the Groebner basis.\n");
6733 if(endwalks ==
FALSE)
6734 tred = tred+clock()-to;
6741 if(endwalks ==
TRUE)
6750 tnw = tnw + clock() - to;
6759 tif = tif + clock()-to;
6767 PrintS(
"\n Mpwalk: there is a polynomial in Gomega with at least 3 monomials.\n");
6771 if(target_M->
length() == nV)
6784 tnw = tnw + clock() - to;
6792 tif = tif + clock()-to;
6797 #ifdef PRINT_VECTORS 6800 MivString(curr_weight, target_weight, next_weight);
6812 if(
MivComp(next_weight, ivNull) == 1){
6818 if(
MivComp(next_weight, target_weight) == 1)
6821 for(
i=nV-1;
i>=0;
i--)
6822 (*curr_weight)[
i] = (*next_weight)[
i];
6830 if(target_M->
length() == nV)
6832 if(
MivSame(orig_target, exivlp) == 1)
6855 if(ntestw != 1 || ntwC == 0)
6857 if(ntestw != 1 && printout > 2)
6859 #ifdef PRINT_VECTORS 6860 ivString(pert_target_vector,
"tau");
6862 PrintS(
"\n// **Mprwalk: perturbed target vector doesn't stay in cone.");
6871 if(nP == 0 || tp_deg == 1 ||
MivSame(orig_target, exivlp) != 1 || target_M->
length() != nV)
6875 PrintS(
"\n// ** Mprwalk: Call \"std\" to compute a Groebner basis.\n");
6884 PrintS(
"\n// **Mprwalk: Call \"LastGB\" to compute a Groebner basis.\n");
6888 eF1 =
LastGB(F2, curr_weight, tp_deg-1);
6913 delete target_weight;
6922 TimeStringFractal(tinput, tostd, tif+xtif, tstd+xtstd,0, tlift+xtlift, tred+xtred,
6931 Print(
"\n//** Mprwalk: Perturbation Walk took %d steps.\n",
nstep);
static ideal MLifttwoIdeal(ideal Gw, ideal M, ideal G)
intvec * MivMatrixOrder(intvec *iv)
static int test_w_in_ConeCC(ideal G, intvec *iv)
static int MivComp(intvec *iva, intvec *ivb)
#define idDelete(H)
delete an ideal
static ring VMatrDefault(intvec *va)
intvec * MivMatrixOrderRefine(intvec *iv, intvec *iw)
static ideal LastGB(ideal G, intvec *curr_weight, int tp_deg)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
int MivSame(intvec *u, intvec *v)
void WerrorS(const char *s)
static char const ** rParameter(const ring r)
(r->cf->parameter)
static ring VMatrRefine(intvec *va, intvec *vb)
void Set_Error(BOOLEAN f)
static void VMrDefaultlp(void)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
void PrintS(const char *s)
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
static ideal MstdhomCC(ideal G)
static intvec * MWalkRandomNextWeight(ideal G, intvec *orig_M, intvec *target_weight, int weight_rad, int pert_deg)
void rChangeCurrRing(ring r)
static void DefRingParlp(void)
static ideal MstdCC(ideal G)
static int lengthpoly(ideal G)
static void DefRingPar(intvec *va)
static ideal middleOfCone(ideal G, ideal Gomega)
void reduction(LList *sPolyList, CListOld *critPairs, LList *gPrev, RList *rules, LTagList *lTag, RTagList *rTag, ideal gbPrev, PList *rejectedGBList, int plus)
static ideal kInterRedCC(ideal F, ideal Q)
static void idString(ideal L, const char *st)
intvec * MivMatrixOrderdp(int nV)
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
static void ivString(intvec *iv, const char *ch)
ideal MwalkInitialForm(ideal G, intvec *ivw)
static ring VMrRefine(intvec *va, intvec *vb)
intvec * MivMatrixOrderlp(int nV)
static ring VMrDefault(intvec *va)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)