21 double *rel,
double wx,
double wNsqr);
23 double *rel,
double wx,
double wNsqr);
25 double *rel,
double wx,
double wNsqr);
26void wAdd(
int *
A,
int mons,
int kn,
int xx,
int rvar);
27void wNorm(
int *degw,
int *lpol,
int npol,
double *rel);
29 int *lpol,
int npol,
double *rel,
double *fopt,
double wNsqr,
int rvar);
31 int npol,
int mons,
double *rel,
double *fk,
double wNsqr,
int rvar);
32void wGcd(
int *
x,
int n);
34static void wDimensions(poly*
s,
int sl,
int *lpol,
int *npol,
int *mons)
40 for (
i = 0;
i <= sl;
i++)
64static void wInit(poly*
s,
int sl,
int mons,
int *
A,
const ring
R)
66 int n, a,
i,
j, *
B, *C;
72 a = (n + 1) *
sizeof(
int);
74 for (
i = 0;
i <= sl;
i++)
85 for (
j = 0;
j < n;
j++)
96 for (
j = 0;
j < n;
j++)
108void wCall(poly*
s,
int sl,
int *
x,
double wNsqr,
const ring
R)
110 int n, q, npol, mons,
i;
111 int *
A, *xopt, *lpol, *degw;
112 double f1, fx, eps, *rel;
116 lpol = (
int * )
omAlloc((sl + 1) *
sizeof(int));
119 for (
i = n;
i!=0;
i--)
128 q = (n + 1) * mons *
sizeof(
int);
131 degw =
A + (n * mons);
132 memset(degw, 0, mons *
sizeof(
int));
133 for (
i = n;
i!=0;
i--)
135 wNorm(degw, lpol, npol, rel);
136 f1 = (*wFunctional)(degw, lpol, npol, rel, (double)1.0, wNsqr);
139 fx = (double)2.0 * eps;
140 memset(
x, 0, (n + 1) *
sizeof(
int));
143 memcpy(
x + 1, xopt + 1, n *
sizeof(
int));
144 memset(degw, 0, mons *
sizeof(
int));
145 for (
i = n;
i!=0;
i--)
154 for (
i = n;
i!=0;
i--)
193 x = (
int * )
omAlloc(2 * (n + 1) *
sizeof(int));
194 wCall(
s, sl,
x, (
double)2.0 / (
double)n,
R);
195 for (
i = n;
i!=0;
i--)
196 eweight[
i] =
x[
i + n + 1];
208 for(
i=len;
i>0;
i--)
s[
i]=(*iv)[
i-1];
static int si_min(const int a, const int b)
const CanonicalForm int s
static int max(int a, int b)
#define omFreeSize(addr, size)
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 void p_GetExpV(poly p, int *ev, const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
THREAD_VAR double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
int * iv2array(intvec *iv, const ring R)
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)
long totaldegreeWecart(poly p, ring r)
static void wDimensions(poly *s, int sl, int *lpol, int *npol, int *mons)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
void wNorm(int *degw, int *lpol, int npol, double *rel)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
long maxdegreeWecart(poly p, int *l, ring r)
long totaldegreeWecart_IV(poly p, ring r, const int *w)
static void wInit(poly *s, int sl, int mons, int *A, const ring R)
void wAdd(int *A, int mons, int kn, int xx, int rvar)
double wFunctionalMora(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
void kEcartWeights(poly *s, int sl, short *eweight, const ring R)
EXTERN_VAR short * ecartWeights