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

Indexed table of monomials with fast "find a divisor" lookup, keyed by a free integer val per entry. More...

#include <montable.hpp>

Inheritance diagram for MonomialTable:
our_new_delete

Classes

struct  mon_term
 Doubly-linked-list node of a MonomialTable's per-component monomial list. More...

Public Member Functions

 ~MonomialTable ()
void insert (exponents_t exp, int comp, int id)
int find_divisor (exponents_t exp, int comp)
int find_divisors (int max, exponents_t exp, int comp, VECTOR(mon_term *) *result=nullptr)
mon_termfind_exact (exponents_t exp, int comp) const
void show (FILE *fil)

Static Public Member Functions

static MonomialTablemake (int nvars)
Static Public Member Functions inherited from our_new_delete
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void operator delete (void *obj)
static void operator delete[] (void *obj)
static void * operator new (size_t size, void *existing_memory)
static void * operator new[] (size_t size, void *existing_memory)
static void operator delete (void *obj, void *existing_memory)
static void operator delete[] (void *obj, void *existing_memory)

Private Member Functions

 MonomialTable ()
 VECTOR (mon_term *) _head
mon_termmake_list_head ()

Static Private Member Functions

static MonomialTablemake_minimal (int nvars, const VECTOR(exponents_t) &exps, const VECTOR(int) &comps, const VECTOR(int) &vals, VECTOR(int) &rejects)
static void minimalize (int nvars, const VECTOR(exponents_t) &exps, const VECTOR(int) &comps, bool keep_duplicates, VECTOR(int) &result_positions)
static void move_up (mon_term *const y, mon_term *const head)
static void insert_before (mon_term *const y, mon_term *const z)
static void remove (mon_term *const y)

Private Attributes

stashmon_term_stash
int _nvars
int _count
mon_term_last_match
int _last_match_comp

Detailed Description

Indexed table of monomials with fast "find a divisor" lookup, keyed by a free integer val per entry.

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

Stores entries as a per-component doubly-linked list of mon_terms sorted in increasing lex order. Each entry caches a _mask (popcount-style divisibility filter) so divisor searches can skip most monomials with a single bitwise test. Pure (exponents, component) -> val index — the exponent vectors themselves are owned by the caller (the table does not free them). MonomialTableZZ is the companion specialisation when entries also carry a ZZ coefficient and the GB needs to track leading-term divisibility modulo content.

Definition at line 80 of file montable.hpp.


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