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

Sorter that orders res_packed_monomials by their total (Schreyer) monomial, with a stable tiebreaker derived from input order. More...

#include <res-monomial-sorter.hpp>

Public Member Functions

 ResMonomialSorter (const Monoid &M, const ResMonoid &resMonoid, const ResSchreyerOrder &S, const std::vector< res_packed_monomial > &columns)
void setMonoms ()
bool ordered ()
std::vector< intsort ()
long numComparisons () const

Private Member Functions

void toMonomial (res_packed_monomial mon, std::pair< int *, int * > resultAlreadyAllocateds)

Private Attributes

const MonoidmMonoid
const ResMonoidmResMonoid
const ResSchreyerOrdermSchreyerOrder
const std::vector< res_packed_monomial > & mColumns
long mNumComparisons
memt::Arena mArena
std::vector< int * > mMonoms
std::vector< intmPositions

Detailed Description

Sorter that orders res_packed_monomials by their total (Schreyer) monomial, with a stable tiebreaker derived from input order.

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

Allocates the [tiebreaker, basecomp, totalmon] triples inside its own memt::Arena so the sort can run without touching the caller's monomial storage. mSchreyerOrder supplies the per-component multiplier that turns each mColumns[i] into its total monomial; the result is held in mMonoms and the permutation in mPositions. Keeps a mNumComparisons counter for profiling.

Definition at line 126 of file res-monomial-sorter.hpp.


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