|
Macaulay2 Engine
|
Word and WordWithData — non-owning views over the flat-int encoding of a non-commutative word. More...
#include <iosfwd>#include <vector>Go to the source code of this file.
Classes | |
| class | Word |
| Non-owning view of a non-commutative word: [begin, end) of int variable indices. More... | |
| class | WordWithData |
| Word plus its ecart degree and heft degree — the value type WordWithDataTable stores. More... | |
Functions | |
| std::ostream & | operator<< (std::ostream &o, const Word &w) |
| std::ostream & | operator<< (std::ostream &o, const WordWithData &w) |
Word and WordWithData — non-owning views over the flat-int encoding of a non-commutative word.
Declares the NC-side lightweight view that every word-table, suffix-tree, overlap, and reduction routine passes around. Word carries mBegin / mEnd pointers plus a cached size into a raw int[] of variable indices [v_1, ..., v_k] — with no length or weight prefix, since FreeMonoid already stores those separately. The class never allocates; the underlying buffer normally lives in a MemoryBlock or in a std::vector<int> that outlives the Word. init lets one Word instance be rebound across many buffers in a tight loop without reconstruction; the std::vector<int> constructor is explicit and exists for unit tests where the lifetime is obvious.
WordWithData decorates a Word with mEcartDegree and mHeftDegree so the word-table sort and divisibility checks over a homogenised system can compare by ecart degree before walking the variable indices. Equality on WordWithData deliberately ignores heft degree but respects ecart degree, matching the divisibility convention used by NCGroebner's reducer-selection step. Commutative counterpart is gb-f4/MonomialView.
Definition in file Word.hpp.