159{
161 int pos=0;
163 {
165 {
166 unsigned long ord=0;
169 {
171 {
172 int a,e;
175 for(
int i=a;
i<=e;
i++) ord+=p_GetExp(
p,
i,r);
176 p->exp[o->
data.dp.place]=ord;
177 break;
178 }
182 {
183 int a,e;
186 int *
w=o->
data.wp.weights;
187#if 1
188 for(
int i=a;
i<=e;
i++) ord+=((
unsigned long)p_GetExp(
p,
i,r))*((
unsigned long)
w[
i-a]);
189#else
190 long ai;
191 int ei,wi;
192 for(
int i=a;
i<=e;
i++)
193 {
196 ai=ei*wi;
198 ord+=ai;
200 }
201#endif
202 p->exp[o->
data.wp.place]=ord;
203 break;
204 }
206 {
208 const short a=o->
data.am.start;
209 const short e=o->
data.am.end;
210 const int *
w=o->
data.am.weights;
211#if 1
212 for(
short i=a;
i<=e;
i++,
w++)
213 ord += ((*
w) * p_GetExp(
p,
i,r));
214#else
215 long ai;
216 int ei,wi;
217 for(
short i=a;
i<=e;
i++)
218 {
221 ai=ei*wi;
223 ord += ai;
225 }
226#endif
228
229 const short len_gen= o->
data.am.len_gen;
230
231 if ((c > 0) && (c <= len_gen))
232 {
236 }
237
238 p->exp[o->
data.am.place] = ord;
239 break;
240 }
242 {
244 int a,e;
245 a=o->
data.wp64.start;
249 for(
int i=a;
i<=e;
i++)
250 {
251
252
255 ai=ei*wi;
256 if(ei!=0 && ai/ei!=wi)
257 {
259 #if SIZEOF_LONG == 4
260 Print(
"ai %lld, wi %lld\n",ai,wi);
261 #else
262 Print(
"ai %ld, wi %ld\n",ai,wi);
263 #endif
264 }
265 ord+=ai;
266 if (ord<ai)
267 {
269 #if SIZEOF_LONG == 4
270 Print(
"ai %lld, ord %lld\n",ai,ord);
271 #else
272 Print(
"ai %ld, ord %ld\n",ai,ord);
273 #endif
274 }
275 }
276 #if SIZEOF_LONG == 4
278 long a_0=(long)(ord&mask);
279 long a_1=(long)(ord >>31 );
280
281
282
283
284
285 p->exp[o->
data.wp64.place]=a_1;
286 p->exp[o->
data.wp64.place+1]=a_0;
287 #elif SIZEOF_LONG == 8
288 p->exp[o->
data.wp64.place]=ord;
289 #endif
290
291
292
293
294
295 break;
296 }
298 {
299 int a,e;
302 int pl=o->
data.cp.place;
303 for(
int i=a;
i<=e;
i++) {
p->exp[pl]=p_GetExp(
p,
i,r); pl++; }
304 break;
305 }
307 {
309 long sc = c;
311 o->
data.syzcomp.Components);
313 o->
data.syzcomp.ShiftedComponents);
314 if (ShiftedComponents !=
NULL)
315 {
317 assume(c == 0 || Components[c] != 0);
318 sc = ShiftedComponents[Components[c]];
319 assume(c == 0 || sc != 0);
320 }
321 p->exp[o->
data.syzcomp.place]=sc;
322 break;
323 }
325 {
327 const short place = o->
data.syz.place;
328 const int limit = o->
data.syz.limit;
329
330 if (c > (unsigned long)limit)
331 p->exp[place] = o->
data.syz.curr_index;
332 else if (c > 0)
333 {
334 assume( (1 <= c) && (c <= (
unsigned long)limit) );
335 p->exp[place]= o->
data.syz.syz_index[c];
336 }
337 else
338 {
341 }
342 break;
343 }
344
346 {
348
349#ifndef SING_NDEBUG
350#if MYTEST
351 Print(
"p_Setm_General: ro_isTemp ord: pos: %d, p: ", pos);
p_wrp(
p, r);
352#endif
353#endif
355
357
358
359
360 const int*
const pVarOffset = o->
data.isTemp.pVarOffset;
361
363
364
365 for(
int i = 1;
i <= r->N;
i++ )
366 {
367 const int vo = pVarOffset[
i];
368 if( vo != -1)
369 {
370
371 p_SetExp(
p, p_GetExp(
p,
i, r), r, vo);
372
373 assume( p_GetExp(
p, r, vo) == p_GetExp(
p,
i, r) );
374 }
375 }
376#ifndef SING_NDEBUG
377 for(
int i = 1;
i <= r->N;
i++ )
378 {
379 const int vo = pVarOffset[
i];
380 if( vo != -1)
381 {
382
383 assume( p_GetExp(
p, r, vo) == p_GetExp(
p,
i, r) );
384 }
385 }
386#if MYTEST
387
389#endif
390#endif
391 break;
392 }
393
394
396 {
397#ifndef SING_NDEBUG
398#if MYTEST
399 Print(
"p_Setm_General: ro_is ord: pos: %d, p: ", pos);
p_wrp(
p, r);
400#endif
401#endif
402
404
406
408 const ideal F = o->
data.is.F;
409 const int limit = o->
data.is.limit;
411 const int start = o->
data.is.start;
412
413 if( F !=
NULL && c > limit )
414 {
415#ifndef SING_NDEBUG
416#if MYTEST
417 Print(
"p_Setm_General: ro_is : in rSetm: pos: %d, c: %d > limit: %d\n", c, pos, limit);
418 PrintS(
"preComputed Values: ");
420#endif
421#endif
422
424
425
426
427
428 c -= limit;
430 c--;
431
433 break;
434
436
437 const poly
pp = F->m[c];
438
440 break;
441
443
444#ifndef SING_NDEBUG
445#if MYTEST
446 Print(
"Respective F[c - %d: %d] pp: ", limit, c);
448#endif
449#endif
450
451 const int end = o->
data.is.end;
453
454
455
456
457#ifndef SING_NDEBUG
458#if MYTEST
459 Print(
"p_Setm_General: is(-Temp-) :: c: %d, limit: %d, [st:%d] ===>>> %ld\n", c, limit, start,
p->exp[start]);
460#endif
461#endif
462
463
464
465 for(
int i = start;
i <= end;
i++)
466 p->exp[
i] +=
pp->exp[
i];
467
468
469 if (r->NegWeightL_Offset !=
NULL)
470 {
471 for (
int i=r->NegWeightL_Size-1;
i>=0;
i--)
472 {
473 const int _i = r->NegWeightL_Offset[
i];
474 if( start <= _i && _i <= end )
476 }
477 }
478
479
480#ifndef SING_NDEBUG
481 const int*
const pVarOffset = o->
data.is.pVarOffset;
482
484
485 for(
int i = 1;
i <= r->N;
i++ )
486 {
487 const int vo = pVarOffset[
i];
488 if( vo != -1)
489
490 assume( p_GetExp(
p, r, vo) == (p_GetExp(
p,
i, r) + p_GetExp(
pp, r, vo)) );
491 }
492
493#if MYTEST
495#endif
496#endif
497 } else
498 {
500
501 const int*
const pVarOffset = o->
data.is.pVarOffset;
502
503
504
505
506 const int vo = pVarOffset[0];
507 if( vo != -1 )
509
510#ifndef SING_NDEBUG
511#if MYTEST
512 Print(
"ELSE p_Setm_General: ro_is :: c: %d <= limit: %d, vo: %d, exp: %d\n", c, limit, vo,
p->exp[vo]);
514#endif
515#endif
516 }
517
518 break;
519 }
520 default:
522 return;
523 }
524 pos++;
525 if (pos == r->OrdSize) return;
526 }
527 }
528}
int dReportError(const char *fmt,...)
#define POLY_NEGWEIGHT_OFFSET
#define __p_GetComp(p, r)
STATIC_VAR int _componentsExternal
STATIC_VAR long * _componentsShifted
STATIC_VAR int * _components
BOOLEAN p_LmCheckPolyRing(poly p, ring r)
void PrintS(const char *s)