|
Macaulay2 Engine
|
Monoid — variable count, naming, grading, and monomial order of a polynomial ring. More...
#include <stddef.h>#include <string>#include <vector>#include "ExponentList.hpp"#include "ExponentVector.hpp"#include "hash.hpp"#include "imonorder.hpp"#include "newdelete.hpp"#include "style.hpp"Go to the source code of this file.
Classes | |
| class | Monoid |
| Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery, and monomial encoding/decoding. More... | |
Macros | |
| #define | ALLOCATE_EXPONENTS(byte_len) |
| #define | EXPONENT_BYTE_SIZE(nvars) |
| #define | ALLOCATE_MONOMIAL(byte_len) |
| #define | MONOMIAL_BYTE_SIZE(mon_size) |
Typedefs | |
| typedef int * | monomial |
| typedef const int * | const_monomial |
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
Declares Monoid, the multiplicative-side representation of an M2 polynomial ring. It carries the variable count (mVariableCount) and names (mVariableNames), the per-variable (multi-)degree vectors flattened into mDegrees, a heft vector used to detect bounded-degree subsets, and the recursive mDegreeMonoid / mDegreeRing in which degrees themselves live (base case is the trivial monoid). Two parallel ordering representations sit alongside each other: the declarative MonomialOrdering the user wrote (Lex, GRevLex, weight blocks, ...) in mo_ and the encoded MonomialOrder walked by the inner loop in monorder_ — the translator lives in imonorder.hpp. monomial_size() reports the number of ints in an encoded monomial for this monoid; the MONOMIAL_BYTE_SIZE macro scales that to bytes.
Hot-path code allocates monomials on the stack via the ALLOCATE_MONOMIAL / ALLOCATE_EXPONENTS alloca-backed macros declared in this header; a typical GB step builds thousands of transient monomials per pair and cannot afford heap allocation. Monoid inherits from MutableEngineObject so the engine can attach derived data with stable identity.
Definition in file monoid.hpp.