Macaulay2 Engine
Loading...
Searching...
No Matches
f4-types.hpp File Reference

Shared type vocabulary used across the F4 engine. More...

#include <climits>
#include "VectorArithmetic.hpp"
#include "f4/f4-monlookup.hpp"
#include "f4/moninfo.hpp"
#include "f4/varpower-monomial.hpp"
#include "newdelete.hpp"
#include "style.hpp"

Go to the source code of this file.

Classes

struct  GBF4Polynomial
 Compact polynomial layout used inside the F4 GB engine. More...
struct  pre_spair
struct  spair
struct  gbelem
struct  sparse_row
struct  row_elem
struct  column_elem
struct  coefficient_matrix
class  ColumnsSorter
 Comparator that orders Macaulay-matrix column indices by the monomial each column represents, using the ambient MonomialInfo. More...
class  GBSorter
 Comparator that orders indices into the current GB array (gb_array) by each gbelem's leading monomial, in increasing order. More...
class  PreSPairSorter
 Comparator that orders pre_spair* pointers by the quot varpower monomial of each pre-S-pair. More...
class  SPairCompare
 Comparator on indices into an spair table, ordering by sugar degree then by the larger of the two parent indices. More...

Macros

#define sizeofspair(s, len)

Typedefs

typedef std::vector< gbelem * > gb_array
typedef int(MonomialInfo::* CompareFunction) (const monomial_word *, const monomial_word *) const
typedef F4MonomialLookupTableT< int32_t > MonomialLookupTable

Enumerations

enum  gbelem_type { ELEM_IN_RING , ELEM_POSSIBLE_MINGEN , ELEM_MIN_GB , ELEM_NON_MIN_GB }
enum  spair_type {
  F4_SPAIR_SPAIR , F4_SPAIR_GCD_ZZ , F4_SPAIR_RING , F4_SPAIR_SKEW ,
  F4_SPAIR_GEN , F4_SPAIR_ELEM
}
enum class  SPairType { SPair , Generator , Retired }

Detailed Description

Shared type vocabulary used across the F4 engine.

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

Declares the inner-loop record types the F4 algorithm shares. Polynomial form: GBF4Polynomial (length + opaque ElementArray coeffs + flat monomial_word* monoms buffer) is what each basis element stores. Basis side: gbelem wraps a GBF4Polynomial with deg, alpha (homogenising degree), and a gbelem_type tag — ELEM_IN_RING / ELEM_POSSIBLE_MINGEN / ELEM_MIN_GB / ELEM_NON_MIN_GB — and gb_array = std::vector<gbelem*> is the basis list. Pair side: pre_spair is the proto-pair staged before full materialisation; spair carries (type, deg, i, j, monomial_word* lcm) where the lcm is a pointer to an externally-allocated MemoryBlock slot (the file also defines a vestigial sizeofspair(s, len) macro from an older design where lcm was a flexible array member — the only call site is now commented out in f4-spairs.cpp). Two pair-type enums coexist: the legacy spair_type (with F4_SPAIR_GCD_ZZ, F4_SPAIR_RING, F4_SPAIR_SKEW, F4_SPAIR_GEN, F4_SPAIR_ELEM, F4_SPAIR_SPAIR) and the modern enum class SPairType { SPair, Generator, Retired } with a TODO to absorb the remaining cases.

Macaulay matrix: coefficient_matrix is a (row_array, column_array) pair; each row_elem holds an opaque ElementArray coeffs plus a comps[len] index array (new[]- allocated, no longer arena-backed), and each column_elem tracks the pivoting head row. The transient sparse_row mirrors row_elem with the comps allocated from a memory block. The sorters — ColumnsSorter (sorts column indices by MonomialInfo::compare on the column monomials), GBSorter (sorts basis indices by leading monomial), PreSPairSorter (sorts pre-pairs by varpower quotient) and SPairCompare (degree first, i tiebreak, driving f4-spairs.hpp's priority queue) — all carry static comparison counters. MonomialLookupTable is the F4MonomialLookupTableT<int32_t> instantiation.

Pulls together the encoded-monomial layer (moninfo.hpp, varpower-monomial.hpp), the lookup-table type (f4-monlookup.hpp), and the templated coefficient arithmetic (VectorArithmetic.hpp). Counterpart to the new F4 engine's gb-f4/MonomialTypes.hpp.

See also
f4.hpp
f4-spairs.hpp
moninfo.hpp

Definition in file f4-types.hpp.