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));
361 double ostd,
mostd,
mif,
mstd,
mlf,
mred,
mnw,
mxif,
mxstd,
mxlf,
mxred,
mxnw,
tot;
363 Print(
"\n// total time = %.2f sec",
totm);
364 Print(
"\n// tostd = %.2f sec = %.2f",
ostd=((
double)
tostd)/1000000,
366 Print(
"\n// tif = %.2f sec = %.2f", ((
double)
tif)/1000000,
368 Print(
"\n// std = %.2f sec = %.2f", ((
double)
tstd)/1000000,
370 Print(
"\n// lift = %.2f sec = %.2f", ((
double)
tlf)/1000000,
372 Print(
"\n// ired = %.2f sec = %.2f", ((
double)
tred)/1000000,
374 Print(
"\n// nextw = %.2f sec = %.2f", ((
double)
tnw)/1000000,
376 PrintS(
"\n Time for the last step:");
377 Print(
"\n// xinfo = %.2f sec = %.2f", ((
double)
xtif)/1000000,
379 Print(
"\n// xstd = %.2f sec = %.2f", ((
double)
xtstd)/1000000,
381 Print(
"\n// xlift = %.2f sec = %.2f", ((
double)
xtlift)/1000000,
383 Print(
"\n// xired = %.2f sec = %.2f", ((
double)
xtred)/1000000,
385 Print(
"\n// xnextw= %.2f sec = %.2f", ((
double)
xtnw)/1000000,
390 Print(
"\n// &%d&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f&%.2f(%.2f)\\ \\",
391 step,
ostd,
totm,
mostd,
mif,
mstd,
mlf,
mred,
mnw,
mxif,
mxstd,
mxlf,
mxred,
mxnw,
tot,
res,
401 Print(
"\n// total time = %.2f sec",
totm);
402 Print(
"\n// tostd = %.2f sec = %.2f",
ostd=((
double)
tostd)/1000000,
404 Print(
"\n// tif = %.2f sec = %.2f", ((
double)
tif)/1000000,
406 Print(
"\n// std = %.2f sec = %.2f", ((
double)
tstd)/1000000,
408 Print(
"\n// xstd = %.2f sec = %.2f", ((
double)
textra)/1000000,
410 Print(
"\n// lift = %.2f sec = %.2f", ((
double)
tlf)/1000000,
412 Print(
"\n// ired = %.2f sec = %.2f", ((
double)
tred)/1000000,
414 Print(
"\n// nextw = %.2f sec = %.2f", ((
double)
tnw)/1000000,
418 Print(
"\n// &%.2f &%.2f&%.2f &%.2f &%.2f &%.2f &%.2f &%.2f &%.2f&%.2f&%.2f\\ \\ ",
419 ostd,
totm,
mostd,
mif,
mstd,
mextra,
mlf,
mred,
mnw,
tot,
res);
423#ifdef CHECK_IDEAL_MWALK
429 for(
i=0;
i<
nL-1;
i++)
495 Print(
"\n// intvec %s = ", ch);
497 for(
int i=0;
i<
nV;
i++)
532static inline long gcd(
const long a,
const long b)
534 long r,
p0 = a, p1 =
b;
650 PrintS(
"\n// ** OVERFLOW in \"MwalkInitialForm\": ");
652 PrintS(
" is greater than 2147483647 (max. integer representation)");
769 for(
i=
nG-1;
i>=0;
i--)
789 PrintS(
"//** the result may be WRONG, i.e. 0!!\n");
799 for(
i=
nG-1;
i>=0;
i--)
851 for(
i=n-1;
i>=0;
i--)
867 for(
i=n-1;
i>=0;
i--)
869 (*result)[
i] = (*a)[
i] - (*b)[
i];
882 for(
i=
nR-1;
i>=0;
i--)
901 if ((*u)[
i] != (*
v)[
i])
971 (*ivm)[
i] = (*iv)[
i];
975 (*ivm)[
i*
nR+
i-1] = 1;
992 (*ivm)[
i] = (*iv)[
i];
1012 for(
i=
nR-1;
i>=0;
i--)
1100 WerrorS(
"//** The perturbed degree is wrong!!");
1151 for(
i=
nG-1;
i>=0;
i--)
1166#ifdef INVEPS_SMALL_IN_MPERTVECTOR
1257 PrintS(
"\n// ** OVERFLOW in \"MPertvectors\": ");
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);
1311 WerrorS(
"//** The perturbed degree is wrong!!");
1316 (*pert_vector)[
i]=(*ivtarget)[
i];
1343 for(
i=
nG-1;
i>=0;
i--)
1356#ifdef INVEPS_SMALL_IN_FRACTAL
1376 int temp = (*pert_vector)[0];
1389 (*pert_vector)[
i] = (*pert_vector)[
i] /
temp;
1408 (*ivM)[
i*
nV +
i] = 1;
1428 (*ivM)[(
i+1)*
nV -
i] = -1;
1444 (*ivM)[
i] = (*ivstart)[
i];
1448 (*ivM)[
i*
nV +
i-1] = 1;
1464 (*ivM)[
i] = (*ivstart)[
i];
1472 (*ivM)[(
i+1)*
nV -
i] = -1;
1500 for(
i=
nV-1;
i>=0;
i--)
1551 for(
i=
nG-1;
i>=0;
i--)
1566#ifdef INVEPS_SMALL_IN_FRACTAL
1580 for(
i=0;
i <
nV;
i++)
1645 Print(
"\n// Xlev = %d and the %d-th element is",
Xnlev,
i+1);
1646 PrintS(
"\n// ** OVERFLOW in \"Mfpertvector\": ");
1648 PrintS(
" is greater than 2147483647 (max. integer representation)");
1649 Print(
"\n// So vector[%d] := %d is wrong!!",
i+1, (*
result)[
i]);
1804 if((*
iva)[
i] - (*ivb)[
i] != 0)
2287 (*diff_weight1)[
j] = (*curr_weight)[
j];
2293 (*curr_weight)[
j] = (*diff_weight1)[
j];
2297 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2305 (*diff_weight1)[
j] = (*curr_weight)[
j];
2310 (*curr_weight)[
j] = (*diff_weight1)[
j];
2312 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2320 for (
j=0;
j<
nG;
j++)
2431 (*curr_weight)[
j] = (*curr_weight)[
j]/
gcd_tmp;
2432 (*diff_weight)[
j] = (*diff_weight)[
j]/
gcd_tmp;
2436#ifdef NEXT_VECTORS_CC
2437 Print(
"\n// gcd of the weight vectors (current and target) = %d",
gcd_tmp);
2467#ifdef NEXT_VECTORS_CC
2468 Print(
"\n// j = %d ==> ",
j);
2501#ifdef NEXT_VECTORS_CC
2502 PrintS(
"\n// gcd of elements of the vector: ");
2520 PrintS(
"\n// ** OVERFLOW in \"MwalkNextWeightCC\": ");
2522 PrintS(
" is greater than 2147483647 (max. integer representation)\n");
2690 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2692 r->wvhdl[0][
i] = (*
va)[
i];
2696 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2697 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2741 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2742 r->wvhdl[1] = (
int*)
omAlloc(
nv*
sizeof(
int));
2746 r->wvhdl[0][
i] = (*vb)[
i];
2747 r->wvhdl[1][
i] = (*va)[
i];
2752 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2753 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2805 r->wvhdl[0][
i] = (*
va)[
i];
2809 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2810 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2852 r->wvhdl[0] = (
int*)
omAlloc(
nv*
sizeof(
int));
2853 r->wvhdl[1] = (
int*)
omAlloc(
nvs*
sizeof(
int));
2858 r->wvhdl[1][
i] = (*va)[
i];
2862 r->wvhdl[0][
i] = (*vb)[
i];
2866 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2867 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2911 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2912 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
2949 for(
int i=0;
i<
nv;
i++)
2961 res->block1[0] =
nv;
2966 res->block1[1] =
nv;
3002 r->block0 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
3003 r->block1 = (
int *)
omAlloc0(
nb *
sizeof(
int *));
3163#ifndef BUCHBERGER_ALG
3169 for(
i=
nV-1;
i>0;
i--)
3171 (*last_omega)[
i] = 1;
3173 (*last_omega)[0] = 10000;
3250 for(
i=
nV-1;
i>=0;
i--)
3252 (*extra_curr_weight)[
i] = (*curr_weight)[
i];
3255 for(
i=
nV-1;
i>=0;
i--)
3257 (*curr_weight)[
i] = (*next_weight)[
i];
3280#ifndef BUCHBERGER_ALG
3308#ifdef BUCHBERGER_ALG
3377 Print(
"\n// takes %d steps and calls the recursion of level %d:",
3447 && (
G->m[
i]->next->next!=
NULL)
3448 && (
G->m[
i]->next->next->next!=
NULL)
3449 && (
G->m[
i]->next->next->next->next!=
NULL) )
3484 && (
G->m[
i]->next->next!=
NULL))
3519 for (
i=
nH-1;
i>=0;
i--)
3540 for(
i=
nG-1;
i>=0;
i--)
3608 int mtmp,
m=(*iva)[0];
3650#ifdef INVEPS_SMALL_IN_TRAN
3664 for(
i=
nV-2;
i>=0;
i--)
3710 PrintS(
"\n// ** OVERFLOW in \"Repr.Vector\": ");
3712 PrintS(
" is greater than 2147483647 (max. integer representation)");
3720 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3774#ifdef INVEPS_SMALL_IN_TRAN
3788 for(
i=
nV-2;
i>=0;
i--)
3809 PrintS(
"\n// ** OVERFLOW in \"Repr.Vector\": ");
3811 PrintS(
" is greater than 2147483647 (max. integer representation)");
3819 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3859 for(
i=
nV-2;
i>=0;
i--)
3873 if((*
M)[
i*
nV+
j] < 0)
3898 PrintS(
"\n// ** OVERFLOW in \"Repr.Matrix\": ");
3900 PrintS(
" is greater than 2147483647 (max. integer representation)");
3908 Print(
"\n// %d element(s) of it are overflow!!",
ntrue);
3956#ifndef BUCHBERGER_ALG
3962 for(
i=
nV-1;
i>0;
i--)
3964 (*last_omega)[0] = 10000;
4044#ifndef BUCHBERGER_ALG
4072#ifdef BUCHBERGER_ALG
4176 for(
i=
nV-1;
i>=0;
i--)
4178 (*curr_weight)[
i] = (*next_weight)[
i];
4316 Print(
"\n// Computation of the first std took = %.2f sec",
4317 ((
double)
tostd)/1000000);
4463 for(
i=
nV-1;
i>=0;
i--)
4466 (*curr_weight)[
i] = (*next_weight)[
i];
4531 (*curr_weight)[
i] = (*orig_M)[
i];
4552 (*next_weight2)[
i] =
rand() % 60000 - 30000;
4614 (*result)[
i] = (*next_weight2)[
i];
4621 (*result)[
i] = (*next_weight1)[
i];
4631 (*result)[
i] = (*next_weight2)[
i];
4638 (*result)[
i] = (*next_weight)[
i];
4650 (*result)[
i] = (*next_weight1)[
i];
4657 (*result)[
i] = (*next_weight)[
i];
4671 (*result)[
i] = (*next_weight2)[
i];
4678 (*result)[
i] = (*next_weight)[
i];
4686 (*result)[
i] = (*next_weight)[
i];
4731#ifndef BUCHBERGER_ALG
4735 for(
i=
nV-1;
i>0;
i--)
4737 (*last_omega)[
i] = 1;
4739 (*last_omega)[0] = 10000;
4810#ifndef BUCHBERGER_ALG
4839#ifdef BUCHBERGER_ALG
4936 for(
i=
nV-1;
i>=0;
i--)
4938 (*curr_weight)[
i] = (*next_weight)[
i];
5018#ifndef BUCHBERGER_ALG
5050#ifndef BUCHBERGER_ALG
5054 for(
i=
nV-1;
i>=0;
i--)
5059 for(
i=
nV-1;
i>0;
i--)
5061 (*last_omega)[0] = 10000;
5098#ifdef CHECK_IDEAL_MWALK
5099 Print(
"\n// **** Groebnerwalk took %d steps and ",
nwalk);
5100 PrintS(
"\n// **** call the rec. Pert. Walk to compute a red GB of:");
5109 Print(
"\n// time for the last std(Gw) = %.2f sec",
5149#ifndef BUCHBERGER_ALG
5176#ifdef BUCHBERGER_ALG
5248 PrintS(
"\n// ** The computed vector does NOT stay in Cone!!\n");
5276 for(
i=
nV-1;
i>=0;
i--)
5278 (*tmp_weight)[
i] = (*curr_weight)[
i];
5279 (*curr_weight)[
i] = (*next_weight)[
i];
5323 int nV = baseRing->N;
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
5411#ifdef CHECK_IDEAL_MWALK
5423 PrintS(
"middle of Cone");
5431#ifndef BUCHBERGER_ALG
5480#ifndef BUCHBERGER_ALG
5490#ifdef CHECK_IDEAL_MWALK
5511#ifdef CHECK_IDEAL_MWALK
5525#ifdef CHECK_IDEAL_MWALK
5572 for(
i=
nV-1;
i>=0;
i--)
5575 (*curr_weight)[
i] = (*next_weight)[
i];
5586#ifndef BUCHBERGER_ALG
5596 Print(
"\n//** Mwalk: Groebner Walk took %d steps.\n",
nstep);
5635 WerrorS(
"Invalid perturbation degree.\n");
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;
5708#ifdef CHECK_IDEAL_MWALK
5725#ifndef BUCHBERGER_ALG
5766#ifndef BUCHBERGER_ALG
5776#ifdef CHECK_IDEAL_MWALK
5797#ifdef CHECK_IDEAL_MWALK
5814#ifdef CHECK_IDEAL_MWALK
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);
5973 WerrorS(
"Invalid perturbation degree.\n");
5978 ideal Gomega,
M, F,
FF,
G,
Gomega1,
Gomega2,
M1,
F1,
Eresult,
ssG;
5987#ifndef BUCHBERGER_ALG
5994 for(
i=
nV-1;
i>0;
i--)
5996 (*last_omega)[0] = 10000;
6089#ifdef CHECK_IDEAL_MWALK
6119#ifndef BUCHBERGER_ALG
6148 PrintS(
"\n// compute a rGB of Gw:\n");
6150#ifndef BUCHBERGER_ALG
6160#ifdef BUCHBERGER_ALG
6176 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6177 ((
double)
clock())/1000000 -((
double)
tim) /1000000);
6188#ifdef CHECK_IDEAL_MWALK
6211#ifdef CHECK_IDEAL_MWALK
6233 PrintS(
"\n //** Mpwalk: reduce the Groebner basis.\n");
6284 for(
i=
nV-1;
i>=0;
i--)
6322 PrintS(
"\n// ** perturbed target vector doesn't stay in cone!!");
6380 Print(
"\n//** Mpwalk: Perturbation Walk took %d steps.\n",
nstep);
6421 WerrorS(
"Invalid perturbation degree.\n");
6427 ideal Gomega,
M, F,
FF,
G,
Gomega1,
Gomega2,
M1,
F1,
Eresult,
ssG;
6437 (*curr_weight)[
i] = (*orig_M)[
i];
6438 (*target_weight)[
i] = (*target_M)[
i];
6444#ifndef BUCHBERGER_ALG
6451 for(
i=
nV-1;
i>0;
i--)
6453 (*last_omega)[0] = 10000;
6560 Print(
"\n//** Mprwalk: Random Perturbation Walk of degree (%d,%d):",
op_deg,
tp_deg);
6576#ifdef CHECK_IDEAL_MWALK
6607#ifndef BUCHBERGER_ALG
6642 PrintS(
"\n// compute a rGB of Gw:\n");
6644#ifndef BUCHBERGER_ALG
6654#ifdef BUCHBERGER_ALG
6660#ifdef CHECK_IDEAL_MWALK
6671 Print(
"\n// time for the last std(Gw) = %.2f sec\n",
6672 ((
double)
clock())/1000000 -((
double)
tim) /1000000);
6695#ifdef CHECK_IDEAL_MWALK
6717 PrintS(
"\n //** Mprwalk: reduce the Groebner basis.\n");
6758 PrintS(
"\n Mpwalk: there is a polynomial in Gomega with at least 3 monomials.\n");
6812 for(
i=
nV-1;
i>=0;
i--)
6853 PrintS(
"\n// **Mprwalk: perturbed target vector doesn't stay in cone.");
6866 PrintS(
"\n// ** Mprwalk: Call \"std\" to compute a Groebner basis.\n");
6875 PrintS(
"\n// **Mprwalk: Call \"LastGB\" to compute a Groebner basis.\n");
6922 Print(
"\n//** Mprwalk: Perturbation Walk took %d steps.\n",
nstep);
6957 Print(
"\n\n// Entering the %d-th recursion:",
nlev);
6965#ifndef BUCHBERGER_ALG
6974 for(
i =
nV -1;
i>=0;
i--)
6976 (*omtmp)[
i] = (*ivtarget)[
i];
6982 for(
i=
nV-1;
i>0;
i--)
6984 (*last_omega)[0] = 10000;
6987 for(
i=0;
i<
nV;
i++) {
6989 (*omega)[
i] = (*Xsigma)[
i];
6993 (*omega2)[
i] = (*Xtau)[(
nlev-1)*
nV+
i];
7003#ifdef FIRST_STEP_FRACTAL
7035 Print(
"\n//** rec_fractal_call: Perturb the both vectors with degree %d.",
nlev);
7080 for(
i=
nV-1;
i>=0;
i--) {
7081 (*omega2)[
i] = (*Xtau)[
nV+
i];
7082 (*omega)[
i] = (*Xsigma)[
nV+
i];
7131 Print(
"\n//** rec_fractal_call: Applying Buchberger's algorithm in ring r = %s;",
7148 Print(
"\n//** rec_fractal_call: Overflow. (4) Leaving the %d-th recursion with %d steps.\n",
7193 Print(
"\n//** rec_fractal_call: Correct cone. (5) Leaving the %d-th recursion with %d steps.\n",
7206 PrintS(
"\n//** rec_fractal_call: Wrong cone. Tau doesn't stay in the correct cone.\n");
7209#ifndef MSTDCC_FRACTAL
7228 PrintS(
"\n//** rec_fractal_call: Updated vectors are equal to the old vectors.\n");
7237 for(
i=
nV-1;
i>=0;
i--)
7249 Print(
"\n//** rec_fractal_call: Wrong cone. Applying Buchberger's algorithm in ring = %s.\n",
7305 Print(
"\n//** rec_fractal_call: Vectors updated. (6) Leaving the %d-th recursion with %d steps.\n",
7317 for(
i=
nV-1;
i>=0;
i--) {
7319 (*omega)[
i] = (*next_vect)[
i];
7330#ifdef CHECK_IDEAL_MWALK
7351#ifndef BUCHBERGER_ALG
7381 PrintS(
"\n//** rec_fractal_call: Maximal recursion depth.\n");
7386#ifdef BUCHBERGER_ALG
7402#ifdef CHECK_IDEAL_MWALK
7422#ifdef CHECK_IDEAL_MWALK
7425 idString(F,
"//** rec_fractal_call: F");
7467#ifndef BUCHBERGER_ALG
7479 for(
i =
nV -1;
i>=0;
i--)
7481 (*omtmp)[
i] = (*ivtarget)[
i];
7485 for(
i=
nV-1;
i>0;
i--)
7487 (*last_omega)[0] = 10000;
7490 for(
i=0;
i<
nV;
i++) {
7492 (*omega)[
i] = (*Xsigma)[
i];
7496 (*omega2)[
i] = (*Xtau)[(
nlev-1)*
nV+
i];
7506#ifdef FIRST_STEP_FRACTAL
7534 PrintS(
"\n**// rec_r_fractal_call: there is a polynomial in Gomega with at least 3 monomials.\n");
7567 Print(
"\n//** rec_r_fractal_call: Perturb both vectors with degree %d.",
nlev);
7615 for(
i=
nV-1;
i>=0;
i--)
7617 (*omega2)[
i] = (*Xtau)[
nV+
i];
7618 (*omega)[
i] = (*Xsigma)[
nV+
i];
7698 Print(
"\n//** rec_r_fractal_call: applying Buchberger's algorithm in ring r = %s;",
7715 Print(
"\n//** rec_r_fractal_call: (1) Leaving the %d-th recursion with %d steps.\n",
7759 Print(
"\n//** rec_r_fractal_call: (2) Leaving the %d-th recursion with %d steps.\n",
7769 Print(
"\n//** rec_r_fractal_call: target weight doesn't stay in the correct cone.\n");
7772#ifndef MSTDCC_FRACTAL
7809 for(
i=
nV-1;
i>=0;
i--)
7822 Print(
"\n//** rec_r_fractal_call: apply Buchberger's algorithm in ring = %s.\n",
7878 Print(
"\n//** rec_r_fractal_call: (3) Leaving the %d-th recursion with %d steps.\n",
7890 for(
i=
nV-1;
i>=0;
i--)
7892 (*altomega)[
i] = (*omega)[
i];
7893 (*omega)[
i] = (*next_vect)[
i];
7906#ifdef CHECK_IDEAL_MWALK
7927#ifndef BUCHBERGER_ALG
7957#ifdef BUCHBERGER_ALG
7973#ifdef CHECK_IDEAL_MWALK
7993#ifdef CHECK_IDEAL_MWALK
7996 idString(F,
"//** rec_r_fractal_call: F");
8069#ifdef FIRST_STEP_FRACTAL
8075 && (
Gw->m[
i]->next->next!=
NULL))
8196 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
8256#ifdef FIRST_STEP_FRACTAL
8262 && (
Gw->m[
i]->next->next!=
NULL))
8383 Print(
"\n// the numbers of Overflow_Error (%d)",
nnflow);
8425#ifndef BUCHBERGER_ALG
8430 for(
i=
nV-1;
i>0;
i--)
8432 (*last_omega)[0] = 10000;
8436 for(
i=
nV-1;
i>=0;
i--)
8462#ifdef REPRESENTATION_OF_SIGMA
8512#ifndef BUCHBERGER_ALG
8534#ifdef BUCHBERGER_ALG
8727 if(
p->next !=
NULL &&
8728 p->next->next !=
NULL &&
8729 p->next->next->next !=
NULL)
8790 for(
i=
nV-1;
i>=0;
i--)
8855#ifndef BUCHBERGER_ALG
8860 for(
i=
nV-1;
i>0;
i--)
8862 (*last_omega)[
i] = 1;
8864 (*last_omega)[0] = 10000;
8868 for(
i=
nV-1;
i>=0;
i--)
8870 (*target_weight)[
i] = (*target_tmp)[
i];
8902#ifdef REPRESENTATION_OF_SIGMA
8959#ifndef BUCHBERGER_ALG
8988#ifdef BUCHBERGER_ALG
9140#ifdef CHECK_IDEAL_MWALK
9278 if(
p->next !=
NULL &&
9279 p->next->next !=
NULL &&
9280 p->next->next->next !=
NULL)
9286 (*vector_tmp)[
i] = (*target_weight)[
i];
9343 for(
i=
nV-1;
i>=0;
i--)
9345 (*curr_weight)[
i] = (*next_weight)[
i];
9362 Print(
"\n// Computation took %d steps and %.2f sec",
nwalk, ((
double) (
clock()-
mtim)/1000000));
9390 WerrorS(
"Invalid perturbation degree.\n");
9450#ifndef BUCHBERGER_ALG
9455 for(
i=
nV-1;
i>0;
i--)
9457 (*last_omega)[
i] = 1;
9459 (*last_omega)[0] = 10000;
9482#ifndef BUCHBERGER_ALG
9516#ifdef BUCHBERGER_ALG
9606 for(
i=
nV-1;
i>=0;
i--)
9609 (*curr_weight)[
i] = (*next_weight)[
i];
9699#ifndef BUCHBERGER_ALG
9706 for(
i=
nV-1;
i>0;
i--)
9708 (*last_omega)[
i] = 1;
9710 (*last_omega)[0] = 10000;
9800 for(
i=
nV-1;
i>=0;
i--)
9808#ifndef BUCHBERGER_ALG
9837#ifdef BUCHBERGER_ALG
9947 for(
i=
nV-1;
i>=0;
i--)
9950 (*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 F1(int a1, int &r1)
F1.
void F2(int a2, int &r2)
F2.
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)