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

newf4::MonomialLookupTable — divisibility-aware leading-term index for the new F4. More...

#include "MonomialTypes.hpp"
#include "MonomialView.hpp"
#include <vector>
#include <iostream>

Go to the source code of this file.

Classes

struct  newf4::MonomialInfo
class  newf4::MonomialLookupTable
class  newf4::MonomialLookupTable::MonomialLookupIterator

Namespaces

namespace  newf4

Detailed Description

newf4::MonomialLookupTable — divisibility-aware leading-term index for the new F4.

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

Declares the lookup structure that lets the refactored F4 answer "does some basis leading monomial divide this target?" without scanning every basis element. Storage is split into a flat std::vector<MonomialInt> mMonomialSpace (the encoded [length, var, power, ...] byte pool) and a parallel std::vector<MonomialInfo> of summary records — each MonomialInfo caches mIsUsed, mSimpleDegree, a MonomialMask, an mOffset into the byte pool, and the mValue index of the owning polynomial. The mask is createMask(monView) = OR over present variables of (1 << (var mod B)) where B = 8 * sizeof(MonomialMask), so with more than B variables several variables collide on the same bit — it is a Bloom-style fast reject, not a perfect presence bitmap. findDivisor / findAllDivisors / findAllDivisees pre-filter by maskDivides (bitwise subset) and simpleDegree before running the exact exponent-vector test in MonomialView::monomialDivides.

Soft-delete is the maintenance strategy: when a basis element is subsumed, retire(monIndex) just flips its mIsUsed bit to false; entries are skipped by future divisibility tests and compactify() later reshuffles the storage to reclaim space. Complements MonomialHashTable (which keys by exact equality) and is the new-F4 successor to the legacy montable.hpp doubly-linked-list-plus-bitmask index. The nested MonomialLookupIterator exposes the per-entry summary fields (isUsed, simpleDegree, mask, value, offset) to walking consumers.

See also
MonomialHashTable.hpp
MonomialView.hpp
MonomialTypes.hpp
GBF4Computation.hpp
SPairs.hpp
montable.hpp

Definition in file MonomialLookupTable.hpp.