|
Macaulay2 Engine
|
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 Ring * | R |
| int | deg_ascending |
| int | ringorder_ascending |
| int * | sort_vals |
| vec * | sort_vecs |
| int * | sort_degs |
| M2_arrayint | result |
Helper that computes a column permutation for an engine Matrix by degree-then-monomial-order sort.
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.