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

Helper that computes a column permutation for an engine Matrix by degree-then-monomial-order sort. More...

Public Member Functions

 MatrixSorter (const Matrix *m, int degorder, int ringorder)
M2_arrayintOrNull value ()

Private Member Functions

int sort_compare (int i, int j)
int sort_partition (int lo, int hi)
void sort_range (int lo, int hi)

Private Attributes

const RingR
int deg_ascending
int ringorder_ascending
intsort_vals
vec * sort_vecs
intsort_degs
M2_arrayint result

Detailed Description

Helper that computes a column permutation for an engine Matrix by degree-then-monomial-order sort.

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

deg_ascending and ringorder_ascending are sign flags; the comparator first orders by sort_degs[i] (the column's heuristic degree) and then breaks ties with the ring's lead-term comparison on sort_vecs[i]. Indices are sorted into result, which the caller uses to permute the matrix columns. Used to implement the engine-side sort matrix operation.

Definition at line 48 of file matrix-sort.cpp.


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