109{
110 int n, q, npol, mons,
i;
111 int *
A, *xopt, *lpol, *degw;
112 double f1, fx, eps, *rel;
113 void *adr;
114
116 lpol = (
int * )
omAlloc((sl + 1) *
sizeof(int));
119 for (
i = n;
i!=0;
i--)
121 if (mons==0)
122 {
124 return;
125 }
127 rel = (double*)adr;
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);
138 eps = f1;
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--)
146 {
149 }
152 if (fx >= eps)
153 {
154 for (
i = n;
i!=0;
i--)
156 }
157 else
158 {
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175 }
179}
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)
static void wDimensions(poly *s, int sl, int *lpol, int *npol, int *mons)
void wNorm(int *degw, int *lpol, int npol, double *rel)
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)