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

MonomialInfo — F4's packed_monomial encoding plus operations. More...

#include "interface/m2-types.h"
#include "f4/ntuple-monomial.hpp"
#include "f4/varpower-monomial.hpp"
#include "interface/monomial-ordering.h"
#include "newdelete.hpp"
#include "skew.hpp"
#include <iostream>

Go to the source code of this file.

Classes

class  MonomialInfo
 Per-ring monomial layout / encoding helper used by F4GB. More...

Typedefs

typedef long monomial_word
typedef monomial_wordpacked_monomial
typedef const monomial_wordconst_packed_monomial

Detailed Description

MonomialInfo — F4's packed_monomial encoding plus operations.

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

Declares MonomialInfo, the F4-side specialised monoid descriptor. A packed_monomial is a monomial_word* (long pointer) with the layout [hashvalue, component, wt_1, ..., wt_s, e_0, ..., e_{n-1}]; the total slot count nslots is fixed per ring, so monomial_size() returns it directly (the parameter is vestigial). The hash is the additive trick (credited to A. Steel in-source): each variable gets a random hashfcn[i], and hash(m) = sum hashfcn[i] * e_i so hash(m*n) = hash(m) + hash(n) and mult updates the stored hash by a single add. MonomialInfo exposes the F4-inner-loop surface — mult / unchecked_mult, divide (returns bool, used as a divisibility test) / unchecked_divide, compare_grevlex (plus compare for the general ordering), get_component / set_component, and conversions from_expvector / to_expvector (against the dense ntuple_monomial) and from_varpower_monomial / to_varpower_monomial (against the sparse varpower_monomial). Skew-variable operations (skew_vars, skew_mult_sign) take a SkewMultiplication* by parameter — MonomialInfo does not own one. A bank of mutable unsigned long ncalls_* counters records every operation for the show() diagnostic dump.

The encoding carries multi-degree information: optional weight-vector slots (mWeightVectors, mNumWeights) are packed inline between the component and the exponents, and mHeftDegrees / mModuleHeftDegrees are kept on the side for the heft / module-heft scoring. The engine builds one MonomialInfo per PolynomialRing at F4 startup and shares it across all F4 operations on that ring; the #if 0 block at the top is stale stdint.h/config.h scaffolding kept alongside the live code.

See also
ntuple-monomial.hpp
varpower-monomial.hpp
f4.hpp

Definition in file moninfo.hpp.