Macaulay2 Engine
Loading...
Searching...
No Matches

◆ sort_compare()

int MatrixSorter::sort_compare ( int i,
int j )
inlineprivate

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

59 {
60 if (i == j) return 0;
61 vec v1 = sort_vecs[i];
62 vec v2 = sort_vecs[j];
63 if (v1 == nullptr) return 1;
64 if (v2 == nullptr) return -1;
65 if (deg_ascending != 0)
66 {
67 int d1 = sort_degs[i];
68 int d2 = sort_degs[j];
69 if (d1 > d2) return -deg_ascending;
70 if (d1 < d2) return deg_ascending;
71 }
72 int cmp = R->compare_vecs(v1, v2);
73 if (cmp > 0) return -ringorder_ascending;
74 if (cmp < 0) return ringorder_ascending;
75 return 0;
76 }
const Ring * R
int ringorder_ascending

References deg_ascending, R, ringorder_ascending, sort_degs, and sort_vecs.

Referenced by sort_partition().