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

Strict-weak comparator on integer indices into a std::vector<int*> of monomials, used by the resolution code to sort columns. More...

#include <res-monomial-sorter.hpp>

Public Member Functions

 MonomialSorterObject (const Monoid &M, const std::vector< int * > monoms)
bool operator() (int a, int b)
void resetNumComparisons ()
long numComparisons () const

Private Attributes

const MonoidmMonoid
const std::vector< int * > mMonoms

Static Private Attributes

static long mNumComparisons = 0

Detailed Description

Strict-weak comparator on integer indices into a std::vector<int*> of monomials, used by the resolution code to sort columns.

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

Each mMonoms[i] is laid out as [tiebreaker, basecomp, actual_monomial...]. operator()(a, b) compares the monomial bodies via Monoid::compare, returning the corresponding bool; on EQ it falls back to the tiebreaker slot. The static mNumComparisons counter records how many comparisons the sort performed — handy when profiling a large frame's column-sort cost.

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


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