68#include <unordered_map>
290 void compute(
int softDegreeLimit);
299 void process(
const std::deque<Overlap>& overlapsToProcess);
301 void buildF4Matrix(
const std::deque<Overlap>& overlapsToProcess);
348 template<
typename LockType>
352 NCF4Stats &ncF4Stats,
354 bool updateColumnIndex,
363 mtbb::null_mutex noLock;
378 mtbb::queuing_mutex& lock)
Free associative algebra k<x_1,...,x_n> over an arbitrary coefficient ring.
FreeMonoid — monoid of length-prefixed non-commutative words with weight-vector prefix.
Bump-pointer arena allocator for transient inner-loop allocations.
std::tuple< int, int, int, bool > Overlap
OverlapTable — degree-sorted queue of pending word overlaps for non-commutative GB drivers.
gc_vector< const Poly * > ConstPolyList
Polynomial< CoefficientRingType > Poly
gc_vector< Poly * > PolyList
Modern Monom / Polynomial value types shared by NC algebras and the refactored F4.
Home-rolled std::span substitute and zipped-range view for the NC engines.
SuffixTree / SuffixTreeNode — experimental generalised suffix tree for non-commutative leading-word l...
Coefficient-ring-erased arithmetic dispatcher used by F4, GB, and resolution code.
Word and WordWithData — non-owning views over the flat-int encoding of a non-commutative word.
WordTable / WordWithDataTable — leading-word indices for non-commutative Gröbner basis lookup.
Type-erased owning handle to a dense coefficient vector held by a ConcreteVectorArithmetic<Ring>.
Free associative algebra over a coefficient ring: the non-commutative analogue of PolynomialRing.
Thin RAII wrapper around memtailor::Arena providing bump-pointer array allocation with optional mutex...
Strict comparator on Monoms under a FreeMonoid order: returns true exactly when the first monomial is...
Equality functor on Monom (or Word), the KeyEqual companion of MonomHash for std::unordered_map<Monom...
Hash functor on Monom (or Word) suitable for std::unordered_map / std::unordered_set.
void process(const std::deque< Overlap > &overlapsToProcess)
NCF4(const FreeAlgebra &A, const ConstPolyList &input, int hardDegreeLimit, int strategy, int numThreads)
auto overlapHeft(Overlap o) const -> int
void reduceF4Row(int index, int first, int firstcol, NCF4Stats &ncF4Stats, ElementArray &dense)
void displayF4Matrix(std::ostream &o) const
MemoryBlock mPreviousMonomialSpace
auto isOverlapNecessary(const Overlap &o) -> bool
ColumnsVector mPreviousColumns
void parallelReduceF4Matrix()
void parallelReduceF4Row(int index, int first, int firstcol, NCF4Stats &ncF4Stats, ElementArray &dense, mtbb::queuing_mutex &lock)
const ConstPolyList mInput
mtbb::feeder< PreRow > PreRowFeeder
void parallelBuildF4Matrix(const std::deque< Overlap > &overlapsToProcess)
void generalReduceF4Row(int index, int first, int firstcol, NCF4Stats &ncF4Stats, ElementArray &dense, bool updateColumnIndex, LockType &lock)
void addToGroebnerBasis(Poly *toAdd)
ring_elem getCoeffOfMonom(const Poly &f, const Monom &m) const
void clearRows(RowsVector &rowsVector)
mtbb::queuing_mutex mColumnMutex
std::vector< MemoryBlock * > mMemoryBlocks
void updateOverlaps(const Poly *toAdd)
void processPreviousF4Matrix()
std::vector< PreRow > mOverlapsTodo
MonomHashEqual mMonomHashEqual
PolyList newGBelements() const
void reducedRowToPoly(Poly *result, const RowsVector &rows, const ColumnsVector &cols, int i) const
mtbb::unordered_map< Word, std::pair< int, int >, MonomHash, MonomHashEqual > MonomialHash
void processPreRow(PreRow r, RowsVector &rowsVector, MemoryBlock &memoryBlock, PreRowFeeder *feeder)
std::vector< Row, gc_allocator< Row > > RowsVector
MonomialHash mColumnMonomials
void preRowsFromOverlap(const Overlap &o)
const FreeAlgebra & mFreeAlgebra
std::pair< bool, int > findPreviousReducerSuffix(const Word &w)
std::vector< MemoryBlock * > mPreviousMemoryBlocks
void processWordInPreRow(Word &w, PreRowFeeder *feeder)
void displayFullF4Matrix(std::ostream &o) const
std::pair< bool, PreRow > findDivisor(Word w)
Word createOverlapLeadWord(const Overlap &o)
void displayF4MatrixSize(std::ostream &o) const
auto checkOldOverlaps(Word &newLeadWord) -> void
MemoryBlock mMonomialSpace
std::vector< PreRow > mReducersTodo
void labelAndSortF4Matrix()
const VectorArithmetic * mVectorArithmetic
std::vector< Column > ColumnsVector
void compute(int softDegreeLimit)
const PolyList & currentValue() const
std::pair< bool, int > findPreviousReducerPrefix(const Word &w)
auto insertNewOverlaps(std::vector< Overlap > &newOverlaps) -> void
mtbb::task_arena mScheduler
void buildF4Matrix(const std::deque< Overlap > &overlapsToProcess)
OverlapTable mOverlapTable
const FreeAlgebra & freeAlgebra() const
void autoreduceByLastElement()
MonomialHash mPreviousColumnMonomials
Per-degree FIFO queue of pending overlaps for the NC Groebner basis driver to process.
Runtime dispatcher that hides the concrete coefficient ring behind a std::variant of ConcreteVectorAr...
Non-owning view of a non-commutative word: [begin, end) of int variable indices.
Index of Words (non-commutative monomials) with subword, prefix/suffix, and overlap lookup used by th...
VALGRIND_MAKE_MEM_DEFINED & result(result)
Engine TBB shim — single point of inclusion for every parallel primitive.
our_new_delete — per-class opt-in routing of new / delete through bdwgc.
Non-owning view onto a [length, degree, v1, v2, ..., vn] packed monomial in some externally managed b...
A column of the Macaulay matrix: the monomial that names it plus the row currently acting as its pivo...
Per-thread counters tracking how much work the F4 reduction did.
Symbolic description of one row before it is materialised in the matrix: a left * (something) * right...
Range< Word > columnWords
Range< int > columnIndices
A materialised row of the Macaulay matrix: parallel coefficient and monomial arrays.