Macaulay2 Engine
Loading...
Searching...
No Matches
WordTable Class Reference

Index of Words (non-commutative monomials) with subword, prefix/suffix, and overlap lookup used by the NC Groebner code. More...

#include <WordTable.hpp>

Public Member Functions

 WordTable ()
 ~WordTable ()
void clear ()
size_t monomialCount () const
size_t insert (Word w)
size_t insert (Word w, std::vector< Overlap > &newRightOverlaps)
const Wordoperator[] (int index) const
void subwords (Word word, std::vector< std::pair< int, int > > &output) const
bool subword (Word word, std::pair< int, int > &output) const
bool isPrefix (Word word, int &output) const
bool isSuffix (Word word, int &output) const
auto isNontrivialSuperword (Word word, int index1, int index2) const -> bool
void superwords (Word word, std::vector< std::pair< int, int > > &output) const
void leftOverlaps (std::vector< Overlap > &newLeftOverlaps) const
void rightOverlaps (std::vector< Overlap > &newRightOverlaps) const

Static Public Member Functions

static void subwordPositions (Word word1, Word word2, std::vector< int > &result_start_indices)

Static Private Member Functions

static bool isPrefixOf (Word word1, Word word2)
static bool isSuffixOf (Word word1, Word word2)
static bool subwordPosition (Word word1, Word word2, int &result_start_index)
static void overlaps (Word word1, Word word2, std::vector< int > &result_overlaps)

Private Attributes

std::vector< WordmMonomials
std::vector< intmIndices
MemoryBlock mMonomialSpace

Friends

std::ostream & operator<< (std::ostream &o, const WordTable &wordTable)

Detailed Description

Index of Words (non-commutative monomials) with subword, prefix/suffix, and overlap lookup used by the NC Groebner code.

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

Stores monomials in mMonomials and a parallel mIndices slot per entry (-1 marks a retired word the search routines should skip). The query API exposes the operations the NC GB inner loop needs — subwords / subword (where does each table entry occur inside word?), isPrefix / isSuffix (single-end containment), superwords (the reverse direction), and leftOverlaps / rightOverlaps (suffix-of-X equals prefix-of-Y pairs that generate new S-pairs). Word storage lives in a MemoryBlock arena so insertions are bump-pointer cheap.

Definition at line 88 of file WordTable.hpp.


The documentation for this class was generated from the following files: