Macaulay2 Engine
Loading...
Searching...
No Matches
imonorder.cpp
Go to the documentation of this file.
1// Copyright 2009 Michael E. Stillman
2
3#include "imonorder.hpp"
4
5#include "engine-includes.hpp"
6
7#ifdef HAVE_ALLOCA_H
8# include <alloca.h>
9#else
10# include <malloc.h>
11#endif
12
13#include "ExponentVector.hpp"
14#include "overflow.hpp"
15
16std::vector<bool> laurentVariables(const MonomialOrder* mo)
17{
18 std::vector<bool> result;
19 for (auto i = 0; i < mo->nvars; ++i)
20 result.push_back(mo->is_laurent[i] == 1);
21 return result;
22}
23/* TODO:
24 -- negative exponent versions need to be included (at least for MO_LEX)
25 -- non-commutative blocks should be added in
26*/
27
28static void mo_block_revlex(struct mo_block *b, int nvars)
29{
30 b->typ = MO_REVLEX;
31 b->nvars = nvars;
32 b->nslots = nvars;
33 b->first_exp = 0; /* will be set later */
34 b->first_slot = 0; /* will be set later */
35 b->nweights = 0;
36 b->weights = nullptr;
37}
38
39static void mo_block_grevlex(struct mo_block *b, int nvars)
40{
41 b->typ = MO_GREVLEX;
42 b->nvars = nvars;
43 b->nslots = nvars;
44 b->first_exp = 0; /* will be set later */
45 b->first_slot = 0; /* will be set later */
46 b->nweights = 0;
47 b->weights = nullptr;
48}
49
50static void mo_block_grevlex2(struct mo_block *b, int nvars)
51{
52 b->typ = MO_GREVLEX2;
53 b->nvars = nvars;
54 b->nslots = (nvars + 1) / 2; /* 2 per word */
55 b->first_exp = 0; /* will be set later */
56 b->first_slot = 0; /* will be set later */
57 b->nweights = 0;
58 b->weights = nullptr;
59}
60
61static void mo_block_grevlex4(struct mo_block *b, int nvars)
62{
63 b->typ = MO_GREVLEX4;
64 b->nvars = nvars;
65 b->nslots = (nvars + 3) / 4; /* 4 per word */
66 b->first_exp = 0; /* will be set later */
67 b->first_slot = 0; /* will be set later */
68 b->nweights = 0;
69 b->weights = nullptr;
70}
71
72static void mo_block_grevlex_wts(struct mo_block *b, int nvars)
73{
75 b->nvars = nvars;
76 b->nslots = nvars;
77 b->first_exp = 0; /* will be set later */
78 b->first_slot = 0; /* will be set later */
79 b->nweights = nvars;
80 b->weights = nullptr; /* will be set later */
81}
82
83static void mo_block_grevlex2_wts(struct mo_block *b, int nvars)
84{
86 b->nvars = nvars;
87 b->nslots = (nvars + 1) / 2; /* 2 per word */
88 b->first_exp = 0; /* will be set later */
89 b->first_slot = 0; /* will be set later */
90 b->nweights = nvars;
91 b->weights = nullptr; /* will be set later */
92}
93
94static void mo_block_grevlex4_wts(struct mo_block *b, int nvars)
95{
97 b->nvars = nvars;
98 b->nslots = (nvars + 3) / 4; /* 4 per word */
99 b->first_exp = 0; /* will be set later */
100 b->first_slot = 0; /* will be set later */
101 b->nweights = nvars;
102 b->weights = nullptr; /* will be set later */
103}
104
105static void mo_block_lex(struct mo_block *b, int nvars)
106{
107 b->typ = MO_LEX;
108 b->nvars = nvars;
109 b->nslots = nvars;
110 b->first_exp = 0; /* will be set later */
111 b->first_slot = 0; /* will be set later */
112 b->nweights = 0;
113 b->weights = nullptr;
114}
115
116static void mo_block_lex2(struct mo_block *b, int nvars)
117{
118 b->typ = MO_LEX2;
119 b->nvars = nvars;
120 b->nslots = (nvars + 1) / 2; /* 2 per word */
121 b->first_exp = 0; /* will be set later */
122 b->first_slot = 0; /* will be set later */
123 b->nweights = 0;
124 b->weights = nullptr;
125}
126
127static void mo_block_lex4(struct mo_block *b, int nvars)
128{
129 b->typ = MO_LEX4;
130 b->nvars = nvars;
131 b->nslots = (nvars + 3) / 4; /* 4 per word */
132 b->first_exp = 0; /* will be set later */
133 b->first_slot = 0; /* will be set later */
134 b->nweights = 0;
135 b->weights = nullptr;
136}
137
138static void mo_block_group_lex(struct mo_block *b, int nvars)
139{
140 b->typ = MO_LAURENT;
141 b->nvars = nvars;
142 b->nslots = nvars;
143 b->first_exp = 0; /* will be set later */
144 b->first_slot = 0; /* will be set later */
145 b->nweights = 0;
146 b->weights = nullptr;
147}
148
149static void mo_block_group_revlex(struct mo_block *b, int nvars)
150{
152 b->nvars = nvars;
153 b->nslots = nvars;
154 b->first_exp = 0; /* will be set later */
155 b->first_slot = 0; /* will be set later */
156 b->nweights = 0;
157 b->weights = nullptr;
158}
159
160static void mo_block_wt_function(struct mo_block *b, int nvars, deg_t *wts)
161{
162 b->typ = MO_WEIGHTS;
163 b->nvars = 0;
164 b->nslots = 1;
165 b->first_exp = 0;
166 b->first_slot = 0; /* will be set later */
167 b->nweights = nvars;
168 b->weights = wts;
169}
170
171MonomialOrder *monomialOrderMake(const MonomialOrdering *mo)
172{
173 MonomialOrder *result;
174 int i, j, nv, this_block;
175 deg_t *wts = nullptr;
176 /* Determine the number of variables, the number of blocks, and the location
177 of the component */
178 int nblocks = 0;
179 int nvars = 0;
180 int hascomponent = 0;
181 for (i = 0; i < mo->len; i++)
182 {
183 struct mon_part_rec_ *t = mo->array[i];
184 nblocks++;
185 if (t->type == MO_POSITION_DOWN || t->type == MO_POSITION_UP)
186 hascomponent++;
187 else if (t->type == MO_NC_LEX)
188 {
189 // Currently, do nothing.
190 }
191 if (t->type != MO_WEIGHTS) nvars += t->nvars;
192 }
193 nblocks -= hascomponent;
194
195 /* Now create the blocks, and fill them in. Also fill in the deg vector */
196 result = getmemstructtype(MonomialOrder *);
197 result->nvars = nvars;
198 result->nslots = 0;
199 result->nblocks = nblocks;
200 result->blocks =
201 (struct mo_block *)getmem(nblocks * sizeof(result->blocks[0]));
202 result->degs = (deg_t *)getmem_atomic(nvars * sizeof(result->degs[0]));
203 if (hascomponent == 0) result->nblocks_before_component = nblocks;
204
205 this_block = 0;
206 nvars = 0;
207 for (i = 0; i < mo->len; i++)
208 {
209 struct mon_part_rec_ *t = mo->array[i];
210 if (t->type != MO_WEIGHTS)
211 {
212 if (t->wts == nullptr)
213 for (j = 0; j < t->nvars; j++) result->degs[nvars++] = 1;
214 else
215 for (j = 0; j < t->nvars; j++) result->degs[nvars++] = t->wts[j];
216 }
217 else
218 {
219 wts = (deg_t *)getmem_atomic(t->nvars * sizeof(wts[0]));
220 for (j = 0; j < t->nvars; j++) wts[j] = t->wts[j];
221 }
222 switch (t->type)
223 {
224 case MO_REVLEX:
225 mo_block_revlex(result->blocks + this_block++, t->nvars);
226 break;
227 case MO_GREVLEX:
228 mo_block_grevlex(result->blocks + this_block++, t->nvars);
229 break;
230 case MO_GREVLEX2:
231 mo_block_grevlex2(result->blocks + this_block++, t->nvars);
232 break;
233 case MO_GREVLEX4:
234 mo_block_grevlex4(result->blocks + this_block++, t->nvars);
235 break;
236 case MO_GREVLEX_WTS:
237 mo_block_grevlex_wts(result->blocks + this_block++, t->nvars);
238 break;
239 case MO_GREVLEX2_WTS:
240 mo_block_grevlex2_wts(result->blocks + this_block++, t->nvars);
241 break;
242 case MO_GREVLEX4_WTS:
243 mo_block_grevlex4_wts(result->blocks + this_block++, t->nvars);
244 break;
245 case MO_LEX:
246 mo_block_lex(result->blocks + this_block++, t->nvars);
247 break;
248 case MO_LEX2:
249 mo_block_lex2(result->blocks + this_block++, t->nvars);
250 break;
251 case MO_LEX4:
252 mo_block_lex4(result->blocks + this_block++, t->nvars);
253 break;
254 case MO_WEIGHTS:
255 // if extra weight values are given (more than "nvars", ignore the
256 // rest.
258 result->blocks + this_block++,
259 (t->nvars <= result->nvars ? t->nvars : result->nvars),
260 wts);
261 break;
262 case MO_LAURENT:
263 mo_block_group_lex(result->blocks + this_block++, t->nvars);
264 break;
266 mo_block_group_revlex(result->blocks + this_block++, t->nvars);
267 break;
268 case MO_NC_LEX:
269 /* MES */
270 break;
271 case MO_POSITION_UP:
272 if (--hascomponent == 0)
273 {
274 // Set the information about the component
275 result->component_up = 1;
276 result->nblocks_before_component = this_block;
277 }
278 // mo_block_position_up(result->blocks + this_block);
279 break;
280 case MO_POSITION_DOWN:
281 if (--hascomponent == 0)
282 {
283 // Set the information about the component
284 result->component_up = 0;
285 result->nblocks_before_component = this_block;
286 }
287 // mo_block_position_down(result->blocks + this_block);
288 break;
289 }
290 }
291
292 /* Go back and fill in the 'slots' information */
293 /* Now fix the first_exp, first_slot values, and also result->{nslots,nvars};
294 */
295 nv = 0;
296 result->nslots = 0;
297 result->nslots_before_component = 0;
298 for (i = 0; i < nblocks; i++)
299 {
300 enum MonomialOrdering_type typ = result->blocks[i].typ;
301
302 result->blocks[i].first_exp = nv;
303 result->blocks[i].first_slot = result->nslots;
304 nv += result->blocks[i].nvars;
305 result->nslots += result->blocks[i].nslots;
306
307 if (typ == MO_WEIGHTS)
308 {
309 result->blocks[i].first_exp = 0;
310
311 /* divide the wt vector by the degree vector */
312 for (j = 0; j < result->blocks[i].nvars; j++)
313 safe::div_by(result->blocks[i].weights[j], result->degs[j]);
314 ;
315 }
316 else if (typ == MO_GREVLEX_WTS || typ == MO_GREVLEX2_WTS ||
317 typ == MO_GREVLEX4_WTS)
318 {
319 result->blocks[i].weights =
320 result->degs + result->blocks[i].first_exp;
321 }
322
323 if (i == result->nblocks_before_component - 1)
324 {
325 result->nslots_before_component = result->nslots;
326 }
327 }
328
329 /* Set is_laurent */
330 result->is_laurent = (int *)getmem_atomic(result->nvars * sizeof(int));
331 for (i = 0; i < result->nvars; i++) result->is_laurent[i] = 0;
332
333 for (i = 0; i < result->nblocks; i++)
334 if (result->blocks[i].typ == MO_LAURENT ||
335 result->blocks[i].typ == MO_LAURENT_REVLEX)
336 {
337 for (j = 0; j < result->blocks[i].nvars; j++)
338 result->is_laurent[result->blocks[i].first_exp + j] = 1;
339 }
340
341 return result;
342}
343
344extern void monomialOrderFree(MonomialOrder *mo) { (void) mo; }
345static void MO_pack4(int nvars, const int *expon, int *slots)
346{
347 int32_t i;
348 if (nvars == 0) return;
349 while (1)
350 {
351 i = safe::fits_7(*expon++) << 24;
352 if (--nvars == 0) break;
353 i |= safe::fits_7(*expon++) << 16;
354 if (--nvars == 0) break;
355 i |= safe::fits_7(*expon++) << 8;
356 if (--nvars == 0) break;
357 i |= safe::fits_7(*expon++);
358 if (--nvars == 0) break;
359 *slots++ = i;
360 }
361 *slots++ = i;
362}
363
364static void MO_pack2(int nvars, const int *expon, int *slots)
365{
366 int32_t i;
367 if (nvars == 0) return;
368 while (1)
369 {
370 i = safe::fits_15(*expon++) << 16;
371 if (--nvars == 0) break;
372 i |= safe::fits_15(*expon++);
373 if (--nvars == 0) break;
374 *slots++ = i;
375 }
376 *slots++ = i;
377}
378
379static void MO_unpack4(int nvars, const int *slots, int *expon)
380{
381 int32_t i;
382 if (nvars == 0) return;
383 while (1)
384 {
385 i = *slots++;
386 *expon++ = (i >> 24);
387 if (--nvars == 0) break;
388 *expon++ = (i >> 16) & 0x7f;
389 if (--nvars == 0) break;
390 *expon++ = (i >> 8) & 0x7f;
391 if (--nvars == 0) break;
392 *expon++ = i & 0x7f;
393 if (--nvars == 0) break;
394 }
395}
396
397static void MO_unpack2(int nvars, const int *slots, int *expon)
398{
399 int32_t i;
400 if (nvars == 0) return;
401 while (1)
402 {
403 i = *slots++;
404 *expon++ = i >> 16;
405 if (--nvars == 0) break;
406 *expon++ = i & 0x7fff;
407 if (--nvars == 0) break;
408 }
409}
410
411void monomialOrderEncodeFromActualExponents(const MonomialOrder *mo,
412 const_exponents expon,
413 monomial result_psums)
414/* Given 'expon', compute the encoded partial sums value */
415{
416 if (mo == nullptr) return;
417 int *tmpexp = static_cast<int *>(alloca((mo->nvars + 1) * sizeof(int)));
418 int i, j, nvars, s;
419 int *p1;
420 deg_t *degs;
421 struct mo_block *b = mo->blocks;
422 int nblocks = mo->nblocks;
423 const int *e = expon;
424 int *p = result_psums;
425 for (i = nblocks; i > 0; --i, b++) switch (b->typ)
426 {
427 case MO_LEX:
428 case MO_LAURENT:
429 nvars = b->nvars;
430 for (j = 0; j < nvars; j++) *p++ = *e++;
431 break;
432 case MO_REVLEX:
434 nvars = b->nvars;
435 for (j = 0; j < nvars; j++) *p++ = safe::minus(*e++);
436 break;
437 case MO_GREVLEX:
438 nvars = b->nvars;
439 p += b->nslots;
440 p1 = p;
441 *--p1 = *e++;
442 for (j = 1; j < nvars; j++)
443 {
444 --p1;
445 *p1 = safe::add(*e++, p1[1]);
446 }
447 break;
448 case MO_GREVLEX_WTS:
449 nvars = b->nvars;
450 degs = mo->degs + b->first_exp;
451 p += b->nslots;
452 p1 = p;
453 *--p1 = safe::mult(*e++, *degs++);
454 for (j = 1; j < nvars; j++)
455 {
456 --p1;
457 int tmp = safe::mult(*e++, *degs++);
458 *p1 = safe::add(tmp, p1[1]);
459 }
460 break;
461 case MO_GREVLEX4:
462 nvars = b->nvars;
463 p1 = tmpexp + b->nvars;
464 *--p1 = *e++;
465 for (j = 1; j < nvars; j++)
466 {
467 --p1;
468 *p1 = safe::add(*e++, p1[1]);
469 }
470 MO_pack4(nvars, p1, p);
471 p += b->nslots;
472 break;
473 case MO_GREVLEX4_WTS:
474 nvars = b->nvars;
475 degs = mo->degs + b->first_exp;
476 p1 = tmpexp + b->nvars;
477 *--p1 = safe::mult(*e++, *degs++);
478 for (j = 1; j < nvars; j++)
479 {
480 --p1;
481 int tmp = safe::mult(*e++, *degs++);
482 *p1 = safe::add(tmp, p1[1]);
483 }
484 MO_pack4(nvars, p1, p);
485 p += b->nslots;
486 break;
487 case MO_GREVLEX2:
488 nvars = b->nvars;
489 p1 = tmpexp + b->nvars;
490 *--p1 = *e++;
491 for (j = 1; j < nvars; j++)
492 {
493 --p1;
494 *p1 = safe::add(*e++, p1[1]);
495 }
496 MO_pack2(nvars, p1, p);
497 p += b->nslots;
498 break;
499 case MO_GREVLEX2_WTS:
500 nvars = b->nvars;
501 degs = mo->degs + b->first_exp;
502 p1 = tmpexp + b->nvars;
503 *--p1 = safe::mult(*e++, *degs++);
504 for (j = 1; j < nvars; j++)
505 {
506 --p1;
507 int tmp = safe::mult(*e++, *degs++);
508 *p1 = safe::add(tmp, p1[1]);
509 }
510 MO_pack2(nvars, p1, p);
511 p += b->nslots;
512 break;
513 case MO_LEX4:
514 nvars = b->nvars;
515 MO_pack4(nvars, e, p);
516 p += b->nslots;
517 e += nvars;
518 break;
519 case MO_LEX2:
520 nvars = b->nvars;
521 MO_pack2(nvars, e, p);
522 p += b->nslots;
523 e += nvars;
524 break;
525 case MO_WEIGHTS:
526 if (b->nweights == 0)
527 {
528 s = 0;
529 }
530 else
531 {
532 s = safe::mult(b->weights[0], expon[0]);
533 for (j = 1; j < b->nweights; j++)
534 s = safe::add(s, safe::mult(b->weights[j], expon[j]));
535 }
536 *p++ = s;
537 break;
538 case MO_POSITION_UP:
539 case MO_POSITION_DOWN:
540 /* nothing to do here */
541 break;
542 case MO_NC_LEX:
543 /* nothing to do here */
544 break;
545 }
546}
547
548void monomialOrderDecodeToActualExponents(const MonomialOrder *mo,
549 const_monomial psums,
550 exponents_t expon)
551{
552 if (mo == nullptr) return;
553 int *tmpexp = static_cast<int *>(alloca((mo->nvars + 1) * sizeof(int)));
554 int i, j, nvars;
555 deg_t *degs = mo->degs;
556 deg_t *d;
557 struct mo_block *b = mo->blocks;
558 int nblocks = mo->nblocks;
559 int *e = expon;
560 const int *p = psums;
561 for (i = nblocks; i > 0; --i, b++) switch (b->typ)
562 {
563 case MO_LEX:
564 case MO_LAURENT:
565 nvars = b->nvars;
566 p = psums + b->first_slot;
567 e = expon + b->first_exp;
568 for (j = 0; j < nvars; j++) *e++ = *p++;
569 break;
570 case MO_REVLEX:
572 nvars = b->nvars;
573 p = psums + b->first_slot;
574 e = expon + b->first_exp;
575 for (j = 0; j < nvars; j++) *e++ = safe::minus(*p++);
576 break;
577 case MO_GREVLEX:
578 nvars = b->nvars;
579 p = psums + b->first_slot + nvars - 1;
580 e = expon + b->first_exp;
581 *e++ = *p--;
582 for (j = nvars - 1; j >= 1; --j, --p) *e++ = safe::sub(*p, p[1]);
583 break;
584 case MO_GREVLEX_WTS:
585 nvars = b->nvars;
586 d = degs + b->first_exp;
587 p = psums + b->first_slot + nvars - 1;
588 e = expon + b->first_exp;
589 *e++ = *p-- / *d++;
590 for (j = nvars - 1; j >= 1; --j, --p)
591 *e++ = safe::sub(*p, p[1]) / *d++;
592 break;
593 case MO_GREVLEX4:
594 nvars = b->nvars;
595 MO_unpack4(nvars, psums + b->first_slot, tmpexp);
596 p = tmpexp + nvars - 1;
597 e = expon + b->first_exp;
598 *e++ = *p--;
599 for (j = nvars - 1; j >= 1; --j, --p) *e++ = safe::sub(*p, p[1]);
600 break;
601 case MO_GREVLEX4_WTS:
602 nvars = b->nvars;
603 d = degs + b->first_exp;
604 MO_unpack4(nvars, psums + b->first_slot, tmpexp);
605 p = tmpexp + nvars - 1;
606 e = expon + b->first_exp;
607 *e++ = *p-- / *d++;
608 for (j = nvars - 1; j >= 1; --j, --p)
609 *e++ = safe::sub(*p, p[1]) / *d++;
610 break;
611 case MO_GREVLEX2:
612 nvars = b->nvars;
613 MO_unpack2(nvars, psums + b->first_slot, tmpexp);
614 p = tmpexp + nvars - 1;
615 e = expon + b->first_exp;
616 *e++ = *p--;
617 for (j = nvars - 1; j >= 1; --j, --p) *e++ = safe::sub(*p, p[1]);
618 break;
619 case MO_GREVLEX2_WTS:
620 nvars = b->nvars;
621 d = degs + b->first_exp;
622 MO_unpack2(nvars, psums + b->first_slot, tmpexp);
623 p = tmpexp + nvars - 1;
624 e = expon + b->first_exp;
625 *e++ = *p-- / *d++;
626 for (j = nvars - 1; j >= 1; --j, --p)
627 *e++ = safe::sub(*p, p[1]) / *d++;
628 break;
629 case MO_LEX4:
630 nvars = b->nvars;
631 e = expon + b->first_exp;
632 MO_unpack4(nvars, psums + b->first_slot, e);
633 break;
634 case MO_LEX2:
635 nvars = b->nvars;
636 e = expon + b->first_exp;
637 MO_unpack2(nvars, psums + b->first_slot, e);
638 break;
639 case MO_WEIGHTS:
640 break;
641 case MO_POSITION_UP:
642 case MO_POSITION_DOWN:
643 /* should not occur, but do nothing in any case */
644 break;
645 case MO_NC_LEX:
646 /* nothing to do here */
647 break;
648 }
649}
650
651/*
652// Local Variables:
653// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
654// indent-tabs-mode: nil
655// End:
656*/
exponents::ConstExponents const_exponents
exponents::Exponents exponents_t
Dense exponent-vector template [e_0, ..., e_{nvars-1}] for monomial operations.
Engine-wide include prelude — a single point of truth for portability shims.
#define monomial
Definition gb-toric.cpp:11
int p
int p1
static void MO_pack4(int nvars, const int *expon, int *slots)
std::vector< bool > laurentVariables(const MonomialOrder *mo)
Definition imonorder.cpp:16
static void mo_block_grevlex4(struct mo_block *b, int nvars)
Definition imonorder.cpp:61
static void mo_block_grevlex2_wts(struct mo_block *b, int nvars)
Definition imonorder.cpp:83
static void mo_block_group_lex(struct mo_block *b, int nvars)
void monomialOrderEncodeFromActualExponents(const MonomialOrder *mo, const_exponents expon, monomial result_psums)
MonomialOrder * monomialOrderMake(const MonomialOrdering *mo)
static void mo_block_group_revlex(struct mo_block *b, int nvars)
void monomialOrderFree(MonomialOrder *mo)
void monomialOrderDecodeToActualExponents(const MonomialOrder *mo, const_monomial psums, exponents_t expon)
static void MO_pack2(int nvars, const int *expon, int *slots)
static void mo_block_grevlex4_wts(struct mo_block *b, int nvars)
Definition imonorder.cpp:94
static void MO_unpack4(int nvars, const int *slots, int *expon)
static void mo_block_grevlex2(struct mo_block *b, int nvars)
Definition imonorder.cpp:50
static void mo_block_grevlex_wts(struct mo_block *b, int nvars)
Definition imonorder.cpp:72
static void mo_block_grevlex(struct mo_block *b, int nvars)
Definition imonorder.cpp:39
static void mo_block_revlex(struct mo_block *b, int nvars)
Definition imonorder.cpp:28
static void mo_block_lex4(struct mo_block *b, int nvars)
static void mo_block_wt_function(struct mo_block *b, int nvars, deg_t *wts)
static void mo_block_lex2(struct mo_block *b, int nvars)
static void MO_unpack2(int nvars, const int *slots, int *expon)
static void mo_block_lex(struct mo_block *b, int nvars)
int32_t deg_t
Definition imonorder.hpp:43
const int * const_monomial
Definition imonorder.hpp:45
Internal (runtime) form of a monomial ordering.
void size_t s
Definition m2-mem.cpp:271
char * getmem(size_t n)
Definition m2-mem.cpp:74
char * getmem_atomic(size_t n)
Definition m2-mem.cpp:135
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define getmemstructtype(S)
Definition m2-mem.h:143
MonomialOrdering_type
@ MO_GREVLEX4_WTS
@ MO_LAURENT_REVLEX
@ MO_NC_LEX
@ MO_LEX4
@ MO_REVLEX
@ MO_POSITION_UP
@ MO_LEX
@ MO_GREVLEX
@ MO_LEX2
@ MO_GREVLEX4
@ MO_LAURENT
@ MO_GREVLEX2_WTS
@ MO_WEIGHTS
@ MO_POSITION_DOWN
@ MO_GREVLEX2
@ MO_GREVLEX_WTS
static int32_t mult(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:236
static int32_t div_by(int32_t &x, int32_t y, const char *msg)
Definition overflow.hpp:274
static int32_t add(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:116
static int32_t fits_7(int32_t x, const char *msg)
Definition overflow.hpp:74
static int32_t sub(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:144
static int32_t fits_15(int32_t x, const char *msg)
Definition overflow.hpp:80
static int32_t minus(int32_t x, const char *msg)
Definition overflow.hpp:185
Overflow-checked integer arithmetic for monomial exponents and degree sums.
Front-end-side description of a monomial ordering as a list of mon_part blocks.
enum MonomialOrdering_type typ
Definition imonorder.hpp:49
int first_exp
Definition imonorder.hpp:52
int first_slot
Definition imonorder.hpp:53
deg_t * weights
Definition imonorder.hpp:55
int nweights
Definition imonorder.hpp:54
enum MonomialOrdering_type type