 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the source code of this file.
|
ideal | MwalkInitialForm (ideal G, intvec *curr_weight) |
|
intvec * | MwalkNextWeight (intvec *curr_weight, intvec *target_weight, ideal G) |
|
int | MivSame (intvec *u, intvec *v) |
|
int | M3ivSame (intvec *next_weight, intvec *u, intvec *v) |
|
intvec * | Mivdp (int nR) |
|
intvec * | Mivlp (int nR) |
|
intvec * | MivMatrixOrder (intvec *iv) |
|
intvec * | MivMatrixOrderdp (int iv) |
|
intvec * | MPertVectors (ideal G, intvec *ivtarget, int pdeg) |
|
intvec * | MPertVectorslp (ideal G, intvec *ivtarget, int pdeg) |
|
intvec * | MivMatrixOrderlp (int nV) |
|
intvec * | Mfpertvector (ideal G, intvec *iv) |
|
intvec * | MivUnit (int nV) |
|
intvec * | MivWeightOrderlp (intvec *ivstart) |
|
intvec * | MivWeightOrderdp (intvec *ivstart) |
|
ideal | MidLift (ideal Gomega, ideal M) |
|
ideal | MLiftLmalG (ideal L, ideal G) |
|
ideal | MLiftLmalGNew (ideal Gomega, ideal M, ideal G) |
|
ideal | MLiftLmalGMin (ideal L, ideal G) |
|
intvec * | MkInterRedNextWeight (intvec *iva, intvec *ivb, ideal G) |
|
intvec * | MPertNextWeight (intvec *iva, ideal G, int deg) |
|
intvec * | Mivperttarget (ideal G, int ndeg) |
|
intvec * | MSimpleIV (intvec *iv) |
|
ideal | Mwalk (ideal Go, intvec *orig_M, intvec *target_M, ring baseRing, int reduction, int printout) |
|
ideal | Mrwalk (ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int pert_deg, int reduction, int printout) |
|
ideal | Mpwalk (ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight, int nP, int reduction, int printout) |
|
ideal | Mprwalk (ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int op_deg, int tp_deg, int nP, int reduction, int printout) |
|
ideal | Mfwalk (ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout) |
|
ideal | Mfrwalk (ideal G, intvec *ivstart, intvec *ivtarget, int weight_rad, int reduction, int printout) |
|
intvec * | TranMPertVectorslp (ideal G) |
|
ideal | TranMImprovwalk (ideal Go, intvec *curr_weight, intvec *target_weight, int nP) |
|
ideal | MAltwalk1 (ideal G, int op, int tp, intvec *curr_weight, intvec *target_weight) |
|
ideal | MAltwalk2 (ideal G, intvec *curr_weight, intvec *target_weight) |
|
◆ M3ivSame()
◆ MAltwalk1()
ideal MAltwalk1 |
( |
ideal |
G, |
|
|
int |
op, |
|
|
int |
tp, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_weight |
|
) |
| |
Definition at line 9671 of file walk.cc.
9682 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0;
9684 clock_t tostd, tproc;
9689 int nwalk=0, endwalks=0;
9690 int op_tmp = op_deg;
9691 ideal Gomega,
M, F,
G, Gomega1, Gomega2, M1, F1;
9692 ring newRing, oldRing;
9699 #ifndef BUCHBERGER_ALG
9702 intvec* cw_tmp = curr_weight;
9706 for(
i=nV-1;
i>0;
i--)
9708 (*last_omega)[
i] = 1;
9710 (*last_omega)[0] = 10000;
9724 if(
MivComp(curr_weight, iv_dp) == 1)
9727 if(op_tmp == op_deg)
9739 if(op_tmp == op_deg)
9763 curr_weight = cw_tmp;
9795 xtif=xtif+clock()-to;
9800 for(
i=nV-1;
i>=0;
i--)
9801 (*curr_weight)[
i] = (*extra_curr_weight)[
i];
9802 delete extra_curr_weight;
9808 #ifndef BUCHBERGER_ALG
9809 if(isNolVector(curr_weight) == 0)
9817 #endif // BUCHBERGER_ALG
9837 #ifdef BUCHBERGER_ALG
9842 #endif // BUCHBERGER_ALG
9844 xtstd=xtstd+clock()-to;
9858 xtlift=xtlift+clock()-to;
9877 xtred=xtred+clock()-to;
9892 xtnw=xtnw+clock()-to;
9894 #ifdef PRINT_VECTORS
9895 MivString(curr_weight, target_weight, next_weight);
9918 if(
MivComp(next_weight, ivNull) == 1)
9925 if(
MivComp(next_weight, target_weight) == 1)
9927 if(tp_deg == 1 ||
MivSame(target_weight, exivlp) == 0)
9934 tproc = clock()-xftinput;
9947 for(
i=nV-1;
i>=0;
i--)
9950 (*curr_weight)[
i] = (*next_weight)[
i];
◆ MAltwalk2()
ideal MAltwalk2 |
( |
ideal |
G, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_weight |
|
) |
| |
Definition at line 4280 of file walk.cc.
4287 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0;
4289 clock_t tostd, tproc;
4293 int nwalk=0, endwalks=0;
4295 ideal Gomega,
M, F, Gomega1, Gomega2, M1, F1,
G;
4298 ring newRing, oldRing;
4316 Print(
"\n// Computation of the first std took = %.2f sec",
4317 ((
double) tostd)/1000000);
4333 xtif=xtif+clock()-to;
4363 xtstd=xtstd+clock()-to;
4376 xtlift=xtlift+clock()-to;
4391 xtred=xtred+clock()-to;
4405 xtnw=xtnw+clock()-to;
4407 #ifdef PRINT_VECTORS
4408 MivString(curr_weight, target_weight, next_weight);
4417 #ifdef TEST_OVERFLOW
4418 goto TEST_OVERFLOW_OI;
4437 if(
MivComp(next_weight, ivNull) == 1)
4444 if(
MivComp(next_weight, target_weight) == 1)
4446 if(
MivSame(target_weight, exivlp)==1)
4451 tproc = clock()-xftinput;
4463 for(
i=nV-1;
i>=0;
i--)
4466 (*curr_weight)[
i] = (*next_weight)[
i];
4470 #ifdef TEST_OVERFLOW
4482 TimeStringFractal(xftinput, tostd, xtif, xtstd, xtextra,xtlift, xtred,xtnw);
◆ Mfpertvector()
Definition at line 1512 of file walk.cc.
1521 int ntemp, maxAi, maxA=0;
1524 maxAi = (*ivtarget)[
i*nV];
1529 for(
j=
i*nV+1;
j<(
i+1)*nV;
j++)
1531 ntemp = (*ivtarget)[
j];
1541 maxA = maxA + maxAi;
1546 mpz_t tot_deg; mpz_init(tot_deg);
1547 mpz_t maxdeg; mpz_init(maxdeg);
1548 mpz_t inveps; mpz_init(inveps);
1551 for(
i=nG-1;
i>=0;
i--)
1554 if (mpz_cmp(maxdeg, tot_deg) > 0 )
1556 mpz_set(tot_deg, maxdeg);
1562 mpz_mul_ui(inveps, tot_deg, maxA);
1563 mpz_add_ui(inveps, inveps, 1);
1566 #ifdef INVEPS_SMALL_IN_FRACTAL
1567 if(mpz_cmp_ui(inveps, nV)>0 && nV > 3)
1569 mpz_cdiv_q_ui(inveps, inveps, nV);
1577 mpz_t *ivtemp=(mpz_t *)
omAlloc(nV*
sizeof(mpz_t));
1578 mpz_t *pert_vector=(mpz_t *)
omAlloc(niv*
sizeof(mpz_t));
1580 for(
i=0;
i < nV;
i++)
1582 mpz_init_set_si(ivtemp[
i], (*ivtarget)[
i]);
1583 mpz_init_set_si(pert_vector[
i], (*ivtarget)[
i]);
1586 mpz_t ztmp; mpz_init(ztmp);
1593 mpz_mul(ztmp, inveps, ivtemp[
j]);
1594 if((*ivtarget)[
i*nV+
j]<0)
1596 mpz_sub_ui(ivtemp[
j], ztmp, -(*ivtarget)[
i*nV+
j]);
1600 mpz_add_ui(ivtemp[
j], ztmp,(*ivtarget)[
i*nV+
j]);
1606 mpz_init_set(pert_vector[
i*nV+
j],ivtemp[
j]);
1612 mpz_init_set_ui(sing_int, 2147483647);
1618 mpz_set(ztmp, pert_vector[0]);
1619 for(
i=0;
i<niv;
i++)
1621 mpz_gcd(ztmp, ztmp, pert_vector[
i]);
1622 if(mpz_cmp_si(ztmp, 1)==0)
1628 for(
i=0;
i<niv;
i++)
1630 mpz_divexact(pert_vector[
i], pert_vector[
i], ztmp);
1631 (* result)[
i] = mpz_get_si(pert_vector[
i]);
1636 for(
i=0;
i<niv;
i++)
1638 if(mpz_cmp(pert_vector[
i], sing_int)>0)
1645 Print(
"\n// Xlev = %d and the %d-th element is",
Xnlev,
i+1);
1646 PrintS(
"\n// ** OVERFLOW in \"Mfpertvector\": ");
1647 mpz_out_str( stdout, 10, pert_vector[
i]);
1648 PrintS(
" is greater than 2147483647 (max. integer representation)");
1649 Print(
"\n// So vector[%d] := %d is wrong!!",
i+1, (*
result)[
i]);
1663 mpz_clear(sing_int);
◆ Mfrwalk()
ideal Mfrwalk |
( |
ideal |
G, |
|
|
intvec * |
ivstart, |
|
|
intvec * |
ivtarget, |
|
|
int |
weight_rad, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 8212 of file walk.cc.
8236 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0;
8256 #ifdef FIRST_STEP_FRACTAL
8261 && (Gw->m[
i]->next!=
NULL)
8262 && (Gw->m[
i]->next->next!=
NULL))
8266 if(ivstart->
length() == nV)
8268 if(
MivSame(ivstart, iv_dp) != 1)
8293 if(ivtarget->
length() == nV)
8333 if(ivtarget->
length() == nV)
8356 xftostd=xftostd+clock()-to;
8377 TimeStringFractal(xftinput, xftostd, xtif, xtstd, xtextra,
8378 xtlift, xtred, xtnw);
8383 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
◆ Mfwalk()
ideal Mfwalk |
( |
ideal |
G, |
|
|
intvec * |
ivstart, |
|
|
intvec * |
ivtarget, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 8031 of file walk.cc.
8049 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0;
8069 #ifdef FIRST_STEP_FRACTAL
8074 && (Gw->m[
i]->next!=
NULL)
8075 && (Gw->m[
i]->next->next!=
NULL))
8079 if(ivstart->
length() == nV)
8081 if(
MivSame(ivstart, iv_dp) != 1)
8106 if(ivtarget->
length() == nV)
8146 if(ivtarget->
length() == nV)
8169 xftostd=xftostd+clock()-to;
8190 TimeStringFractal(xftinput, xftostd, xtif, xtstd, xtextra,
8191 xtlift, xtred, xtnw);
8196 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
◆ MidLift()
ideal MidLift |
( |
ideal |
Gomega, |
|
|
ideal |
M |
|
) |
| |
◆ Mivdp()
◆ Mivlp()
◆ MivMatrixOrder()
Definition at line 963 of file walk.cc.
971 (*ivm)[
i] = (*iv)[
i];
975 (*ivm)[
i*nR+
i-1] = 1;
◆ MivMatrixOrderdp()
intvec* MivMatrixOrderdp |
( |
int |
iv | ) |
|
Definition at line 1417 of file walk.cc.
1428 (*ivM)[(
i+1)*nV -
i] = -1;
◆ MivMatrixOrderlp()
intvec* MivMatrixOrderlp |
( |
int |
nV | ) |
|
Definition at line 1401 of file walk.cc.
1408 (*ivM)[
i*nV +
i] = 1;
◆ Mivperttarget()
intvec* Mivperttarget |
( |
ideal |
G, |
|
|
int |
ndeg |
|
) |
| |
◆ MivSame()
Definition at line 893 of file walk.cc.
899 for (
i=0;
i<niv;
i++)
901 if ((*u)[
i] != (*
v)[
i])
◆ MivUnit()
◆ MivWeightOrderdp()
Definition at line 1456 of file walk.cc.
1459 int nV = ivstart->
length();
1464 (*ivM)[
i] = (*ivstart)[
i];
1472 (*ivM)[(
i+1)*nV -
i] = -1;
◆ MivWeightOrderlp()
Definition at line 1436 of file walk.cc.
1439 int nV = ivstart->
length();
1444 (*ivM)[
i] = (*ivstart)[
i];
1448 (*ivM)[
i*nV +
i-1] = 1;
◆ MkInterRedNextWeight()
◆ MLiftLmalG()
ideal MLiftLmalG |
( |
ideal |
L, |
|
|
ideal |
G |
|
) |
| |
◆ MLiftLmalGMin()
ideal MLiftLmalGMin |
( |
ideal |
L, |
|
|
ideal |
G |
|
) |
| |
◆ MLiftLmalGNew()
ideal MLiftLmalGNew |
( |
ideal |
Gomega, |
|
|
ideal |
M, |
|
|
ideal |
G |
|
) |
| |
◆ MPertNextWeight()
◆ MPertVectors()
intvec* MPertVectors |
( |
ideal |
G, |
|
|
intvec * |
ivtarget, |
|
|
int |
pdeg |
|
) |
| |
Definition at line 1088 of file walk.cc.
1098 if(pdeg > nV || pdeg <= 0)
1100 WerrorS(
"//** The perturbed degree is wrong!!");
1109 mpz_t *pert_vector = (mpz_t*)
omAlloc(nV*
sizeof(mpz_t));
1110 mpz_t *pert_vector1 = (mpz_t*)
omAlloc(nV*
sizeof(mpz_t));
1114 mpz_init_set_si(pert_vector[
i], (*ivtarget)[
i]);
1115 mpz_init_set_si(pert_vector1[
i], (*ivtarget)[
i]);
1119 int ntemp, maxAi, maxA=0;
1120 for(
i=1;
i<pdeg;
i++)
1122 maxAi = (*ivtarget)[
i*nV];
1127 for(
j=
i*nV+1;
j<(
i+1)*nV;
j++)
1129 ntemp = (*ivtarget)[
j];
1146 mpz_t tot_deg; mpz_init(tot_deg);
1147 mpz_t maxdeg; mpz_init(maxdeg);
1148 mpz_t inveps; mpz_init(inveps);
1151 for(
i=nG-1;
i>=0;
i--)
1154 if (mpz_cmp(maxdeg, tot_deg) > 0 )
1156 mpz_set(tot_deg, maxdeg);
1161 mpz_mul_ui(inveps, tot_deg, maxA);
1162 mpz_add_ui(inveps, inveps, 1);
1166 #ifdef INVEPS_SMALL_IN_MPERTVECTOR
1167 if(mpz_cmp_ui(inveps, pdeg)>0 && pdeg > 3)
1170 mpz_fdiv_q_ui(inveps, inveps, pdeg);
1175 mpz_out_str(stdout, 10, inveps);
1180 for(
i=1;
i < pdeg;
i++ )
1184 mpz_mul(pert_vector[
j], pert_vector[
j], inveps);
1185 if((*ivtarget)[
i*nV+
j]<0)
1187 mpz_sub_ui(pert_vector[
j], pert_vector[
j],-(*ivtarget)[
i*nV+
j]);
1191 mpz_add_ui(pert_vector[
j], pert_vector[
j],(*ivtarget)[
i*nV+
j]);
1198 mpz_init_set_ui(sing_int, 2147483647);
1201 mpz_init_set_ui(check_int, 100000);
1205 mpz_set(ztemp, pert_vector[0]);
1208 mpz_gcd(ztemp, ztemp, pert_vector[
i]);
1209 if(mpz_cmp_si(ztemp, 1) == 0)
1214 if(mpz_cmp_si(ztemp, 1) != 0)
1218 mpz_divexact(pert_vector[
i], pert_vector[
i], ztemp);
1224 if(mpz_cmp(pert_vector[
i], check_int)>=0)
1228 mpz_fdiv_q_ui(pert_vector1[
j], pert_vector[
j], 100);
1239 (*result)[
i] = mpz_get_si(pert_vector1[
i]);
1240 if(mpz_cmp(pert_vector1[
i], sing_int)>=0)
1250 (*result)[
i] = mpz_get_si(pert_vector[
i]);
1251 if(mpz_cmp(pert_vector[
i], sing_int)>=0)
1257 PrintS(
"\n// ** OVERFLOW in \"MPertvectors\": ");
1258 mpz_out_str( stdout, 10, pert_vector[
i]);
1259 PrintS(
" is greater than 2147483647 (max. integer representation)");
1260 Print(
"\n// So vector[%d] := %d is wrong!!",
i+1, (*
result)[
i]);
1268 Print(
"\n// %d element(s) of it is overflow!!", ntrue);
1273 mpz_clear(sing_int);
1274 mpz_clear(check_int);
◆ MPertVectorslp()
intvec* MPertVectorslp |
( |
ideal |
G, |
|
|
intvec * |
ivtarget, |
|
|
int |
pdeg |
|
) |
| |
Definition at line 1299 of file walk.cc.
1309 if(pdeg > nV || pdeg <= 0)
1311 WerrorS(
"//** The perturbed degree is wrong!!");
1316 (*pert_vector)[
i]=(*ivtarget)[
i];
1324 int ntemp, maxAi, maxA=0;
1325 for(
i=1;
i<pdeg;
i++)
1327 maxAi = (*ivtarget)[
i*nV];
1328 for(
j=
i*nV+1;
j<(
i+1)*nV;
j++)
1330 ntemp = (*ivtarget)[
j];
1340 int inveps, tot_deg = 0, maxdeg;
1343 for(
i=nG-1;
i>=0;
i--)
1347 if (maxdeg > tot_deg )
1354 inveps = (tot_deg * maxA) + 1;
1356 #ifdef INVEPS_SMALL_IN_FRACTAL
1358 if(inveps > pdeg && pdeg > 3)
1360 inveps = inveps / pdeg;
1364 PrintS(
"\n// the \"big\" inverse epsilon %d", inveps);
1368 for (
i=1;
i < pdeg;
i++ )
1372 (*pert_vector)[
j] = inveps*((*pert_vector)[
j]) + (*ivtarget)[
i*nV+
j];
1376 int temp = (*pert_vector)[0];
1379 temp =
gcd(temp, (*pert_vector)[
i]);
1389 (*pert_vector)[
i] = (*pert_vector)[
i] / temp;
◆ Mprwalk()
ideal Mprwalk |
( |
ideal |
Go, |
|
|
intvec * |
orig_M, |
|
|
intvec * |
target_M, |
|
|
int |
weight_rad, |
|
|
int |
op_deg, |
|
|
int |
tp_deg, |
|
|
int |
nP, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 6388 of file walk.cc.
6401 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
6403 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
6409 int i, ntwC=1, ntestw=1, nV =
currRing->N;
6419 if(op_deg < 1 || tp_deg < 1 || op_deg > nV || tp_deg > nV)
6421 WerrorS(
"Invalid perturbation degree.\n");
6427 ideal Gomega,
M, F, FF,
G, Gomega1, Gomega2, M1,F1,Eresult,ssG;
6428 ring newRing, oldRing, TargetRing;
6437 (*curr_weight)[
i] = (*orig_M)[
i];
6438 (*target_weight)[
i] = (*target_M)[
i];
6440 intvec* orig_target = target_weight;
6441 intvec* pert_target_vector = target_weight;
6444 #ifndef BUCHBERGER_ALG
6451 for(
i=nV-1;
i>0;
i--)
6452 (*last_omega)[
i] = 1;
6453 (*last_omega)[0] = 10000;
6458 if(orig_M->
length() == nV)
6460 if(
MivComp(curr_weight, iv_dp) == 1)
6516 if(op_deg != 1)
delete iv_M_dp;
6521 if(target_M->
length() == nV)
6523 if(tp_deg > 1 && tp_deg <= nV)
6532 if(
MivSame(target_weight, exivlp) == 1)
6543 pert_target_vector = target_weight;
6550 if(tp_deg > 1 && tp_deg <= nV)
6560 Print(
"\n//** Mprwalk: Random Perturbation Walk of degree (%d,%d):",op_deg,tp_deg);
6561 ivString(curr_weight,
"//** Mprwalk: new current weight");
6562 ivString(target_weight,
"//** Mprwalk: new target weight");
6570 tif = tif + clock()-to;
6576 #ifdef CHECK_IDEAL_MWALK
6579 idString(Gomega,
"//** Mprwalk: Gomega");
6596 if(endwalks ==
TRUE)
6607 #ifndef BUCHBERGER_ALG
6608 if(isNolVector(curr_weight) == 0)
6612 #endif // BUCHBERGER_ALG
6616 if(target_M->
length() == nV)
6633 if(endwalks ==
TRUE)
6642 PrintS(
"\n// compute a rGB of Gw:\n");
6644 #ifndef BUCHBERGER_ALG
6654 #ifdef BUCHBERGER_ALG
6660 #ifdef CHECK_IDEAL_MWALK
6667 if(endwalks ==
TRUE)
6669 xtstd = xtstd+clock()-to;
6671 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6672 ((
double) clock())/1000000 -((
double)tim) /1000000);
6676 tstd=tstd+clock()-to;
6690 if(endwalks ==
FALSE)
6691 tlift = tlift+clock()-to;
6695 #ifdef CHECK_IDEAL_MWALK
6717 PrintS(
"\n //** Mprwalk: reduce the Groebner basis.\n");
6724 if(endwalks ==
FALSE)
6725 tred = tred+clock()-to;
6732 if(endwalks ==
TRUE)
6741 tnw = tnw + clock() - to;
6750 tif = tif + clock()-to;
6758 PrintS(
"\n Mpwalk: there is a polynomial in Gomega with at least 3 monomials.\n");
6762 if(target_M->
length() == nV)
6775 tnw = tnw + clock() - to;
6783 tif = tif + clock()-to;
6788 #ifdef PRINT_VECTORS
6791 MivString(curr_weight, target_weight, next_weight);
6803 if(
MivComp(next_weight, ivNull) == 1){
6809 if(
MivComp(next_weight, target_weight) == 1)
6812 for(
i=nV-1;
i>=0;
i--)
6813 (*curr_weight)[
i] = (*next_weight)[
i];
6821 if(target_M->
length() == nV)
6823 if(
MivSame(orig_target, exivlp) == 1)
6846 if(ntestw != 1 || ntwC == 0)
6848 if(ntestw != 1 && printout > 2)
6850 #ifdef PRINT_VECTORS
6851 ivString(pert_target_vector,
"tau");
6853 PrintS(
"\n// **Mprwalk: perturbed target vector doesn't stay in cone.");
6862 if(nP == 0 || tp_deg == 1 ||
MivSame(orig_target, exivlp) != 1 || target_M->
length() != nV)
6866 PrintS(
"\n// ** Mprwalk: Call \"std\" to compute a Groebner basis.\n");
6875 PrintS(
"\n// **Mprwalk: Call \"LastGB\" to compute a Groebner basis.\n");
6879 eF1 =
LastGB(F2, curr_weight, tp_deg-1);
6904 delete target_weight;
6913 TimeStringFractal(tinput, tostd, tif+xtif, tstd+xtstd,0, tlift+xtlift, tred+xtred,
6922 Print(
"\n//** Mprwalk: Perturbation Walk took %d steps.\n",
nstep);
◆ Mpwalk()
ideal Mpwalk |
( |
ideal |
Go, |
|
|
int |
op_deg, |
|
|
int |
tp_deg, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_weight, |
|
|
int |
nP, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 5947 of file walk.cc.
5960 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
5962 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
5968 int i, ntwC=1, ntestw=1, nV =
currRing->N;
5971 if(op_deg < 1 || tp_deg < 1 || op_deg > nV || tp_deg > nV)
5973 WerrorS(
"Invalid perturbation degree.\n");
5978 ideal Gomega,
M, F, FF,
G, Gomega1, Gomega2, M1,F1,Eresult,ssG;
5979 ring newRing, oldRing, TargetRing;
5983 intvec* orig_target = target_weight;
5984 intvec* pert_target_vector = target_weight;
5987 #ifndef BUCHBERGER_ALG
5994 for(
i=nV-1;
i>0;
i--)
5995 (*last_omega)[
i] = 1;
5996 (*last_omega)[0] = 10000;
6003 if(
MivComp(curr_weight, iv_dp) == 1)
6037 if(op_deg != 1)
delete iv_M_dp;
6042 if(tp_deg > 1 && tp_deg <= nV)
6054 if(
MivSame(target_weight, exivlp) == 1)
6065 pert_target_vector = target_weight;
6071 Print(
"\n//** Mpwalk: Perturbation Walk of degree (%d,%d):",op_deg,tp_deg);
6072 #ifdef PRINT_VECTORS
6073 ivString(curr_weight,
"//** Mpwalk: new current weight");
6074 ivString(target_weight,
"//** Mpwalk: new target weight");
6087 tif = tif + clock()-to;
6089 #ifdef CHECK_IDEAL_MWALK
6092 idString(Gomega,
"//** Mpwalk: Gomega");
6108 if(endwalks ==
TRUE)
6119 #ifndef BUCHBERGER_ALG
6120 if(isNolVector(curr_weight) == 0)
6124 #endif // BUCHBERGER_ALG
6148 PrintS(
"\n// compute a rGB of Gw:\n");
6150 #ifndef BUCHBERGER_ALG
6160 #ifdef BUCHBERGER_ALG
6167 if(endwalks ==
TRUE)
6170 xtstd = xtstd+clock()-to;
6176 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6177 ((
double) clock())/1000000 -((
double)tim) /1000000);
6185 tstd=tstd+clock()-to;
6188 #ifdef CHECK_IDEAL_MWALK
6206 if(endwalks ==
FALSE)
6207 tlift = tlift+clock()-to;
6211 #ifdef CHECK_IDEAL_MWALK
6233 PrintS(
"\n //** Mpwalk: reduce the Groebner basis.\n");
6240 if(endwalks ==
FALSE)
6241 tred = tred+clock()-to;
6247 if(endwalks ==
TRUE)
6259 #ifdef PRINT_VECTORS
6262 MivString(curr_weight, target_weight, next_weight);
6275 if(
MivComp(next_weight, ivNull) == 1){
6281 if(
MivComp(next_weight, target_weight) == 1)
6284 for(
i=nV-1;
i>=0;
i--)
6285 (*curr_weight)[
i] = (*next_weight)[
i];
6293 if(
MivSame(orig_target, exivlp) == 1) {
6317 if( ntestw != 1 || ntwC == 0)
6319 if(ntestw != 1 && printout >2)
6321 ivString(pert_target_vector,
"tau");
6322 PrintS(
"\n// ** perturbed target vector doesn't stay in cone!!");
6331 if(nP == 0 || tp_deg == 1 ||
MivSame(orig_target, exivlp) != 1){
6340 eF1 =
LastGB(F2, curr_weight, tp_deg-1);
6363 delete target_weight;
6372 TimeStringFractal(tinput, tostd, tif+xtif, tstd+xtstd,0, tlift+xtlift, tred+xtred,
6380 Print(
"\n//** Mpwalk: Perturbation Walk took %d steps.\n",
nstep);
◆ Mrwalk()
ideal Mrwalk |
( |
ideal |
Go, |
|
|
intvec * |
orig_M, |
|
|
intvec * |
target_M, |
|
|
int |
weight_rad, |
|
|
int |
pert_deg, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 5603 of file walk.cc.
5616 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
5617 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
5633 if(pert_deg > nV || pert_deg < 1)
5635 WerrorS(
"Invalid perturbation degree.\n");
5639 ideal Gomega,
M, F,FF, Gomega1, Gomega2, M1;
5652 (*curr_weight)[
i] = (*orig_M)[
i];
5653 (*target_weight)[
i] = (*target_M)[
i];
5656 #ifndef BUCHBERGER_ALG
5660 for(
i=nV-1;
i>0;
i--)
5662 (*last_omega)[
i] = 1;
5664 (*last_omega)[0] = 10000;
5668 if(target_M->
length() == nV)
5676 if(orig_M->
length() == nV)
5679 newRing=
VMrRefine(target_weight, curr_weight);
5701 tif = tif + clock()-to;
5708 #ifdef CHECK_IDEAL_MWALK
5711 idString(Gomega,
"//** Mrwalk: Gomega");
5725 #ifndef BUCHBERGER_ALG
5726 if(isNolVector(curr_weight) == 0)
5737 if(orig_M->
length() == nV)
5740 newRing=
VMrRefine(target_weight, curr_weight);
5749 if(target_M->
length() == nV)
5752 newRing=
VMrRefine(target_weight, curr_weight);
5766 #ifndef BUCHBERGER_ALG
5773 tstd = tstd + clock() - to;
5776 #ifdef CHECK_IDEAL_MWALK
5795 tlift = tlift + clock() - to;
5797 #ifdef CHECK_IDEAL_MWALK
5811 tstd = tstd + clock() - to;
5814 #ifdef CHECK_IDEAL_MWALK
5841 tnw = tnw + clock() - to;
5849 tif = tif + clock()-to;
5859 if(target_M->
length() == nV)
5873 tnw = tnw + clock() - to;
5881 tif = tif + clock()-to;
5887 if(
MivComp(next_weight, ivNull) == 1 ||
MivComp(target_weight,curr_weight) == 1)
5895 if(
MivComp(curr_weight,next_weight)==1)
5900 #ifdef PRINT_VECTORS
5903 MivString(curr_weight, target_weight, next_weight);
5907 for(
i=nV-1;
i>=0;
i--)
5909 (*curr_weight)[
i] = (*next_weight)[
i];
5918 #ifndef BUCHBERGER_ALG
5923 Print(
"\n//** Mrwalk: Groebner Walk took %d steps.\n",
nstep);
5926 TimeString(tinput, tostd, tif, tstd, tlift, tred, tnw,
nstep);
◆ MSimpleIV()
◆ Mwalk()
ideal Mwalk |
( |
ideal |
Go, |
|
|
intvec * |
orig_M, |
|
|
intvec * |
target_M, |
|
|
ring |
baseRing, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
Definition at line 5302 of file walk.cc.
5316 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
5317 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
5323 int nV = baseRing->N;
5325 ideal Gomega,
M, F, FF, Gomega1, Gomega2, M1;
5327 ring XXRing = baseRing;
5342 (*curr_weight)[
i] = (*orig_M)[
i];
5343 (*target_weight)[
i] = (*target_M)[
i];
5345 #ifndef BUCHBERGER_ALG
5349 for(
i=nV-1;
i>0;
i--)
5351 (*last_omega)[
i] = 1;
5353 (*last_omega)[0] = 10000;
5356 #ifdef CHECK_IDEAL_MWALK
5363 if(target_M->
length() == nV)
5372 if(orig_M->
length() == nV)
5376 newRing=
VMrRefine(target_weight, curr_weight);
5408 tif = tif + clock()-to;
5411 #ifdef CHECK_IDEAL_MWALK
5414 idString(Gomega,
"//** Mwalk: Gomega");
5423 PrintS(
"middle of Cone");
5431 #ifndef BUCHBERGER_ALG
5432 if(isNolVector(curr_weight) == 0)
5444 if(orig_M->
length() == nV)
5448 newRing=
VMrRefine(target_weight, curr_weight);
5457 if(target_M->
length() == nV)
5461 newRing=
VMrRefine(target_weight, curr_weight);
5480 #ifndef BUCHBERGER_ALG
5487 tstd = tstd + clock() - to;
5490 #ifdef CHECK_IDEAL_MWALK
5509 tlift = tlift + clock() - to;
5511 #ifdef CHECK_IDEAL_MWALK
5525 #ifdef CHECK_IDEAL_MWALK
5552 tnw = tnw + clock() - to;
5554 #ifdef PRINT_VECTORS
5557 MivString(curr_weight, target_weight, next_weight);
5562 if(
MivComp(curr_weight,next_weight)==1)
5567 if(
MivComp(target_weight,curr_weight) == 1)
5572 for(
i=nV-1;
i>=0;
i--)
5575 (*curr_weight)[
i] = (*next_weight)[
i];
5586 #ifndef BUCHBERGER_ALG
5590 TimeString(tinput, tostd, tif, tstd, tlift, tred, tnw,
nstep);
5596 Print(
"\n//** Mwalk: Groebner Walk took %d steps.\n",
nstep);
◆ MwalkInitialForm()
ideal MwalkInitialForm |
( |
ideal |
G, |
|
|
intvec * |
curr_weight |
|
) |
| |
Definition at line 761 of file walk.cc.
767 ideal Gomega =
idInit(nG, 1);
769 for(
i=nG-1;
i>=0;
i--)
◆ MwalkNextWeight()
◆ TranMImprovwalk()
ideal TranMImprovwalk |
( |
ideal |
Go, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_weight, |
|
|
int |
nP |
|
) |
| |
Definition at line 8396 of file walk.cc.
8399 clock_t mtim = clock();
8407 clock_t tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0, textra=0;
8408 clock_t tinput = clock();
8410 int nsteppert=0,
i, nV =
currRing->N, nwalk=0, npert_tmp=0;
8411 int *npert=(
int*)
omAlloc(2*nV*
sizeof(
int));
8412 ideal Gomega,
M,F, G1, Gomega1, Gomega2, M1, F1;
8414 ring newRing, oldRing, lpRing;
8422 int nGB, endwalks = 0, nwalkpert=0;
8425 #ifndef BUCHBERGER_ALG
8430 for(
i=nV-1;
i>0;
i--)
8431 (*last_omega)[
i] = 1;
8432 (*last_omega)[0] = 10000;
8436 for(
i=nV-1;
i>=0;
i--)
8437 (*target_weight)[
i] = (*target_tmp)[
i];
8446 if(
MivComp(curr_weight, iv_dp) == 1)
8462 #ifdef REPRESENTATION_OF_SIGMA
8468 if(
MivComp(curr_weight, iv_dp) == 1)
8469 MDp = MatrixOrderdp(nV);
8473 curr_weight = RepresentationMatrix_Dp(
G, MDp);
8490 tostd=tostd+clock()-to;
8493 goto COMPUTE_NEW_VECTOR;
8512 #ifndef BUCHBERGER_ALG
8513 if(isNolVector(curr_weight) == 0)
8517 #endif // BUCHBERGER_ALG
8534 #ifdef BUCHBERGER_ALG
8539 #endif // BUCHBERGER_ALG
8541 tstd=tstd+clock()-to;
8557 tlift=tlift+clock()-to;
8574 tred=tred+clock()-to;
8591 #ifdef PRINT_VECTORS
8592 MivString(curr_weight, target_weight, next_weight);
8604 OMEGA_OVERFLOW_TRAN_NEW:
8607 #ifdef TEST_OVERFLOW
8616 if(
MivSame(target_tmp, iv_lp) == 1)
8634 if(nP == 0 ||
MivSame(target_tmp, iv_lp) == 0){
8643 G =
LastGB(G1, curr_weight, nV-1);
8651 npert[endwalks]=nwalk-npert_tmp;
8660 if(
MivComp(next_weight, target_weight) == 1 ||
8661 MivComp(next_weight, curr_weight) == 1 )
8667 npert[endwalks]=nwalk-npert_tmp;
8673 if(endwalks == 1 &&
MivComp(next_weight, curr_weight) == 1){
8680 if(
MivSame(target_tmp, iv_lp) == 1)
8727 if(
p->next !=
NULL &&
8728 p->next->next !=
NULL &&
8729 p->next->next->next !=
NULL)
8734 (*vector_tmp)[
i] = (*target_weight)[
i];
8736 delete target_weight;
8739 if(
MivComp(vector_tmp, target_weight)==1)
8744 goto OMEGA_OVERFLOW_TRAN_NEW;
8751 goto OMEGA_OVERFLOW_TRAN_NEW;
8761 if(plength3 ==
FALSE)
8786 goto COMPUTE_NEW_VECTOR;
8790 for(
i=nV-1;
i>=0;
i--)
8791 (*curr_weight)[
i] = (*next_weight)[
i];
8795 #ifdef TEST_OVERFLOW
◆ TranMPertVectorslp()
intvec* TranMPertVectorslp |
( |
ideal |
G | ) |
|
static void ivString(intvec *iv, const char *ch)
static ring VMatrDefault(intvec *va)
void reduction(LList *sPolyList, CListOld *critPairs, LList *gPrev, RList *rules, LTagList *lTag, RTagList *rTag, ideal gbPrev, PList *rejectedGBList, int plus)
#define idDelete(H)
delete an ideal
void rChangeCurrRing(ring r)
static ideal kInterRedCC(ideal F, ideal Q)
static long gcd(const long a, const long b)
static ideal rec_r_fractal_call(ideal G, int nlev, intvec *ivtarget, int weight_rad, int reduction, int printout)
static int MwalkWeightDegree(poly p, intvec *weight_vector)
static ideal LastGB(ideal G, intvec *curr_weight, int tp_deg)
static void idString(ideal L, const char *st)
static int lengthpoly(ideal G)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
intvec * MivMatrixOrderRefine(intvec *iv, intvec *iw)
static ideal rec_fractal_call(ideal G, int nlev, intvec *ivtarget, int reduction, int printout)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void Set_Error(BOOLEAN f)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
static ideal Rec_LastGB(ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc)
void PrintS(const char *s)
static int MivComp(intvec *iva, intvec *ivb)
static int test_w_in_ConeCC(ideal G, intvec *iv)
int MivSame(intvec *u, intvec *v)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
intvec * MivMatrixOrderdp(int nV)
static intvec * MwalkNextWeightCC(intvec *curr_weight, intvec *target_weight, ideal G)
static poly MpolyInitialForm(poly g, intvec *curr_weight)
intvec * MivMatrixOrder(intvec *iv)
static ideal MstdCC(ideal G)
intvec * MivWeightOrderdp(intvec *ivstart)
static ring VMrDefault(intvec *va)
static intvec * MWalkRandomNextWeight(ideal G, intvec *orig_M, intvec *target_weight, int weight_rad, int pert_deg)
ideal MwalkInitialForm(ideal G, intvec *ivw)
static void DefRingPar(intvec *va)
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
void rDelete(ring r)
unconditionally deletes fields in r
intvec * MivMatrixOrderlp(int nV)
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
static void DefRingParlp(void)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void WerrorS(const char *s)
static ideal Mpwalk_MAltwalk1(ideal Go, intvec *curr_weight, int tp_deg)
static int islengthpoly2(ideal G)
static ring VMrRefine(intvec *va, intvec *vb)
static void p_Setm(poly p, const ring r)
static void VMrDefaultlp(void)
const Variable & v
< [in] a sqrfree bivariate poly
intvec * MivWeightOrderlp(intvec *ivstart)
intvec * Mfpertvector(ideal G, intvec *ivtarget)
#define pCopy(p)
return a copy of the poly
static ideal MstdhomCC(ideal G)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
static ideal MLifttwoIdeal(ideal Gw, ideal M, ideal G)
static char const ** rParameter(const ring r)
(r->cf->parameter)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
static ring VMatrRefine(intvec *va, intvec *vb)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
static ideal middleOfCone(ideal G, ideal Gomega)