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

FreeMonoid — monoid of length-prefixed non-commutative words with weight-vector prefix. More...

#include "Polynomial.hpp"
#include "newdelete.hpp"
#include "polyring.hpp"
#include "style.hpp"
#include "NCAlgebras/Word.hpp"
#include "MemoryBlock.hpp"
#include <iosfwd>
#include <vector>

Go to the source code of this file.

Classes

class  FreeMonoidLogger
 Static counter for non-commutative monomial comparisons. More...
class  FreeMonoid
 The free non-commutative monoid on a set of named variables, with monomial ordering and degree / weight machinery. More...
class  MonomEq
 Strict comparator on Monoms under a FreeMonoid order: returns true exactly when the first monomial is greater than the second. More...
class  MonomHash
 Hash functor on Monom (or Word) suitable for std::unordered_map / std::unordered_set. More...
class  MonomHashEqual
 Equality functor on Monom (or Word), the KeyEqual companion of MonomHash for std::unordered_map<Monom, ...>. More...
struct  MonomSort< T >

Functions

std::ostream & operator<< (std::ostream &o, FreeMonoidLogger a)

Detailed Description

FreeMonoid — monoid of length-prefixed non-commutative words with weight-vector prefix.

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

Declares the word-side counterpart of the commutative Monoid: a non-commutative monomial is a sequence of variable indices [v_1, v_2, ..., v_s], and FreeMonoid stores it in the packed form [total length] wt_0 ... wt_{r-1} w_0 ... w_s — a leading length so the word can be memcpyed, r weight values used to short-circuit comparison, and the indices themselves. Multiplication is plain concatenation: no reordering, no normalisation, since the algebra is free. The intended comparison is weight-first then lexicographic, matching the "leading word" convention of the non-commutative Gröbner literature; the in-file TODOs track wiring the weight values through the front end so compare can use them consistently.

The companion FreeMonoidLogger at the top of the header is a debug helper that counts monomial compares for profiling. NCGroebner.cpp resets the counter and prints it after each reduction, but the logCompare() call inside FreeMonoid.cpp is currently commented out, so the counter only ticks if a developer re-enables it.

See also
Word.hpp
FreeAlgebra.hpp
NCGroebner.hpp
Polynomial.hpp

Definition in file FreeMonoid.hpp.