 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
BOOLEAN | ErrorCheck () |
|
void | Set_Error (BOOLEAN f) |
|
static intset | initec (int maxnr) |
|
static unsigned long * | initsevS (int maxnr) |
|
static int * | initS_2_R (int maxnr) |
|
static ideal | kInterRedCC (ideal F, ideal Q) |
|
static void | idString (ideal L, const char *st) |
|
static void | ivString (intvec *iv, const char *ch) |
|
static long | gcd (const long a, const long b) |
|
static void | cancel (mpz_t zaehler, mpz_t nenner) |
|
static int | MLmWeightedDegree (const poly p, intvec *weight) |
|
static int | MwalkWeightDegree (poly p, intvec *weight_vector) |
|
static void | MLmWeightedDegree_gmp (mpz_t result, const poly p, intvec *weight) |
|
static poly | MpolyInitialForm (poly g, intvec *curr_weight) |
|
ideal | MwalkInitialForm (ideal G, intvec *ivw) |
|
static int | test_w_in_ConeCC (ideal G, intvec *iv) |
|
static long | Mlcm (long &i1, long &i2) |
|
static long | MivDotProduct (intvec *a, intvec *b) |
|
static intvec * | MivSub (intvec *a, intvec *b) |
|
static intvec * | MExpPol (poly f) |
|
int | MivSame (intvec *u, intvec *v) |
|
int | M3ivSame (intvec *temp, intvec *u, intvec *v) |
|
static ideal | MstdCC (ideal G) |
|
static ideal | MstdhomCC (ideal G) |
|
intvec * | MivMatrixOrder (intvec *iv) |
|
intvec * | MivMatrixOrderRefine (intvec *iv, intvec *iw) |
|
intvec * | Mivdp (int nR) |
|
intvec * | Mivlp (int nR) |
|
intvec * | MPertVectors (ideal G, intvec *ivtarget, int pdeg) |
|
intvec * | MPertVectorslp (ideal G, intvec *ivtarget, int pdeg) |
|
intvec * | MivMatrixOrderlp (int nV) |
|
intvec * | MivMatrixOrderdp (int nV) |
|
intvec * | MivWeightOrderlp (intvec *ivstart) |
|
intvec * | MivWeightOrderdp (intvec *ivstart) |
|
intvec * | MivUnit (int nV) |
|
intvec * | Mfpertvector (ideal G, intvec *ivtarget) |
|
static ideal | MidMult (ideal A, ideal B) |
|
static ideal | MLifttwoIdeal (ideal Gw, ideal M, ideal G) |
|
static int | MivComp (intvec *iva, intvec *ivb) |
|
static int | MivAbsMax (intvec *vec) |
|
static int | MivAbsMaxArg (intvec *vec) |
|
static intvec * | MwalkNextWeightCC (intvec *curr_weight, intvec *target_weight, ideal G) |
|
intvec * | MkInterRedNextWeight (intvec *iva, intvec *ivb, ideal G) |
|
static ring | VMrDefault (intvec *va) |
|
static ring | VMrRefine (intvec *va, intvec *vb) |
|
static ring | VMatrDefault (intvec *va) |
|
static ring | VMatrRefine (intvec *va, intvec *vb) |
|
static void | VMrDefaultlp (void) |
|
static void | DefRingPar (intvec *va) |
|
static void | DefRingParlp (void) |
|
static int | isNegNolVector (intvec *hilb) |
|
static ideal | middleOfCone (ideal G, ideal Gomega) |
|
static ideal | LastGB (ideal G, intvec *curr_weight, int tp_deg) |
|
static int | lengthpoly (ideal G) |
|
static int | maxlengthpoly (ideal G) |
|
static int | islengthpoly2 (ideal G) |
|
static ideal | idHeadCC (ideal h) |
|
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) |
|
ideal | MAltwalk2 (ideal Go, intvec *curr_weight, intvec *target_weight) |
|
static intvec * | NewVectorlp (ideal I) |
|
static intvec * | MWalkRandomNextWeight (ideal G, intvec *orig_M, intvec *target_weight, int weight_rad, int pert_deg) |
|
static ideal | REC_GB_Mwalk (ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc) |
|
ideal | MwalkAlt (ideal Go, intvec *curr_weight, intvec *target_weight) |
|
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) |
|
intvec * | MMatrixone (int nV) |
|
static ideal | rec_fractal_call (ideal G, int nlev, intvec *ivtarget, int reduction, int printout) |
|
static ideal | rec_r_fractal_call (ideal G, int nlev, intvec *ivtarget, int weight_rad, 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) |
|
ideal | TranMImprovwalk (ideal G, intvec *curr_weight, intvec *target_tmp, int nP) |
|
static ideal | Mpwalk_MAltwalk1 (ideal Go, intvec *curr_weight, int tp_deg) |
|
ideal | MAltwalk1 (ideal Go, int op_deg, int tp_deg, intvec *curr_weight, intvec *target_weight) |
|
◆ BUCHBERGER_ALG
◆ CHECK_IDEAL_MWALK
#define CHECK_IDEAL_MWALK |
◆ FIRST_STEP_FRACTAL
#define FIRST_STEP_FRACTAL |
◆ INVEPS_SMALL_IN_FRACTAL
#define INVEPS_SMALL_IN_FRACTAL |
◆ INVEPS_SMALL_IN_MPERTVECTOR
#define INVEPS_SMALL_IN_MPERTVECTOR |
◆ INVEPS_SMALL_IN_TRAN
#define INVEPS_SMALL_IN_TRAN |
◆ MSTDCC_FRACTAL
◆ cancel()
static void cancel |
( |
mpz_t |
zaehler, |
|
|
mpz_t |
nenner |
|
) |
| |
|
static |
Definition at line 588 of file walk.cc.
593 mpz_gcd(
g, zaehler, nenner);
595 mpz_div(zaehler , zaehler,
g);
596 mpz_div(nenner , nenner,
g);
◆ DefRingPar()
static void DefRingPar |
( |
intvec * |
va | ) |
|
|
static |
Definition at line 2939 of file walk.cc.
2948 res->wvhdl[0] = (
int*)
omAlloc(nv*
sizeof(
int));
2949 for(
int i=0;
i<nv;
i++)
2950 res->wvhdl[0][
i] = (*va)[
i];
2955 res->block0 = (
int *)
omAlloc0(nb *
sizeof(
int *));
2956 res->block1 = (
int *)
omAlloc0(nb *
sizeof(
int *));
2961 res->block1[0] = nv;
2966 res->block1[1] = nv;
◆ DefRingParlp()
static void DefRingParlp |
( |
void |
| ) |
|
|
static |
Definition at line 2988 of file walk.cc.
3002 r->block0 = (
int *)
omAlloc0(nb *
sizeof(
int *));
3003 r->block1 = (
int *)
omAlloc0(nb *
sizeof(
int *));
◆ ErrorCheck()
◆ gcd()
Definition at line 532 of file walk.cc.
534 long r, p0 = a, p1 =
b;
◆ idHeadCC()
static ideal idHeadCC |
( |
ideal |
h | ) |
|
|
static |
◆ idString()
static void idString |
( |
ideal |
L, |
|
|
const char * |
st |
|
) |
| |
|
static |
Definition at line 424 of file walk.cc.
428 Print(
"\n// ideal %s = ", st);
429 for(
i=0;
i<nL-1;
i++)
◆ initec()
static intset initec |
( |
int |
maxnr | ) |
|
|
inlinestatic |
◆ initS_2_R()
static int* initS_2_R |
( |
int |
maxnr | ) |
|
|
inlinestatic |
◆ initsevS()
static unsigned long* initsevS |
( |
int |
maxnr | ) |
|
|
inlinestatic |
Definition at line 103 of file walk.cc.
105 return (
unsigned long*)
omAlloc0(maxnr*
sizeof(
unsigned long));
◆ islengthpoly2()
static int islengthpoly2 |
( |
ideal |
G | ) |
|
|
static |
◆ isNegNolVector()
static int isNegNolVector |
( |
intvec * |
hilb | ) |
|
|
static |
◆ ivString()
Definition at line 492 of file walk.cc.
495 Print(
"\n// intvec %s = ", ch);
497 for(
int i=0;
i<nV;
i++)
501 Print(
"%d;", (*iv)[nV]);
◆ kInterRedCC()
static ideal kInterRedCC |
( |
ideal |
F, |
|
|
ideal |
Q |
|
) |
| |
|
static |
◆ LastGB()
static ideal LastGB |
( |
ideal |
G, |
|
|
intvec * |
curr_weight, |
|
|
int |
tp_deg |
|
) |
| |
|
static |
Definition at line 3145 of file walk.cc.
3151 int nwalk=0, endwalks=0, nnwinC=1;
3153 ideal Gomega,
M, F, Gomega1, Gomega2, M1,F1,
result,ssG;
3154 ring newRing, oldRing, TargetRing;
3158 intvec* pert_target_vector;
3163 #ifndef BUCHBERGER_ALG
3169 for(
i=nV-1;
i>0;
i--)
3171 (*last_omega)[
i] = 1;
3173 (*last_omega)[0] = 10000;
3178 if(tp_deg > 1 && tp_deg <= nV)
3195 pert_target_vector = target_weight;
3202 target_weight =
Mivlp(nV);
3216 xtnw=xtnw+clock()-to;
3219 #ifdef PRINT_VECTORS
3220 MivString(curr_weight, target_weight, next_weight);
3239 if(
MivComp(next_weight, ivNull) == 1)
3247 if(
MivComp(next_weight, target_weight) == 1)
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];
3266 xtif=xtif+clock()-to;
3280 #ifndef BUCHBERGER_ALG
3281 if(isNolVector(curr_weight) == 0)
3289 #endif // BUCHBERGER_ALG
3308 #ifdef BUCHBERGER_ALG
3313 #endif // BUCHBERGER_ALG
3315 xtstd=xtstd+clock()-to;
3328 xtlift=xtlift+clock()-to;
3344 xtred=xtred+clock()-to;
3377 Print(
"\n// takes %d steps and calls the recursion of level %d:",
3380 F1 =
LastGB(
G,curr_weight, tp_deg-1);
3426 delete target_weight;
◆ lengthpoly()
static int lengthpoly |
( |
ideal |
G | ) |
|
|
static |
Definition at line 3440 of file walk.cc.
3447 && (
G->m[
i]->next->next!=
NULL)
3448 && (
G->m[
i]->next->next->next!=
NULL)
3449 && (
G->m[
i]->next->next->next->next!=
NULL) )
◆ M3ivSame()
◆ MAltwalk1()
ideal MAltwalk1 |
( |
ideal |
Go, |
|
|
int |
op_deg, |
|
|
int |
tp_deg, |
|
|
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 |
Go, |
|
|
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);
◆ maxlengthpoly()
static int maxlengthpoly |
( |
ideal |
G | ) |
|
|
static |
◆ MExpPol()
static intvec* MExpPol |
( |
poly |
f | ) |
|
|
static |
Definition at line 877 of file walk.cc.
882 for(
i=nR-1;
i>=0;
i--)
◆ 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);
◆ middleOfCone()
static ideal middleOfCone |
( |
ideal |
G, |
|
|
ideal |
Gomega |
|
) |
| |
|
static |
Definition at line 3079 of file walk.cc.
3083 poly
p,lm,factor1,factor2;
3104 lm =
pCopy(Gomega->m[
j]);
◆ MidMult()
static ideal MidMult |
( |
ideal |
A, |
|
|
ideal |
B |
|
) |
| |
|
static |
◆ MivAbsMax()
static int MivAbsMax |
( |
intvec * |
vec | ) |
|
|
static |
◆ MivAbsMaxArg()
static int MivAbsMaxArg |
( |
intvec * |
vec | ) |
|
|
static |
◆ MivComp()
Definition at line 1798 of file walk.cc.
1804 if((*iva)[
i] - (*ivb)[
i] != 0)
◆ MivDotProduct()
Definition at line 845 of file walk.cc.
851 for(
i=n-1;
i>=0;
i--)
◆ 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 |
nV | ) |
|
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;
◆ MivMatrixOrderRefine()
Definition at line 983 of file walk.cc.
992 (*ivm)[
i] = (*iv)[
i];
998 (*ivm)[
j+
i*nR] = (*iw)[
j+
i*nR];
◆ MivSame()
Definition at line 893 of file walk.cc.
899 for (
i=0;
i<niv;
i++)
901 if ((*u)[
i] != (*
v)[
i])
◆ MivSub()
Definition at line 861 of file walk.cc.
867 for(
i=n-1;
i>=0;
i--)
869 (*result)[
i] = (*a)[
i] - (*b)[
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()
◆ Mlcm()
static long Mlcm |
( |
long & |
i1, |
|
|
long & |
i2 |
|
) |
| |
|
inlinestatic |
Definition at line 835 of file walk.cc.
837 long temp =
gcd(i1, i2);
838 return ((i1 / temp)* i2);
◆ MLifttwoIdeal()
static ideal MLifttwoIdeal |
( |
ideal |
Gw, |
|
|
ideal |
M, |
|
|
ideal |
G |
|
) |
| |
|
static |
◆ MLmWeightedDegree()
static int MLmWeightedDegree |
( |
const poly |
p, |
|
|
intvec * |
weight |
|
) |
| |
|
inlinestatic |
Definition at line 621 of file walk.cc.
625 mpz_init_set_ui(sing_int, 2147483647);
638 mpz_set_si(zvec, (*weight)[
i-1]);
640 mpz_add(zsum, zsum, zmul);
643 wgrad = mpz_get_ui(zsum);
645 if(mpz_cmp(zsum, sing_int)>0)
650 PrintS(
"\n// ** OVERFLOW in \"MwalkInitialForm\": ");
651 mpz_out_str( stdout, 10, zsum);
652 PrintS(
" is greater than 2147483647 (max. integer representation)");
◆ MLmWeightedDegree_gmp()
static void MLmWeightedDegree_gmp |
( |
mpz_t |
result, |
|
|
const poly |
p, |
|
|
intvec * |
weight |
|
) |
| |
|
static |
Definition at line 690 of file walk.cc.
694 mpz_init_set_ui(sing_int, 2147483647);
707 mpz_set_si(zvec, (*weight)[
i-1]);
709 mpz_add(ztmp, ztmp, zmul);
711 mpz_init_set(
result, ztmp);
◆ MMatrixone()
Definition at line 6932 of file walk.cc.
6939 (*ivM)[
i*nV +
j] = 1;
◆ 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;
◆ MpolyInitialForm()
static poly MpolyInitialForm |
( |
poly |
g, |
|
|
intvec * |
curr_weight |
|
) |
| |
|
static |
Definition at line 722 of file walk.cc.
729 mpz_t maxtmp; mpz_init(maxtmp);
731 poly hg, in_w_g =
NULL;
739 if(mpz_cmp(maxtmp,
max)>0)
741 mpz_set(
max, maxtmp);
747 if(mpz_cmp(maxtmp,
max)==0)
◆ 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);
◆ Mpwalk_MAltwalk1()
static ideal Mpwalk_MAltwalk1 |
( |
ideal |
Go, |
|
|
intvec * |
curr_weight, |
|
|
int |
tp_deg |
|
) |
| |
|
static |
Definition at line 9377 of file walk.cc.
9383 clock_t tinput=clock();
9388 if(tp_deg < 1 || tp_deg > nV)
9390 WerrorS(
"Invalid perturbation degree.\n");
9394 int nwalk=0, endwalks=0, ntestwinC=1;
9395 int tp_deg_tmp = tp_deg;
9396 ideal Gomega,
M, F,
G, M1, F1, Gomega1, Gomega2, G1;
9397 ring newRing, oldRing, TargetRing;
9430 target_weight =
Mivlp(nV);
9440 if(tp_deg != tp_deg_tmp)
9450 #ifndef BUCHBERGER_ALG
9455 for(
i=nV-1;
i>0;
i--)
9457 (*last_omega)[
i] = 1;
9459 (*last_omega)[0] = 10000;
9479 xtif=xtif+clock()-to;
9482 #ifndef BUCHBERGER_ALG
9483 if(isNolVector(curr_weight) == 0)
9516 #ifdef BUCHBERGER_ALG
9521 #endif // BUCHBERGER_ALG
9523 xtstd=xtstd+clock()-to;
9539 xtlift=xtlift+clock()-to;
9556 xtred=xtred+clock()-to;
9571 xtnw=xtnw+clock()-to;
9573 #ifdef PRINT_VECTORS
9574 MivString(curr_weight, target_weight, next_weight);
9583 tproc = tproc+clock()-tinput;
9596 if(
MivComp(next_weight, ivNull) == 1)
9602 if(
MivComp(next_weight, target_weight) == 1)
9606 for(
i=nV-1;
i>=0;
i--)
9609 (*curr_weight)[
i] = (*next_weight)[
i];
9638 xtextra=xtextra+clock()-to;
9648 tproc = tproc+clock()-tinput;
9661 delete target_weight;
◆ 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);
◆ MstdCC()
static ideal MstdCC |
( |
ideal |
G | ) |
|
|
static |
◆ MstdhomCC()
static ideal MstdhomCC |
( |
ideal |
G | ) |
|
|
static |
◆ 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);
◆ MwalkAlt()
ideal MwalkAlt |
( |
ideal |
Go, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_weight |
|
) |
| |
Definition at line 5027 of file walk.cc.
5034 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0;
5037 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;
5045 ideal Gomega,
M, F, Gomega1, Gomega2, M1, F1,
G;
5047 ring newRing, oldRing;
5050 #ifndef BUCHBERGER_ALG
5054 for(
i=nV-1;
i>=0;
i--)
5055 (*tmp_weight)[
i] = (*curr_weight)[
i];
5059 for(
i=nV-1;
i>0;
i--)
5060 (*last_omega)[
i] = 1;
5061 (*last_omega)[0] = 10000;
5087 tif = tif + clock()-to;
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:");
5104 if(
MivSame(exivlp, target_weight)==1)
5109 Print(
"\n// time for the last std(Gw) = %.2f sec",
5110 ((
double) (clock()-tim)/1000000));
5125 xtlift = xtlift + clock() - to;
5149 #ifndef BUCHBERGER_ALG
5150 if(isNolVector(curr_weight) == 0)
5158 #endif // BUCHBERGER_ALG
5176 #ifdef BUCHBERGER_ALG
5183 tstd = tstd + clock() - to;
5199 tlift = tlift + clock() - to;
5219 tred = tred + clock() - to;
5223 xtred = xtred + clock() - to;
5238 tnw = tnw + clock() - to;
5240 #ifdef PRINT_VECTORS
5241 MivString(curr_weight, target_weight, next_weight);
5248 PrintS(
"\n// ** The computed vector does NOT stay in Cone!!\n");
5266 if(
MivComp(next_weight, ivNull) == 1)
5272 if(
MivComp(next_weight, target_weight) == 1)
5276 for(
i=nV-1;
i>=0;
i--)
5278 (*tmp_weight)[
i] = (*curr_weight)[
i];
5279 (*curr_weight)[
i] = (*next_weight)[
i];
5291 TimeString(tinput, tostd, tif, tstd, tlift, tred, tnw,
nstep);
◆ MwalkInitialForm()
ideal MwalkInitialForm |
( |
ideal |
G, |
|
|
intvec * |
ivw |
|
) |
| |
Definition at line 761 of file walk.cc.
767 ideal Gomega =
idInit(nG, 1);
769 for(
i=nG-1;
i>=0;
i--)
◆ MwalkNextWeightCC()
static intvec* MwalkNextWeightCC |
( |
intvec * |
curr_weight, |
|
|
intvec * |
target_weight, |
|
|
ideal |
G |
|
) |
| |
|
static |
Definition at line 2228 of file walk.cc.
2241 mpz_t t_zaehler, t_nenner;
2242 mpz_init(t_zaehler);
2245 mpz_t s_zaehler, s_nenner, temp, MwWd;
2246 mpz_init(s_zaehler);
2253 mpz_set_ui(sing_int, 2147483647);
2255 mpz_t sing_int_half;
2256 mpz_init(sing_int_half);
2257 mpz_set_ui(sing_int_half, 3*(1073741824/2));
2259 mpz_t deg_w0_p1, deg_d0_p1;
2260 mpz_init(deg_w0_p1);
2261 mpz_init(deg_d0_p1);
2285 for (
j=0;
j<nRing;
j++)
2287 (*diff_weight1)[
j] = (*curr_weight)[
j];
2291 for(
j=0;
j<nRing;
j++)
2293 (*curr_weight)[
j] = (*diff_weight1)[
j];
2295 for(
j=0;
j<nRing;
j++)
2297 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2303 for(
j=0;
j<nRing;
j++)
2305 (*diff_weight1)[
j] = (*curr_weight)[
j];
2310 (*curr_weight)[
j] = (*diff_weight1)[
j];
2312 (*diff_weight1)[
j] = ((*diff_weight1)[
j] + 5) / 10;
2317 intvec* diff_weight =
MivSub(target_weight, curr_weight);
2320 for (
j=0;
j<nG;
j++)
2335 mpz_sub(s_zaehler, deg_w0_p1, MwWd);
2336 if(mpz_cmp(s_zaehler, t_null) != 0)
2339 mpz_sub(s_nenner, MwWd, deg_d0_p1);
2341 if( (mpz_cmp(s_zaehler,t_null) > 0 &&
2342 mpz_cmp(s_nenner, s_zaehler)>=0) ||
2343 (mpz_cmp(s_zaehler, t_null) < 0 &&
2344 mpz_cmp(s_nenner, s_zaehler)<=0))
2347 if (mpz_cmp(s_zaehler, t_null) < 0)
2349 mpz_neg(s_zaehler, s_zaehler);
2350 mpz_neg(s_nenner, s_nenner);
2354 cancel(s_zaehler, s_nenner);
2356 if(mpz_cmp(t_nenner, t_null) != 0)
2358 mpz_mul(sztn, s_zaehler, t_nenner);
2359 mpz_mul(sntz, s_nenner, t_zaehler);
2361 if(mpz_cmp(sztn,sntz) < 0)
2363 mpz_add(t_nenner, t_null, s_nenner);
2364 mpz_add(t_zaehler,t_null, s_zaehler);
2369 mpz_add(t_nenner, t_null, s_nenner);
2370 mpz_add(t_zaehler,t_null, s_zaehler);
2380 mpz_t *
vec=(mpz_t*)
omAlloc(nRing*
sizeof(mpz_t));
2385 if(mpz_cmp(t_nenner, t_null) == 0)
2388 PrintS(
"\n//MwalkNextWeightCC: t_nenner=0\n");
2391 diff_weight =
ivCopy(curr_weight);
2396 if(mpz_cmp_si(t_nenner, 1)==0 && mpz_cmp_si(t_zaehler,1)==0)
2399 diff_weight =
ivCopy(target_weight);
2406 gcd_tmp = (*curr_weight)[0];
2408 for (
j=1;
j<nRing;
j++)
2410 gcd_tmp =
gcd(gcd_tmp, (*curr_weight)[
j]);
2418 for (
j=0;
j<nRing;
j++)
2420 gcd_tmp =
gcd(gcd_tmp, (*diff_weight)[
j]);
2429 for (
j=0;
j<nRing;
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);
2441 PrintS(
"\n// t_zaehler: "); mpz_out_str( stdout, 10, t_zaehler);
2442 PrintS(
", t_nenner: "); mpz_out_str( stdout, 10, t_nenner);
2450 for (
j=0;
j<nRing;
j++)
2452 mpz_set_si(dcw, (*curr_weight)[
j]);
2453 mpz_mul(s_nenner, t_nenner, dcw);
2455 if( (*diff_weight)[
j]>0)
2457 mpz_mul_ui(s_zaehler, t_zaehler, (*diff_weight)[
j]);
2461 mpz_mul_ui(s_zaehler, t_zaehler, -(*diff_weight)[
j]);
2462 mpz_neg(s_zaehler, s_zaehler);
2464 mpz_add(sntz, s_nenner, s_zaehler);
2465 mpz_init_set(
vec[
j], sntz);
2467 #ifdef NEXT_VECTORS_CC
2468 Print(
"\n// j = %d ==> ",
j);
2470 mpz_out_str( stdout, 10, t_nenner);
2471 Print(
" * %d)", (*curr_weight)[
j]);
2472 PrintS(
" + ("); mpz_out_str( stdout, 10, t_zaehler);
2473 Print(
" * %d) = ", (*diff_weight)[
j]);
2474 mpz_out_str( stdout, 10, s_nenner);
2476 mpz_out_str( stdout, 10, s_zaehler);
2477 PrintS(
" = "); mpz_out_str( stdout, 10, sntz);
2478 Print(
" ==> vector[%d]: ",
j); mpz_out_str(stdout, 10,
vec[
j]);
2487 if(mpz_cmp_si(ggt,1) != 0)
2489 mpz_gcd(ggt, ggt, sntz);
2494 if(mpz_cmp_si(ggt,1) != 0)
2496 for (
j=0;
j<nRing;
j++)
2501 #ifdef NEXT_VECTORS_CC
2502 PrintS(
"\n// gcd of elements of the vector: ");
2503 mpz_out_str( stdout, 10, ggt);
2506 for (
j=0;
j<nRing;
j++)
2508 (*diff_weight)[
j] = mpz_get_si(
vec[
j]);
2513 for (
j=0;
j<nRing;
j++)
2515 if(mpz_cmp(
vec[
j], sing_int)>=0)
2520 PrintS(
"\n// ** OVERFLOW in \"MwalkNextWeightCC\": ");
2521 mpz_out_str( stdout, 10,
vec[
j]);
2522 PrintS(
" is greater than 2147483647 (max. integer representation)\n");
2529 delete diff_weight1;
2530 mpz_clear(t_zaehler);
2531 mpz_clear(t_nenner);
2532 mpz_clear(s_zaehler);
2533 mpz_clear(s_nenner);
2538 mpz_clear(deg_w0_p1);
2539 mpz_clear(deg_d0_p1);
2542 mpz_clear(sing_int_half);
2543 mpz_clear(sing_int);
◆ MWalkRandomNextWeight()
static intvec* MWalkRandomNextWeight |
( |
ideal |
G, |
|
|
intvec * |
orig_M, |
|
|
intvec * |
target_weight, |
|
|
int |
weight_rad, |
|
|
int |
pert_deg |
|
) |
| |
|
static |
Definition at line 4516 of file walk.cc.
4520 target_weight !=
NULL &&
G->m[0] !=
NULL);
4531 (*curr_weight)[
i] = (*orig_M)[
i];
4534 int k=0,weight_norm;
4540 ideal G_test, G_test1, G_test2;
4548 while(weight_norm == 0)
4552 (*next_weight2)[
i] = rand() % 60000 - 30000;
4553 weight_norm = weight_norm + (*next_weight2)[
i]*(*next_weight2)[
i];
4555 weight_norm = 1 +
static_cast<int>(
sqrt(
double(weight_norm)));
4559 if((*next_weight2)[
i] < 0)
4561 (*next_weight2)[
i] = 1 + (*curr_weight)[
i] + weight_rad*(*next_weight2)[
i]/weight_norm;
4565 (*next_weight2)[
i] = (*curr_weight)[
i] + weight_rad*(*next_weight2)[
i]/weight_norm;
4575 found_random_weight =
TRUE;
4587 delete curr_weight1;
4605 if(found_random_weight ==
TRUE)
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];
4665 if(found_random_weight ==
TRUE)
4671 (*result)[
i] = (*next_weight2)[
i];
4678 (*result)[
i] = (*next_weight)[
i];
4686 (*result)[
i] = (*next_weight)[
i];
4692 delete next_weight2;
4695 if(found_random_weight ==
TRUE)
4702 delete next_weight1;
4709 return next_weight1;
◆ MwalkWeightDegree()
static int MwalkWeightDegree |
( |
poly |
p, |
|
|
intvec * |
weight_vector |
|
) |
| |
|
inlinestatic |
Definition at line 668 of file walk.cc.
671 int max = 0, maxtemp;
◆ NewVectorlp()
static intvec* NewVectorlp |
( |
ideal |
I | ) |
|
|
static |
◆ rec_fractal_call()
static ideal rec_fractal_call |
( |
ideal |
G, |
|
|
int |
nlev, |
|
|
intvec * |
ivtarget, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
|
static |
Definition at line 6951 of file walk.cc.
6957 Print(
"\n\n// Entering the %d-th recursion:", nlev);
6960 ring new_ring, testring;
6962 ideal Gomega, Gomega1, Gomega2, FF, F, Gresult, Gresult1, G1, Gt;
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--)
6983 (*last_omega)[
i] = 1;
6984 (*last_omega)[0] = 10000;
6987 for(
i=0;
i<nV;
i++) {
6989 (*omega)[
i] = (*Xsigma)[
i];
6991 (*omega)[
i] = (*Xsigma)[(nV*(nlev-1))+
i];
6993 (*omega2)[
i] = (*Xtau)[(nlev-1)*nV+
i];
6996 if(nlev == 1)
Xcall = 1;
7003 #ifdef FIRST_STEP_FRACTAL
7006 if((nlev == 1 &&
Xcall == 0) || (nlev == 2 &&
Xngleich == 1))
7016 NEXT_VECTOR_FRACTAL:
7023 xtnw=xtnw+clock()-to;
7029 if (
MivComp(next_vect, omega2) == 1)
7035 Print(
"\n//** rec_fractal_call: Perturb the both vectors with degree %d.",nlev);
7042 if(ivtarget->
length() == nV)
7061 if(ivtarget->
length() == nV)
7080 for(
i=nV-1;
i>=0;
i--) {
7081 (*omega2)[
i] = (*Xtau)[nV+
i];
7082 (*omega)[
i] = (*Xsigma)[nV+
i];
7093 xtnw=xtnw+clock()-to;
7097 #ifdef PRINT_VECTORS
7100 MivString(omega, omega2, next_vect);
7110 if(ivtarget->
length() == nV)
7125 #ifdef TEST_OVERFLOW
7127 Gt =
NULL;
return(Gt);
7131 Print(
"\n//** rec_fractal_call: Applying Buchberger's algorithm in ring r = %s;",
7140 xtextra=xtextra+clock()-to;
7148 Print(
"\n//** rec_fractal_call: Overflow. (4) Leaving the %d-th recursion with %d steps.\n",
7168 if(ivtarget->
length() == nV)
7193 Print(
"\n//** rec_fractal_call: Correct cone. (5) Leaving the %d-th recursion with %d steps.\n",
7198 idString(Gt,
"//** rec_fractal_call: Gt");
7206 PrintS(
"\n//** rec_fractal_call: Wrong cone. Tau doesn't stay in the correct cone.\n");
7209 #ifndef MSTDCC_FRACTAL
7211 if(ivtarget->
length() == nV)
7219 #ifdef TEST_OVERFLOW
7221 Gt =
NULL;
return(Gt);
7228 PrintS(
"\n//** rec_fractal_call: Updated vectors are equal to the old vectors.\n");
7231 goto FRACTAL_MSTDCC;
7237 for(
i=nV-1;
i>=0;
i--)
7238 (*omega2)[
i] = (*Xtau)[(nlev-1)*nV+
i];
7243 goto NEXT_VECTOR_FRACTAL;
7249 Print(
"\n//** rec_fractal_call: Wrong cone. Applying Buchberger's algorithm in ring = %s.\n",
7257 xtextra=xtextra+clock()-to;
7262 if(ivtarget->
length() == nV)
7286 if(ivtarget->
length() == nV)
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];
7328 xtif=xtif+clock()-to;
7330 #ifdef CHECK_IDEAL_MWALK
7333 idString(Gomega,
"//** rec_fractal_call: Gomega");
7347 goto NEXT_VECTOR_FRACTAL;
7351 #ifndef BUCHBERGER_ALG
7352 if(isNolVector(omega) == 0)
7358 if(ivtarget->
length() == nV)
7381 PrintS(
"\n//** rec_fractal_call: Maximal recursion depth.\n");
7386 #ifdef BUCHBERGER_ALG
7393 xtstd=xtstd+clock()-to;
7402 #ifdef CHECK_IDEAL_MWALK
7405 idString(Gresult,
"//** rec_fractal_call: M");
7420 xtlift=xtlift+clock()-to;
7422 #ifdef CHECK_IDEAL_MWALK
7425 idString(F,
"//** rec_fractal_call: F");
◆ REC_GB_Mwalk()
static ideal REC_GB_Mwalk |
( |
ideal |
G, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
orig_target_weight, |
|
|
int |
tp_deg, |
|
|
int |
npwinc |
|
) |
| |
|
static |
Definition at line 4719 of file walk.cc.
4726 int nwalk=0, endwalks=0, nnwinC=1, nlast = 0;
4727 ideal Gomega,
M, F, Gomega1, Gomega2, M1,F1,
result,ssG;
4728 ring newRing, oldRing, TargetRing;
4731 #ifndef BUCHBERGER_ALG
4735 for(
i=nV-1;
i>0;
i--)
4737 (*last_omega)[
i] = 1;
4739 (*last_omega)[0] = 10000;
4746 if(tp_deg > 1 && tp_deg <= nV)
4807 xtif = xtif + clock()-to;
4810 #ifndef BUCHBERGER_ALG
4811 if(isNolVector(curr_weight) == 0)
4839 #ifdef BUCHBERGER_ALG
4846 xtstd = xtstd + clock() - to;
4860 xtlift = xtlift + clock() -to;
4878 xtred = xtred + clock() -to;
4896 xtnw = xtnw + clock() - to;
4899 #ifdef PRINT_VECTORS
4900 MivString(curr_weight, target_weight, next_weight);
4914 if(
MivComp(next_weight, ivNull) == 1)
4921 if(
MivComp(next_weight, target_weight) == 1)
4929 G =
REC_GB_Mwalk(
G,curr_weight, orig_target_weight, tp_deg+1,nnwinC);
4936 for(
i=nV-1;
i>=0;
i--)
4938 (*curr_weight)[
i] = (*next_weight)[
i];
4961 F1 =
REC_GB_Mwalk(F1,curr_weight, orig_target_weight, tp_deg+1,nnwinC);
4967 F1 =
REC_GB_Mwalk(F1,curr_weight, orig_target_weight,tp_deg+1,nnwinC);
4970 delete target_weight;
5018 #ifndef BUCHBERGER_ALG
◆ Rec_LastGB()
static ideal Rec_LastGB |
( |
ideal |
G, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
orig_target_weight, |
|
|
int |
tp_deg, |
|
|
int |
npwinc |
|
) |
| |
|
static |
Definition at line 3933 of file walk.cc.
3942 clock_t tinput = clock();
3946 int nwalk=0, endwalks=0, nnwinC=1;
3948 ideal Gomega,
M, F, Gomega1, Gomega2, M1,F1,
result,ssG;
3949 ring newRing, oldRing, TargetRing;
3956 #ifndef BUCHBERGER_ALG
3962 for(
i=nV-1;
i>0;
i--)
3963 (*last_omega)[
i] = 1;
3964 (*last_omega)[0] = 10000;
3969 if(tp_deg > 1 && tp_deg <= nV)
4041 xtif=xtif+clock()-to;
4044 #ifndef BUCHBERGER_ALG
4045 if(isNolVector(curr_weight) == 0)
4053 #endif // BUCHBERGER_ALG
4072 #ifdef BUCHBERGER_ALG
4077 #endif // BUCHBERGER_ALG
4079 xtstd=xtstd+clock()-to;
4092 xtlift=xtlift+clock()-to;
4108 xtred=xtred+clock()-to;
4124 xtnw=xtnw+clock()-to;
4126 #ifdef PRINT_VECTORS
4127 MivString(curr_weight, target_weight, next_weight);
4132 #ifdef TEST_OVERFLOW
4145 if(
MivComp(next_weight, ivNull) == 1)
4152 if(
MivComp(next_weight, target_weight) == 1)
4163 tproc=tproc+clock()-tinput;
4169 G =
Rec_LastGB(
G,curr_weight, orig_target_weight, tp_deg+1,nnwinC);
4176 for(
i=nV-1;
i>=0;
i--)
4178 (*curr_weight)[
i] = (*next_weight)[
i];
4204 tproc=tproc+clock()-tinput;
4206 F1 =
Rec_LastGB(F1,curr_weight, orig_target_weight, tp_deg+1,nnwinC);
4208 delete target_weight;
4245 xtextra=xtextra+clock()-to;
◆ rec_r_fractal_call()
static ideal rec_r_fractal_call |
( |
ideal |
G, |
|
|
int |
nlev, |
|
|
intvec * |
ivtarget, |
|
|
int |
weight_rad, |
|
|
int |
reduction, |
|
|
int |
printout |
|
) |
| |
|
static |
Definition at line 7453 of file walk.cc.
7460 ring new_ring, testring;
7462 ideal Gomega, Gomega1, Gomega2, F, FF, Gresult, Gresult1, G1, Gt;
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--)
7486 (*last_omega)[
i] = 1;
7487 (*last_omega)[0] = 10000;
7490 for(
i=0;
i<nV;
i++) {
7492 (*omega)[
i] = (*Xsigma)[
i];
7494 (*omega)[
i] = (*Xsigma)[(nV*(nlev-1))+
i];
7496 (*omega2)[
i] = (*Xtau)[(nlev-1)*nV+
i];
7499 if(nlev == 1)
Xcall = 1;
7506 #ifdef FIRST_STEP_FRACTAL
7511 if((nlev == 1 &&
Xcall == 0) || (nlev == 2 &&
Xngleich == 1))
7521 NEXT_VECTOR_FRACTAL:
7528 xtnw=xtnw+clock()-to;
7534 PrintS(
"\n**// rec_r_fractal_call: there is a polynomial in Gomega with at least 3 monomials.\n");
7543 xtnw=xtnw+clock()-to;
7553 xtnw=xtnw+clock()-to;
7561 if (
MivComp(next_vect, omega2) == 1)
7567 Print(
"\n//** rec_r_fractal_call: Perturb both vectors with degree %d.",nlev);
7572 if(ivtarget->
length() == nV)
7591 if(ivtarget->
length() == nV)
7607 if(ivtarget->
length() > nV)
7615 for(
i=nV-1;
i>=0;
i--)
7617 (*omega2)[
i] = (*Xtau)[nV+
i];
7618 (*omega)[
i] = (*Xsigma)[nV+
i];
7630 xtnw=xtnw+clock()-to;
7642 xtnw=xtnw+clock()-to;
7653 xtnw=xtnw+clock()-to;
7658 #ifdef PRINT_VECTORS
7661 MivString(omega, omega2, next_vect);
7672 if(ivtarget->
length() == nV)
7691 #ifdef TEST_OVERFLOW
7698 Print(
"\n//** rec_r_fractal_call: applying Buchberger's algorithm in ring r = %s;",
7707 xtextra=xtextra+clock()-to;
7715 Print(
"\n//** rec_r_fractal_call: (1) Leaving the %d-th recursion with %d steps.\n",
7734 if(ivtarget->
length() == nV)
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
7773 #ifdef PRINT_VECTORS
7780 if(ivtarget->
length() == nV)
7788 #ifdef TEST_OVERFLOW
7790 Gt =
NULL;
return(Gt);
7797 goto FRACTAL_MSTDCC;
7802 #ifdef PRINT_VECTORS
7809 for(
i=nV-1;
i>=0;
i--)
7810 (*omega2)[
i] = (*Xtau)[(nlev-1)*nV+
i];
7816 goto NEXT_VECTOR_FRACTAL;
7822 Print(
"\n//** rec_r_fractal_call: apply Buchberger's algorithm in ring = %s.\n",
7830 xtextra=xtextra+clock()-to;
7835 if(ivtarget->
length() == nV)
7859 if(ivtarget->
length() == nV)
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];
7902 xtif=xtif+clock()-to;
7906 #ifdef CHECK_IDEAL_MWALK
7909 idString(Gomega,
"//** rec_r_fractal_call: Gomega");
7923 goto NEXT_VECTOR_FRACTAL;
7927 #ifndef BUCHBERGER_ALG
7928 if(isNolVector(omega) == 0)
7933 if(ivtarget->
length() == nV)
7957 #ifdef BUCHBERGER_ALG
7964 xtstd=xtstd+clock()-to;
7973 #ifdef CHECK_IDEAL_MWALK
7976 idString(Gresult,
"//** rec_r_fractal_call: M");
7991 xtlift=xtlift+clock()-to;
7993 #ifdef CHECK_IDEAL_MWALK
7996 idString(F,
"//** rec_r_fractal_call: F");
◆ Set_Error()
◆ test_G_GB_walk()
static int test_G_GB_walk |
( |
ideal |
H0, |
|
|
ideal |
H1 |
|
) |
| |
|
inlinestatic |
◆ test_w_in_ConeCC()
static int test_w_in_ConeCC |
( |
ideal |
G, |
|
|
intvec * |
iv |
|
) |
| |
|
static |
Definition at line 785 of file walk.cc.
789 PrintS(
"//** the result may be WRONG, i.e. 0!!\n");
799 for(
i=nG-1;
i>=0;
i--)
◆ TranMImprovwalk()
ideal TranMImprovwalk |
( |
ideal |
G, |
|
|
intvec * |
curr_weight, |
|
|
intvec * |
target_tmp, |
|
|
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
◆ VMatrDefault()
static ring VMatrDefault |
( |
intvec * |
va | ) |
|
|
static |
Definition at line 2790 of file walk.cc.
2800 r->wvhdl[0] = (
int*)
omAlloc(nv*nv*
sizeof(
int));
2804 for(
i=0;
i<nv*nv;
i++)
2805 r->wvhdl[0][
i] = (*va)[
i];
2809 r->block0 = (
int *)
omAlloc0(nb *
sizeof(
int *));
2810 r->block1 = (
int *)
omAlloc0(nb *
sizeof(
int *));
◆ VMatrRefine()
Definition at line 2841 of file walk.cc.
2852 r->wvhdl[0] = (
int*)
omAlloc(nv*
sizeof(
int));
2853 r->wvhdl[1] = (
int*)
omAlloc(nvs*
sizeof(
int));
2856 for(
i=0;
i<nvs;
i++)
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 *));
◆ VMrDefault()
static ring VMrDefault |
( |
intvec * |
va | ) |
|
|
static |
Definition at line 2680 of file walk.cc.
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 *));
◆ VMrDefaultlp()
static void VMrDefaultlp |
( |
void |
| ) |
|
|
static |
Definition at line 2898 of file walk.cc.
2911 r->block0 = (
int *)
omAlloc0(nb *
sizeof(
int *));
2912 r->block1 = (
int *)
omAlloc0(nb *
sizeof(
int *));
◆ VMrRefine()
Definition at line 2731 of file walk.cc.
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 *));
◆ ngleich
◆ nnflow
◆ nstep
◆ Overflow_Error
◆ pSetm_error
◆ Xcall
◆ Xivinput
◆ Xivlp
◆ XivNull
◆ xn
◆ Xngleich
◆ Xnlev
◆ Xsigma
◆ Xtau
static void ivString(intvec *iv, const char *ch)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
static ring VMatrDefault(intvec *va)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
static ideal idVec2Ideal(poly vec)
#define pIsConstant(p)
like above, except that Comp might be != 0
void initBuchMoraCrit(kStrategy strat)
static ideal MidMult(ideal A, ideal B)
void reduction(LList *sPolyList, CListOld *critPairs, LList *gPrev, RList *rules, LTagList *lTag, RTagList *rTag, ideal gbPrev, PList *rejectedGBList, int plus)
static intvec * MExpPol(poly f)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
#define idDelete(H)
delete an ideal
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
void rChangeCurrRing(ring r)
static ideal kInterRedCC(ideal F, ideal Q)
#define pGetExp(p, i)
Exponent.
static int maxlengthpoly(ideal G)
static int isNegNolVector(intvec *hilb)
KINLINE unsigned long * initsevT()
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 MivAbsMax(intvec *vec)
static BOOLEAN length(leftv result, leftv arg)
poly singclap_pdivide(poly f, poly g, const ring r)
static int MwalkWeightDegree(poly p, intvec *weight_vector)
void updateS(BOOLEAN toT, kStrategy strat)
static ideal idHeadCC(ideal h)
gmp_float sqrt(const gmp_float &a)
static long MivDotProduct(intvec *a, intvec *b)
const CanonicalForm CFMap CFMap & N
static ideal LastGB(ideal G, intvec *curr_weight, int tp_deg)
static ideal REC_GB_Mwalk(ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc)
static void idString(ideal L, const char *st)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
static unsigned pLength(poly a)
static int MivAbsMaxArg(intvec *vec)
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)
#define TEST_OPT_INTSTRATEGY
intvec * ivCopy(const intvec *o)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
void Set_Error(BOOLEAN f)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static ideal Rec_LastGB(ideal G, intvec *curr_weight, intvec *orig_target_weight, int tp_deg, int npwinc)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
void initEcartNormal(TObject *h)
void PrintS(const char *s)
#define omFreeSize(addr, size)
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
static void cancel(mpz_t zaehler, mpz_t nenner)
void completeReduce(kStrategy strat, BOOLEAN withT)
static int max(int a, int b)
#define SI_RESTORE_OPT(A, B)
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 int rBlocks(ring r)
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)
static intvec * NewVectorlp(ideal I)
void rDelete(ring r)
unconditionally deletes fields in r
static intvec * MivSub(intvec *a, intvec *b)
intvec * MivMatrixOrderlp(int nV)
static int test_G_GB_walk(ideal H0, ideal H1)
intvec * hFirstSeries(ideal S, intvec *modulweight, ideal Q, intvec *wdegree, ring tailRing)
intvec * MkInterRedNextWeight(intvec *iva, intvec *ivb, ideal G)
static void MLmWeightedDegree_gmp(mpz_t result, const poly p, intvec *weight)
static void DefRingParlp(void)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void WerrorS(const char *s)
#define pEqualPolys(p1, p2)
static ideal Mpwalk_MAltwalk1(ideal Go, intvec *curr_weight, int tp_deg)
static int islengthpoly2(ideal G)
static int MLmWeightedDegree(const poly p, intvec *weight)
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
#define SI_SAVE_OPT(A, B)
intvec * MivWeightOrderlp(intvec *ivstart)
void(* initEcart)(TObject *L)
intvec * Mfpertvector(ideal G, intvec *ivtarget)
#define pCopy(p)
return a copy of the poly
int(* posInT)(const TSet T, const int tl, LObject &h)
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)
int posInT0(const TSet, const int length, LObject &)
#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)
KINLINE TObject ** initR()
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
static ring VMatrRefine(intvec *va, intvec *vb)
void id_Normalize(ideal I, const ring r)
normialize all polys in id
void initS(ideal F, ideal Q, kStrategy strat)
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)