Macaulay2 Engine
Loading...
Searching...
No Matches
imonorder.hpp File Reference

Internal (runtime) form of a monomial ordering. More...

#include <vector>
#include "interface/monomial-ordering.h"
#include "ExponentVector.hpp"

Go to the source code of this file.

Classes

struct  mo_block
struct  MonomialOrder
 Internal compiled form of a monomial ordering, derived from a front-end MonomialOrdering by monomialOrderMake. More...

Typedefs

typedef intmonomial
typedef int32_t deg_t
typedef const intconst_monomial

Functions

MonomialOrder * monomialOrderMake (const MonomialOrdering *mo)
void monomialOrderFree (MonomialOrder *mo)
void monomialOrderEncodeFromActualExponents (const MonomialOrder *mo, const_exponents a, monomial b)
void monomialOrderDecodeToActualExponents (const MonomialOrder *mo, const_monomial a, exponents_t b)
std::vector< boollaurentVariables (const MonomialOrder *mo)

Detailed Description

Internal (runtime) form of a monomial ordering.

Note
AI-generated documentation. Verify against the source before relying on it.

Defines the encoded representation walked by the inner loop when two monomials are compared — the operational counterpart to the declarative MonomialOrdering the user writes. The internal form is a list of mo_blocks; each block has a type (MO_LEX, MO_GREVLEX, MO_WEIGHTS, MO_REVLEX, MO_POSITION_UP/DOWN, ...), a variable count, and block-specific data. A comparison walks the block list and returns at the first block that breaks the tie. Encoded monomials are laid out so that the common case — a leading degree or weight sum — resolves after reading a single slot, and many orderings reduce to a memcmp on the packed bytes.

Translation from the declarative MonomialOrdering to this internal form happens once, at Monoid construction; the resulting MonomialOrder* is then frozen and reused on every inner-loop compare. Degrees and weights are 32-bit signed (deg_t); intermediate-degree overflows are caught by overflow.hpp.

See also
interface/monomial-ordering.h
monordering.hpp
overflow.hpp

Definition in file imonorder.hpp.