 |
My Project
UNKNOWN_GIT_VERSION
|
Go to the source code of this file.
|
double | wFunctionalMora (int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr) |
|
double | wFunctionalBuch (int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr) |
|
void | wAdd (int *A, int mons, int kn, int xx, int rvar) |
|
void | wNorm (int *degw, int *lpol, int npol, double *rel) |
|
void | wFirstSearch (int *A, int *x, int mons, int *lpol, int npol, double *rel, double *fopt, double wNsqr, int rvar) |
|
void | wSecondSearch (int *A, int *x, int *lpol, int npol, int mons, double *rel, double *fk, double wNsqr, int rvar) |
|
void | wGcd (int *x, int n) |
|
static void | wDimensions (poly *s, int sl, int *lpol, int *npol, int *mons) |
|
static void | wInit (poly *s, int sl, int mons, int *A, const ring R) |
|
void | wCall (poly *s, int sl, int *x, double wNsqr, const ring R) |
|
void | kEcartWeights (poly *s, int sl, short *eweight, const ring R) |
|
short * | iv2array (intvec *iv, const ring R) |
|
long | totaldegreeWecart (poly p, ring r) |
|
long | totaldegreeWecart_IV (poly p, ring r, const short *w) |
|
long | maxdegreeWecart (poly p, int *l, ring r) |
|
|
double(* | wFunctional )(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr) |
|
◆ iv2array()
◆ kEcartWeights()
void kEcartWeights |
( |
poly * |
s, |
|
|
int |
sl, |
|
|
short * |
eweight, |
|
|
const ring |
R |
|
) |
| |
Definition at line 188 of file weight.cc.
199 x = (
int * )
omAlloc(2 * (n + 1) *
sizeof(int));
200 wCall(
s, sl,
x, (
double)2.0 / (
double)n,
R);
201 for (
i = n;
i!=0;
i--)
202 eweight[
i] =
x[
i + n + 1];
◆ maxdegreeWecart()
long maxdegreeWecart |
( |
poly |
p, |
|
|
int * |
l, |
|
|
ring |
r |
|
) |
| |
◆ totaldegreeWecart()
long totaldegreeWecart |
( |
poly |
p, |
|
|
ring |
r |
|
) |
| |
◆ totaldegreeWecart_IV()
long totaldegreeWecart_IV |
( |
poly |
p, |
|
|
ring |
r, |
|
|
const short * |
w |
|
) |
| |
◆ wAdd()
void wAdd |
( |
int * |
A, |
|
|
int |
mons, |
|
|
int |
kn, |
|
|
int |
xx, |
|
|
int |
rvar |
|
) |
| |
Definition at line 132 of file weight0.c.
136 B =
A + ((kn - 1) * mons);
137 ex =
A + (rvar * mons);
147 *ex++ += (*
B++) * xx;
◆ wCall()
void wCall |
( |
poly * |
s, |
|
|
int |
sl, |
|
|
int * |
x, |
|
|
double |
wNsqr, |
|
|
const ring |
R |
|
) |
| |
Definition at line 114 of file weight.cc.
116 int n, q, npol, mons,
i;
117 int *
A, *xopt, *lpol, *degw;
118 double f1, fx, eps, *rel;
122 lpol = (
int * )
omAlloc((sl + 1) *
sizeof(int));
125 for (
i = n;
i!=0;
i--)
134 q = (n + 1) * mons *
sizeof(
int);
137 degw =
A + (n * mons);
138 memset(degw, 0, mons *
sizeof(
int));
139 for (
i = n;
i!=0;
i--)
141 wNorm(degw, lpol, npol, rel);
142 f1 = (*wFunctional)(degw, lpol, npol, rel, (double)1.0, wNsqr);
145 fx = (double)2.0 * eps;
146 memset(
x, 0, (n + 1) *
sizeof(
int));
149 memcpy(
x + 1, xopt + 1, n *
sizeof(
int));
150 memset(degw, 0, mons *
sizeof(
int));
151 for (
i = n;
i!=0;
i--)
160 for (
i = n;
i!=0;
i--)
◆ wDimensions()
static void wDimensions |
( |
poly * |
s, |
|
|
int |
sl, |
|
|
int * |
lpol, |
|
|
int * |
npol, |
|
|
int * |
mons |
|
) |
| |
|
static |
◆ wFirstSearch()
void wFirstSearch |
( |
int * |
A, |
|
|
int * |
x, |
|
|
int |
mons, |
|
|
int * |
lpol, |
|
|
int |
npol, |
|
|
double * |
rel, |
|
|
double * |
fopt, |
|
|
double |
wNsqr, |
|
|
int |
rvar |
|
) |
| |
Definition at line 152 of file weight0.c.
155 int a0, a, n,
xn, t, xx, y1;
156 int *
y, *degw, *xopt;
163 xn = n + 6 + (21 / n);
164 a0 = n *
sizeof(double);
171 degw =
A + (n * mons);
179 wx = pr[t-1] * (double)xx;
181 if ((y1 + n - t) <=
xn)
187 wAdd(
A, mons, t, 1, rvar);
195 wSub(
A, mons, t, xx, rvar);
207 wx = pr[t-1] * (double)xx;
211 wAdd(
A, mons, t, xx, rvar);
212 fmax = (*wFunctional)(degw, lpol, npol, rel, wx,wNsqr);
214 wSub(
A, mons, t, xx, rvar);
218 memcpy(xopt,
x + 1, a);
◆ wFunctionalBuch()
double wFunctionalBuch |
( |
int * |
degw, |
|
|
int * |
lpol, |
|
|
int |
npol, |
|
|
double * |
rel, |
|
|
double |
wx, |
|
|
double |
wNsqr |
|
) |
| |
Definition at line 78 of file weight0.c.
81 int i,
j, ecl, ecu, ec;
83 double gfmax, ghom, pfmax;
90 for (
i = 0;
i < npol;
i++)
93 for (
j = lpol[
i] - 1;
j!=0 ;
j--)
101 pfmax = (double)ecl / (
double)ecu;
104 gfmax += (double)(ecu * ecu) * (*r++);
106 if (ghom > (
double)0.5)
107 gfmax *= ((double)1.0 - (ghom * ghom)) / (
double)0.75;
108 return gfmax /
pow(wx, wNsqr);
◆ wFunctionalMora()
double wFunctionalMora |
( |
int * |
degw, |
|
|
int * |
lpol, |
|
|
int |
npol, |
|
|
double * |
rel, |
|
|
double |
wx, |
|
|
double |
wNsqr |
|
) |
| |
Definition at line 34 of file weight0.c.
37 int i,
j, e1, ecu, ecl, ec;
39 double gfmax, gecart, ghom, pfmax;
45 gecart = (double)0.4 + (
double)npol;
47 for (
i = 0;
i < npol;
i++)
49 ecl = ecu = e1 = *ex++;
50 for (
j = lpol[
i] - 1;
j!=0;
j--)
58 pfmax = (double)ecl / (
double)ecu;
61 pfmax = (double)e1 / (
double)ecu;
62 if (pfmax > (
double)0.5)
63 gecart -= (pfmax * pfmax);
65 gecart -= (double)0.25;
67 gfmax += (double)(ecu * ecu) * (*r++);
69 if (ghom > (
double)0.8)
72 gecart *= ((double)5.0 - ghom);
74 return (gfmax * gecart) /
pow(wx, wNsqr);
◆ wGcd()
void wGcd |
( |
int * |
x, |
|
|
int |
n |
|
) |
| |
◆ wInit()
static void wInit |
( |
poly * |
s, |
|
|
int |
sl, |
|
|
int |
mons, |
|
|
int * |
A, |
|
|
const ring |
R |
|
) |
| |
|
static |
Definition at line 70 of file weight.cc.
72 int n, a,
i,
j, *
B, *C;
78 a = (n + 1) *
sizeof(
int);
80 for (
i = 0;
i <= sl;
i++)
91 for (
j = 0;
j < n;
j++)
102 for (
j = 0;
j < n;
j++)
◆ wNorm()
void wNorm |
( |
int * |
degw, |
|
|
int * |
lpol, |
|
|
int |
npol, |
|
|
double * |
rel |
|
) |
| |
Definition at line 463 of file weight0.c.
471 for (
i = 0;
i < npol;
i++)
474 for (
j = lpol[
i] - 1;
j!=0 ;
j--)
480 *r = (double)1.0 / (
double)(ecu * ecu);
◆ wSecondSearch()
void wSecondSearch |
( |
int * |
A, |
|
|
int * |
x, |
|
|
int * |
lpol, |
|
|
int |
npol, |
|
|
int |
mons, |
|
|
double * |
rel, |
|
|
double * |
fk, |
|
|
double |
wNsqr, |
|
|
int |
rvar |
|
) |
| |
Definition at line 295 of file weight0.c.
298 int n, s0, s1, s2, *xopt;
303 fopt = *fk * (double)0.999999999999;
307 wEstimate(
A,
x, lpol, npol, mons, wx, rel, &fx, &s0, &s1, &s2, wNsqr, rvar);
326 memcpy(xopt,
x + 1, n *
sizeof(
int));
334 memcpy(xopt,
x + 1, n *
sizeof(
int));
340 wSub(
A, mons, s0, 1, rvar);
343 wSub(
A, mons, s1, 1, rvar);
344 wSub(
A, mons, s2, 1, rvar);
◆ wFunctional
double(* wFunctional) (int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr) |
static int si_min(const int a, const int b)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static double wPrWeight(int *x, int n)
const CanonicalForm int const CFList const Variable & y
void wAdd(int *A, int mons, int kn, int xx, int rvar)
long totaldegreeWecart(poly p, ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
#define omFreeSize(addr, size)
void wSecondSearch(int *A, int *x, int *lpol, int npol, int mons, double *rel, double *fk, double wNsqr, int rvar)
double wFunctionalMora(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
static int max(int a, int b)
static void wSub(int *A, int mons, int kn, int xx, int rvar)
void wAdd(int *A, int mons, int kn, int xx, int rvar)
static void wEstimate(int *A, int *x, int *lpol, int npol, int mons, double wx, double *rel, double *fopt, int *s0, int *s1, int *s2, double wNsqr, int rvar)
static void p_GetExpV(poly p, int *ev, const ring r)
double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
static void wDimensions(poly *s, int sl, int *lpol, int *npol, int *mons)
void wFirstSearch(int *A, int *x, int mons, int *lpol, int npol, double *rel, double *fopt, double wNsqr, int rvar)
Rational pow(const Rational &a, int e)
void wNorm(int *degw, int *lpol, int npol, double *rel)
static void wInit(poly *s, int sl, int mons, int *A, const ring R)
const CanonicalForm int s