|
Macaulay2 Engine
|
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< int > | sort () |
| long | numComparisons () const |
Private Member Functions | |
| void | toMonomial (res_packed_monomial mon, std::pair< int *, int * > resultAlreadyAllocateds) |
Private Attributes | |
| const Monoid & | mMonoid |
| const ResMonoid & | mResMonoid |
| const ResSchreyerOrder & | mSchreyerOrder |
| const std::vector< res_packed_monomial > & | mColumns |
| long | mNumComparisons |
| memt::Arena | mArena |
| std::vector< int * > | mMonoms |
| std::vector< int > | mPositions |
Sorter that orders res_packed_monomials by their total (Schreyer) monomial, with a stable tiebreaker derived from input order.
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.