|
Macaulay2 Engine
|
GBWeight — packed-weight evaluator that drives S-pair selection. More...
#include "engine-includes.hpp"#include "ExponentVector.hpp"#include "monoid.hpp"#include "newdelete.hpp"Go to the source code of this file.
Classes | |
| class | GBWeight |
| Heuristic-weight evaluator for gbvectors, used during Groebner basis computation to drive the S-pair sugar strategy. More... | |
GBWeight — packed-weight evaluator that drives S-pair selection.
Declares GBWeight, the helper that GB code consults to assign a heuristic weight to a gbvector or to a single (monomial, component) pair. The single constructor takes a FreeModule and an M2_arrayint weight vector; the GBRing pointer is derived from F->get_ring()->cast_to_PolynomialRing(). If the weight argument is nullptr or has the wrong length, GBWeight falls back to the variables' primary degrees (subbed with 1 where the primary degree is non-positive) and turns on use_component_degrees_ only when every primary degree is positive — a single non-positive primary degree turns it back off mid-loop. An explicit weight vector always disables that flag. GBWeight itself does not choose an S-pair selection policy — callers use the returned weight as the sort key.
The implementation is a packed dot product of the exponent vector with wts_ (via exponents::weight), plus a constant-time Fdegs_[Computations] lookup when component degrees are enabled and Computations > 0. The two-argument gbvector_weight(f, lead_term_weight) returns the maximum weight over all terms of f and writes the lead-term weight to its out-parameter, letting an S-pair queue snapshot both numbers in one walk.
Definition in file gbweight.hpp.