18#define CHECK_IDEAL_MWALK
23#define INVEPS_SMALL_IN_FRACTAL
24#define INVEPS_SMALL_IN_MPERTVECTOR
25#define INVEPS_SMALL_IN_TRAN
27#define FIRST_STEP_FRACTAL
105 return (
unsigned long*)
omAlloc0(
maxnr*
sizeof(
unsigned long));
362 double ostd,
mostd,
mif,
mstd,
mlf,
mred,
mnw,
mxif,
mxstd,
mxlf,
mxred,
mxnw,
tot;
364 Print(
"\n// total time = %.2f sec",
totm);
365 Print(
"\n// tostd = %.2f sec = %.2f",
ostd=((
double)
tostd)/1000000,
367 Print(
"\n// tif = %.2f sec = %.2f", ((
double)
tif)/1000000,
369 Print(
"\n// std = %.2f sec = %.2f", ((
double)
tstd)/1000000,
371 Print(
"\n// lift = %.2f sec = %.2f", ((
double)
tlf)/1000000,
373 Print(
"\n// ired = %.2f sec = %.2f", ((
double)
tred)/1000000,
375 Print(
"\n// nextw = %.2f sec = %.2f", ((
double)
tnw)/1000000,
377 PrintS(
"\n Time for the last step:");
378 Print(
"\n// xinfo = %.2f sec = %.2f", ((
double)
xtif)/1000000,
380 Print(
"\n// xstd = %.2f sec = %.2f", ((
double)
xtstd)/1000000,
382 Print(
"\n// xlift = %.2f sec = %.2f", ((
double)
xtlift)/1000000,
384 Print(
"\n// xired = %.2f sec = %.2f", ((
double)
xtred)/1000000,
386 Print(
"\n// xnextw= %.2f sec = %.2f", ((
double)
xtnw)/1000000,
391 Print(
"\n// &%d&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f(%.2f)\\ \\",
392 step,
ostd,
totm,
mostd,
mif,
mstd,
mlf,
mred,
mnw,
mxif,
mxstd,
mxlf,
mxred,
mxnw,
tot,
res,
402 Print(
"\n// total time = %.2f sec",
totm);
403 Print(
"\n// tostd = %.2f sec = %.2f",
ostd=((
double)
tostd)/1000000,
405 Print(
"\n// tif = %.2f sec = %.2f", ((
double)
tif)/1000000,
407 Print(
"\n// std = %.2f sec = %.2f", ((
double)
tstd)/1000000,
409 Print(
"\n// xstd = %.2f sec = %.2f", ((
double)
textra)/1000000,
411 Print(
"\n// lift = %.2f sec = %.2f", ((
double)
tlf)/1000000,
413 Print(
"\n// ired = %.2f sec = %.2f", ((
double)
tred)/1000000,
415 Print(
"\n// nextw = %.2f sec = %.2f", ((
double)
tnw)/1000000,
419 Print(
"\n// &%.2f &%.2f&%.2f &%.2f &%.2f &%.2f &%.2f &%.2f &%.2f&%.2f&%.2f\\ \\ ",
420 ostd,
totm,
mostd,
mif,
mstd,
mextra,
mlf,
mred,
mnw,
tot,
res);
424#ifdef CHECK_IDEAL_MWALK
430 for(
i=0;
i<
nL-1;
i++)
496 Print(
"\n// intvec %s = ", ch);
498 for(
int i=0;
i<
nV;
i++)
533static inline long gcd(
const long a,
const long b)
535 long r,
p0 = a, p1 =
b;
651 PrintS(
"\n// ** OVERFLOW in \"MwalkInitialForm\": ");
653 PrintS(
" is greater than 2147483647 (max. integer representation)");
770 for(
i=
nG-1;
i>=0;
i--)
790 PrintS(
"//** the result may be WRONG, i.e. 0!!\n");
800 for(
i=
nG-1;
i>=0;
i--)
852 for(
i=n-1;
i>=0;
i--)
868 for(
i=n-1;
i>=0;
i--)
870 (*result)[
i] = (*a)[
i] - (*b)[
i];
883 for(
i=
nR-1;
i>=0;
i--)
902 if ((*u)[
i] != (*
v)[
i])
972 (*ivm)[
i] = (*iv)[
i];
976 (*ivm)[
i*
nR+
i-1] = 1;
993 (*ivm)[
i] = (*iv)[
i];
1013 for(
i=
nR-1;
i>=0;
i--)
1101 WerrorS(
"//** The perturbed degree is wrong!!");
1152 for(
i=
nG-1;
i>=0;
i--)
1167#ifdef INVEPS_SMALL_IN_MPERTVECTOR
1258 PrintS(
"\n// ** OVERFLOW in \"MPertvectors\": ");
1260 PrintS(
" is greater than 2147483647 (max. integer representation)");
1261 Print(
"\n// So vector[%d] := %d is wrong!!",
i+1, (*
result)[
i]);
1269 Print(
"\n// %d element(s) of it is overflow!!",
ntrue);
1312 WerrorS(
"//** The perturbed degree is wrong!!");
1317 (*pert_vector)[
i]=(*ivtarget)[
i];
1344 for(
i=
nG-1;
i>=0;
i--)
1357#ifdef INVEPS_SMALL_IN_FRACTAL
1377 int temp = (*pert_vector)[0];
1390 (*pert_vector)[
i] = (*pert_vector)[
i] /
temp;
1409 (*ivM)[
i*
nV +
i] = 1;
1429 (*ivM)[(
i+1)*
nV -
i] = -1;
1445 (*ivM)[
i] = (*ivstart)[
i];
1449 (*ivM)[
i*
nV +
i-1] = 1;
1465 (*ivM)[
i] = (*ivstart)[
i];
1473 (*ivM)[(
i+1)*
nV -
i] = -1;
1501 for(
i=
nV-1;
i>=0;
i--)
1552 for(
i=
nG-1;
i>=0;
i--)
1567#ifdef INVEPS_SMALL_IN_FRACTAL
1581 for(
i=0;
i <
nV;
i++)
1646 Print(
"\n// Xlev = %d and the %d-th element is",
Xnlev,
i+1);
1647 PrintS(
"\n// ** OVERFLOW in \"Mfpertvector\": ");
1649 PrintS(
" is greater than 2147483647 (max. integer representation)");
1650 Print(
"\n// So vector[%d] := %d is wrong!!",
i+1, (*
result)[
i]);
1805 if((*
iva)[
i] - (*ivb)[
i] != 0)
2288 (*diff_weight1)[
j] = (*curr_weight)[
j];
2294 (*curr_weight)[
j] = (*diff_weight1)[
j];
2298 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2306 (*diff_weight1)[
j] = (*curr_weight)[
j];
2311 (*curr_weight)[
j] = (*diff_weight1)[
j];
2313 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2321 for (
j=0;
j<
nG;
j++)
2432 (*curr_weight)[
j] = (*curr_weight)[
j]/
gcd_tmp;
2433 (*diff_weight)[
j] = (*diff_weight)[
j]/
gcd_tmp;
2437#ifdef NEXT_VECTORS_CC
2438 Print(
"\n// gcd of the weight vectors (current and target) = %d",
gcd_tmp);
2468#ifdef NEXT_VECTORS_CC
2469 Print(
"\n// j = %d ==> ",
j);
2502#ifdef NEXT_VECTORS_CC
2503 PrintS(
"\n// gcd of elements of the vector: ");
2521 PrintS(
"\n// ** OVERFLOW in \"MwalkNextWeightCC\": ");
2523 PrintS(
" is greater than 2147483647 (max. integer representation)\n");
2691 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2693 r->wvhdl[0][
i] = (*
va)[
i];
2697 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2698 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2742 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2743 r->wvhdl[1] = (
int*)
omAlloc(
nv*
sizeof(
int));
2747 r->wvhdl[0][
i] = (*vb)[
i];
2748 r->wvhdl[1][
i] = (*va)[
i];
2753 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2754 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2806 r->wvhdl[0][
i] = (*
va)[
i];
2810 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2811 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2853 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2854 r->wvhdl[1] = (
int*)
omAlloc(
nvs*
sizeof(
int));
2859 r->wvhdl[1][
i] = (*va)[
i];
2863 r->wvhdl[0][
i] = (*vb)[
i];
2867 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2868 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2912 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2913 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2950 for(
int i=0;
i<
nv;
i++)
2962 res->block1[0] =
nv;
2967 res->block1[1] =
nv;
3003 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
3004 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
3164#ifndef BUCHBERGER_ALG
3170 for(
i=
nV-1;
i>0;
i--)
3172 (*last_omega)[
i] = 1;
3174 (*last_omega)[0] = 10000;
3251 for(
i=
nV-1;
i>=0;
i--)
3253 (*extra_curr_weight)[
i] = (*curr_weight)[
i];
3256 for(
i=
nV-1;
i>=0;
i--)
3258 (*curr_weight)[
i] = (*next_weight)[
i];
3281#ifndef BUCHBERGER_ALG
3309#ifdef BUCHBERGER_ALG
3378 Print(
"\n// takes %d steps and calls the recursion of level %d:",
3448 && (
G->m[
i]->next->next!=
NULL)
3449 && (
G->m[
i]->next->next->next!=
NULL)
3450 && (
G->m[
i]->next->next->next->next!=
NULL) )
3485 && (
G->m[
i]->next->next!=
NULL))
3520 for (
i=
nH-1;
i>=0;
i--)
3541 for(
i=
nG-1;
i>=0;
i--)
3609 int mtmp,
m=(*iva)[0];
3651#ifdef INVEPS_SMALL_IN_TRAN
3665 for(
i=
nV-2;
i>=0;
i--)
3711 PrintS(
"\n// ** OVERFLOW in \"Repr.Vector\": ");
3713 PrintS(
" is greater than 2147483647 (max. integer representation)");
3721 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3775#ifdef INVEPS_SMALL_IN_TRAN
3789 for(
i=
nV-2;
i>=0;
i--)
3810 PrintS(
"\n// ** OVERFLOW in \"Repr.Vector\": ");
3812 PrintS(
" is greater than 2147483647 (max. integer representation)");
3820 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3860 for(
i=
nV-2;
i>=0;
i--)
3874 if((*
M)[
i*
nV+
j] < 0)
3899 PrintS(
"\n// ** OVERFLOW in \"Repr.Matrix\": ");
3901 PrintS(
" is greater than 2147483647 (max. integer representation)");
3909 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3957#ifndef BUCHBERGER_ALG
3963 for(
i=
nV-1;
i>0;
i--)
3965 (*last_omega)[0] = 10000;
4045#ifndef BUCHBERGER_ALG
4073#ifdef BUCHBERGER_ALG
4177 for(
i=
nV-1;
i>=0;
i--)
4179 (*curr_weight)[
i] = (*next_weight)[
i];
4317 Print(
"\n// Computation of the first std took = %.2f sec",
4318 ((
double)
tostd)/1000000);
4464 for(
i=
nV-1;
i>=0;
i--)
4467 (*curr_weight)[
i] = (*next_weight)[
i];
4532 (*curr_weight)[
i] = (*orig_M)[
i];
4553 (*next_weight2)[
i] =
rand() % 60000 - 30000;
4615 (*result)[
i] = (*next_weight2)[
i];
4622 (*result)[
i] = (*next_weight1)[
i];
4632 (*result)[
i] = (*next_weight2)[
i];
4639 (*result)[
i] = (*next_weight)[
i];
4651 (*result)[
i] = (*next_weight1)[
i];
4658 (*result)[
i] = (*next_weight)[
i];
4672 (*result)[
i] = (*next_weight2)[
i];
4679 (*result)[
i] = (*next_weight)[
i];
4687 (*result)[
i] = (*next_weight)[
i];
4732#ifndef BUCHBERGER_ALG
4736 for(
i=
nV-1;
i>0;
i--)
4738 (*last_omega)[
i] = 1;
4740 (*last_omega)[0] = 10000;
4811#ifndef BUCHBERGER_ALG
4840#ifdef BUCHBERGER_ALG
4937 for(
i=
nV-1;
i>=0;
i--)
4939 (*curr_weight)[
i] = (*next_weight)[
i];
5019#ifndef BUCHBERGER_ALG
5051#ifndef BUCHBERGER_ALG
5055 for(
i=
nV-1;
i>=0;
i--)
5060 for(
i=
nV-1;
i>0;
i--)
5062 (*last_omega)[0] = 10000;
5099#ifdef CHECK_IDEAL_MWALK
5100 Print(
"\n// **** Groebnerwalk took %d steps and ",
nwalk);
5101 PrintS(
"\n// **** call the rec. Pert. Walk to compute a red GB of:");
5110 Print(
"\n// time for the last std(Gw) = %.2f sec",
5150#ifndef BUCHBERGER_ALG
5177#ifdef BUCHBERGER_ALG
5249 PrintS(
"\n// ** The computed vector does NOT stay in Cone!!\n");
5277 for(
i=
nV-1;
i>=0;
i--)
5279 (*tmp_weight)[
i] = (*curr_weight)[
i];
5280 (*curr_weight)[
i] = (*next_weight)[
i];
5324 int nV = baseRing->N;
5343 (*curr_weight)[
i] = (*orig_M)[
i];
5344 (*target_weight)[
i] = (*target_M)[
i];
5346#ifndef BUCHBERGER_ALG
5350 for(
i=
nV-1;
i>0;
i--)
5352 (*last_omega)[
i] = 1;
5354 (*last_omega)[0] = 10000;
5357#ifdef CHECK_IDEAL_MWALK
5412#ifdef CHECK_IDEAL_MWALK
5424 PrintS(
"middle of Cone");
5432#ifndef BUCHBERGER_ALG
5481#ifndef BUCHBERGER_ALG
5491#ifdef CHECK_IDEAL_MWALK
5512#ifdef CHECK_IDEAL_MWALK
5526#ifdef CHECK_IDEAL_MWALK
5573 for(
i=
nV-1;
i>=0;
i--)
5576 (*curr_weight)[
i] = (*next_weight)[
i];
5587#ifndef BUCHBERGER_ALG
5597 Print(
"\n//** Mwalk: Groebner Walk took %d steps.\n",
nstep);
5636 WerrorS(
"Invalid perturbation degree.\n");
5653 (*curr_weight)[
i] = (*orig_M)[
i];
5654 (*target_weight)[
i] = (*target_M)[
i];
5657#ifndef BUCHBERGER_ALG
5661 for(
i=
nV-1;
i>0;
i--)
5663 (*last_omega)[
i] = 1;
5665 (*last_omega)[0] = 10000;
5709#ifdef CHECK_IDEAL_MWALK
5726#ifndef BUCHBERGER_ALG
5767#ifndef BUCHBERGER_ALG
5777#ifdef CHECK_IDEAL_MWALK
5798#ifdef CHECK_IDEAL_MWALK
5815#ifdef CHECK_IDEAL_MWALK
5908 for(
i=
nV-1;
i>=0;
i--)
5910 (*curr_weight)[
i] = (*next_weight)[
i];
5919#ifndef BUCHBERGER_ALG
5924 Print(
"\n//** Mrwalk: Groebner Walk took %d steps.\n",
nstep);
5974 WerrorS(
"Invalid perturbation degree.\n");
5979 ideal Gomega,
M, F,
FF,
G,
Gomega1,
Gomega2,
M1,
F1,
Eresult,
ssG;
5988#ifndef BUCHBERGER_ALG
5995 for(
i=
nV-1;
i>0;
i--)
5997 (*last_omega)[0] = 10000;
6090#ifdef CHECK_IDEAL_MWALK
6120#ifndef BUCHBERGER_ALG
6149 PrintS(
"\n// compute a rGB of Gw:\n");
6151#ifndef BUCHBERGER_ALG
6161#ifdef BUCHBERGER_ALG
6177 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6178 ((
double)
clock())/1000000 -((
double)
tim) /1000000);
6189#ifdef CHECK_IDEAL_MWALK
6212#ifdef CHECK_IDEAL_MWALK
6234 PrintS(
"\n //** Mpwalk: reduce the Groebner basis.\n");
6285 for(
i=
nV-1;
i>=0;
i--)
6323 PrintS(
"\n// ** perturbed target vector doesn't stay in cone!!");
6381 Print(
"\n//** Mpwalk: Perturbation Walk took %d steps.\n",
nstep);
6422 WerrorS(
"Invalid perturbation degree.\n");
6428 ideal Gomega,
M, F,
FF,
G,
Gomega1,
Gomega2,
M1,
F1,
Eresult,
ssG;
6438 (*curr_weight)[
i] = (*orig_M)[
i];
6439 (*target_weight)[
i] = (*target_M)[
i];
6445#ifndef BUCHBERGER_ALG
6452 for(
i=
nV-1;
i>0;
i--)
6454 (*last_omega)[0] = 10000;
6561 Print(
"\n//** Mprwalk: Random Perturbation Walk of degree (%d,%d):",
op_deg,
tp_deg);
6577#ifdef CHECK_IDEAL_MWALK
6608#ifndef BUCHBERGER_ALG
6643 PrintS(
"\n// compute a rGB of Gw:\n");
6645#ifndef BUCHBERGER_ALG
6655#ifdef BUCHBERGER_ALG
6661#ifdef CHECK_IDEAL_MWALK
6672 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6673 ((
double)
clock())/1000000 -((
double)
tim) /1000000);
6696#ifdef CHECK_IDEAL_MWALK
6718 PrintS(
"\n //** Mprwalk: reduce the Groebner basis.\n");
6759 PrintS(
"\n Mpwalk: there is a polynomial in Gomega with at least 3 monomials.\n");
6813 for(
i=
nV-1;
i>=0;
i--)
6854 PrintS(
"\n// **Mprwalk: perturbed target vector doesn't stay in cone.");
6867 PrintS(
"\n// ** Mprwalk: Call \"std\" to compute a Groebner basis.\n");
6876 PrintS(
"\n// **Mprwalk: Call \"LastGB\" to compute a Groebner basis.\n");
6923 Print(
"\n//** Mprwalk: Perturbation Walk took %d steps.\n",
nstep);
6958 Print(
"\n\n// Entering the %d-th recursion:",
nlev);
6966#ifndef BUCHBERGER_ALG
6975 for(
i =
nV -1;
i>=0;
i--)
6977 (*omtmp)[
i] = (*ivtarget)[
i];
6983 for(
i=
nV-1;
i>0;
i--)
6985 (*last_omega)[0] = 10000;
6988 for(
i=0;
i<
nV;
i++) {
6990 (*omega)[
i] = (*Xsigma)[
i];
6994 (*omega2)[
i] = (*Xtau)[(
nlev-1)*
nV+
i];
7004#ifdef FIRST_STEP_FRACTAL
7036 Print(
"\n//** rec_fractal_call: Perturb the both vectors with degree %d.",
nlev);
7081 for(
i=
nV-1;
i>=0;
i--) {
7082 (*omega2)[
i] = (*Xtau)[
nV+
i];
7083 (*omega)[
i] = (*Xsigma)[
nV+
i];
7132 Print(
"\n//** rec_fractal_call: Applying Buchberger's algorithm in ring r = %s;",
7149 Print(
"\n//** rec_fractal_call: Overflow. (4) Leaving the %d-th recursion with %d steps.\n",
7194 Print(
"\n//** rec_fractal_call: Correct cone. (5) Leaving the %d-th recursion with %d steps.\n",
7207 PrintS(
"\n//** rec_fractal_call: Wrong cone. Tau doesn't stay in the correct cone.\n");
7210#ifndef MSTDCC_FRACTAL
7229 PrintS(
"\n//** rec_fractal_call: Updated vectors are equal to the old vectors.\n");
7238 for(
i=
nV-1;
i>=0;
i--)
7250 Print(
"\n//** rec_fractal_call: Wrong cone. Applying Buchberger's algorithm in ring = %s.\n",
7306 Print(
"\n//** rec_fractal_call: Vectors updated. (6) Leaving the %d-th recursion with %d steps.\n",
7318 for(
i=
nV-1;
i>=0;
i--) {
7320 (*omega)[
i] = (*next_vect)[
i];
7331#ifdef CHECK_IDEAL_MWALK
7352#ifndef BUCHBERGER_ALG
7382 PrintS(
"\n//** rec_fractal_call: Maximal recursion depth.\n");
7387#ifdef BUCHBERGER_ALG
7403#ifdef CHECK_IDEAL_MWALK
7423#ifdef CHECK_IDEAL_MWALK
7426 idString(F,
"//** rec_fractal_call: F");
7468#ifndef BUCHBERGER_ALG
7480 for(
i =
nV -1;
i>=0;
i--)
7482 (*omtmp)[
i] = (*ivtarget)[
i];
7486 for(
i=
nV-1;
i>0;
i--)
7488 (*last_omega)[0] = 10000;
7491 for(
i=0;
i<
nV;
i++) {
7493 (*omega)[
i] = (*Xsigma)[
i];
7497 (*omega2)[
i] = (*Xtau)[(
nlev-1)*
nV+
i];
7507#ifdef FIRST_STEP_FRACTAL
7535 PrintS(
"\n**// rec_r_fractal_call: there is a polynomial in Gomega with at least 3 monomials.\n");
7568 Print(
"\n//** rec_r_fractal_call: Perturb both vectors with degree %d.",
nlev);
7616 for(
i=
nV-1;
i>=0;
i--)
7618 (*omega2)[
i] = (*Xtau)[
nV+
i];
7619 (*omega)[
i] = (*Xsigma)[
nV+
i];
7699 Print(
"\n//** rec_r_fractal_call: applying Buchberger's algorithm in ring r = %s;",
7716 Print(
"\n//** rec_r_fractal_call: (1) Leaving the %d-th recursion with %d steps.\n",
7760 Print(
"\n//** rec_r_fractal_call: (2) Leaving the %d-th recursion with %d steps.\n",
7770 Print(
"\n//** rec_r_fractal_call: target weight doesn't stay in the correct cone.\n");
7773#ifndef MSTDCC_FRACTAL
7810 for(
i=
nV-1;
i>=0;
i--)
7823 Print(
"\n//** rec_r_fractal_call: apply Buchberger's algorithm in ring = %s.\n",
7879 Print(
"\n//** rec_r_fractal_call: (3) Leaving the %d-th recursion with %d steps.\n",
7891 for(
i=
nV-1;
i>=0;
i--)
7893 (*altomega)[
i] = (*omega)[
i];
7894 (*omega)[
i] = (*next_vect)[
i];
7907#ifdef CHECK_IDEAL_MWALK
7928#ifndef BUCHBERGER_ALG
7958#ifdef BUCHBERGER_ALG
7974#ifdef CHECK_IDEAL_MWALK
7994#ifdef CHECK_IDEAL_MWALK
7997 idString(F,
"//** rec_r_fractal_call: F");
8070#ifdef FIRST_STEP_FRACTAL
8076 && (
Gw->m[
i]->next->next!=
NULL))
8197 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
8257#ifdef FIRST_STEP_FRACTAL
8263 && (
Gw->m[
i]->next->next!=
NULL))
8384 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
8426#ifndef BUCHBERGER_ALG
8431 for(
i=
nV-1;
i>0;
i--)
8433 (*last_omega)[0] = 10000;
8437 for(
i=
nV-1;
i>=0;
i--)
8463#ifdef REPRESENTATION_OF_SIGMA
8513#ifndef BUCHBERGER_ALG
8535#ifdef BUCHBERGER_ALG
8728 if(
p->next !=
NULL &&
8729 p->next->next !=
NULL &&
8730 p->next->next->next !=
NULL)
8791 for(
i=
nV-1;
i>=0;
i--)
8856#ifndef BUCHBERGER_ALG
8861 for(
i=
nV-1;
i>0;
i--)
8863 (*last_omega)[
i] = 1;
8865 (*last_omega)[0] = 10000;
8869 for(
i=
nV-1;
i>=0;
i--)
8871 (*target_weight)[
i] = (*target_tmp)[
i];
8903#ifdef REPRESENTATION_OF_SIGMA
8960#ifndef BUCHBERGER_ALG
8989#ifdef BUCHBERGER_ALG
9141#ifdef CHECK_IDEAL_MWALK
9279 if(
p->next !=
NULL &&
9280 p->next->next !=
NULL &&
9281 p->next->next->next !=
NULL)
9287 (*vector_tmp)[
i] = (*target_weight)[
i];
9344 for(
i=
nV-1;
i>=0;
i--)
9346 (*curr_weight)[
i] = (*next_weight)[
i];
9363 Print(
"\n// Computation took %d steps and %.2f sec",
nwalk, ((
double) (
clock()-
mtim)/1000000));
9391 WerrorS(
"Invalid perturbation degree.\n");
9451#ifndef BUCHBERGER_ALG
9456 for(
i=
nV-1;
i>0;
i--)
9458 (*last_omega)[
i] = 1;
9460 (*last_omega)[0] = 10000;
9483#ifndef BUCHBERGER_ALG
9517#ifdef BUCHBERGER_ALG
9607 for(
i=
nV-1;
i>=0;
i--)
9610 (*curr_weight)[
i] = (*next_weight)[
i];
9700#ifndef BUCHBERGER_ALG
9707 for(
i=
nV-1;
i>0;
i--)
9709 (*last_omega)[
i] = 1;
9711 (*last_omega)[0] = 10000;
9801 for(
i=
nV-1;
i>=0;
i--)
9809#ifndef BUCHBERGER_ALG
9838#ifdef BUCHBERGER_ALG
9948 for(
i=
nV-1;
i>=0;
i--)
9951 (*curr_weight)[
i] = (*next_weight)[
i];
const CanonicalForm CFMap CFMap & N
poly singclap_pdivide(poly f, poly g, const ring r)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
void(* initEcart)(TObject *L)
int(* posInT)(const TSet T, const int tl, LObject &h)
Coefficient rings, fields and other domains suitable for Singular polynomials.
void reduction(LList *sPolyList, CListOld *critPairs, LList *gPrev, RList *rules, LTagList *lTag, RTagList *rTag, ideal gbPrev, PList *rejectedGBList, int plus)
const Variable & v
< [in] a sqrfree bivariate poly
static int max(int a, int b)
void WerrorS(const char *s)
intvec * hFirstSeries(ideal A, intvec *module_w, ideal Q, intvec *wdegree)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
#define idDelete(H)
delete an ideal
static ideal idVec2Ideal(poly vec)
static BOOLEAN length(leftv result, leftv arg)
intvec * ivCopy(const intvec *o)
KINLINE TObject ** initR()
KINLINE unsigned long * initsevT()
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
int posInT0(const TSet, const int length, LObject &)
void initS(ideal F, ideal Q, kStrategy strat)
void initEcartNormal(TObject *h)
void updateS(BOOLEAN toT, kStrategy strat)
void initBuchMoraCrit(kStrategy strat)
void completeReduce(kStrategy strat, BOOLEAN withT)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
gmp_float sqrt(const gmp_float &a)
#define omFreeSize(addr, size)
#define SI_SAVE_OPT(A, B)
#define TEST_OPT_INTSTRATEGY
#define SI_RESTORE_OPT(A, B)
static int pLength(poly a)
static void p_Setm(poly p, const ring r)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pIsConstant(p)
like above, except that Comp must be 0
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pGetExp(p, i)
Exponent.
#define pEqualPolys(p1, p2)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
#define pCopy(p)
return a copy of the poly
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
void PrintS(const char *s)
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...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
static int rBlocks(const ring r)
static char const ** rParameter(const ring r)
(r->cf->parameter)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void id_Normalize(ideal I, const ring r)
normialize all polys in id
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
int M3ivSame(intvec *temp, intvec *u, intvec *v)
static ideal REC_GB_Mwalk(ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc)
EXTERN_VAR BOOLEAN pSetm_error
static void ivString(intvec *iv, const char *ch)
intvec * MivWeightOrderdp(intvec *ivstart)
static ideal kInterRedCC(ideal F, ideal Q)
static int MivAbsMaxArg(intvec *vec)
intvec * MMatrixone(int nV)
static ideal idHeadCC(ideal h)
static ideal MstdhomCC(ideal G)
static ring VMrRefine(intvec *va, intvec *vb)
static ideal rec_r_fractal_call(ideal G, int nlev, intvec *ivtarget, int weight_rad, int reduction, int printout)
static void cancel(mpz_t zaehler, mpz_t nenner)
static intvec * MExpPol(poly f)
ideal TranMImprovwalk(ideal G, intvec *curr_weight, intvec *target_tmp, int nP)
static int lengthpoly(ideal G)
static long Mlcm(long &i1, long &i2)
static int MivComp(intvec *iva, intvec *ivb)
static int MwalkWeightDegree(poly p, intvec *weight_vector)
intvec * MivMatrixOrderdp(int nV)
ideal Mfwalk(ideal G, intvec *ivstart, intvec *ivtarget, int reduction, int printout)
static intvec * MivSub(intvec *a, intvec *b)
intvec * MPertVectors(ideal G, intvec *ivtarget, int pdeg)
ideal MwalkAlt(ideal Go, intvec *curr_weight, intvec *target_weight)
static ideal MidMult(ideal A, ideal B)
static long gcd(const long a, const long b)
intvec * MivWeightOrderlp(intvec *ivstart)
static ideal middleOfCone(ideal G, ideal Gomega)
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)
intvec * MivMatrixOrder(intvec *iv)
static int MLmWeightedDegree(const poly p, intvec *weight)
static ideal rec_fractal_call(ideal G, int nlev, intvec *ivtarget, int reduction, int printout)
void Set_Error(BOOLEAN f)
static ideal Mpwalk_MAltwalk1(ideal Go, intvec *curr_weight, int tp_deg)
static ideal MLifttwoIdeal(ideal Gw, ideal M, ideal G)
static ring VMrDefault(intvec *va)
static int maxlengthpoly(ideal G)
static int * initS_2_R(int maxnr)
static int isNegNolVector(intvec *hilb)
static void DefRingParlp(void)
static long MivDotProduct(intvec *a, intvec *b)
ideal MAltwalk2(ideal Go, intvec *curr_weight, intvec *target_weight)
static void MLmWeightedDegree_gmp(mpz_t result, const poly p, intvec *weight)
static int islengthpoly2(ideal G)
static intvec * MWalkRandomNextWeight(ideal G, intvec *orig_M, intvec *target_weight, int weight_rad, int pert_deg)
static unsigned long * initsevS(int maxnr)
ideal MAltwalk1(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight)
ideal Mrwalk(ideal Go, intvec *orig_M, intvec *target_M, int weight_rad, int pert_deg, int reduction, int printout)
static ring VMatrRefine(intvec *va, intvec *vb)
intvec * MivMatrixOrderRefine(intvec *iv, intvec *iw)
ideal Mfrwalk(ideal G, intvec *ivstart, intvec *ivtarget, int weight_rad, int reduction, int printout)
ideal Mwalk(ideal Go, intvec *orig_M, intvec *target_M, ring baseRing, int reduction, int printout)
VAR BOOLEAN Overflow_Error
static poly MpolyInitialForm(poly g, intvec *curr_weight)
ideal Mpwalk(ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight, int nP, int reduction, int printout)
static intvec * NewVectorlp(ideal I)
int MivSame(intvec *u, intvec *v)
ideal MwalkInitialForm(ideal G, intvec *ivw)
static ideal LastGB(ideal G, intvec *curr_weight, int tp_deg)
intvec * MivMatrixOrderlp(int nV)
static void idString(ideal L, const char *st)
static intset initec(int maxnr)
static int MivAbsMax(intvec *vec)
intvec * Mfpertvector(ideal G, intvec *ivtarget)
static ring VMatrDefault(intvec *va)
intvec * MPertVectorslp(ideal G, intvec *ivtarget, int pdeg)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
static void VMrDefaultlp(void)
static void DefRingPar(intvec *va)
static ideal MstdCC(ideal G)
static intvec * MwalkNextWeightCC(intvec *curr_weight, intvec *target_weight, ideal G)
static int test_w_in_ConeCC(ideal G, intvec *iv)
static int test_G_GB_walk(ideal H0, ideal H1)
static ideal Rec_LastGB(ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc)