2 #include <NTL/vec_ZZ.h>
3 #include <NTL/mat_ZZ.h>
6 int lex_cmp(vec_ZZ
& a
, vec_ZZ
& b
)
8 assert(a
.length() == b
.length());
10 for (int j
= 0; j
< a
.length(); ++j
)
12 return a
[j
] < b
[j
] ? -1 : 1;
16 void lex_order_rows(mat_ZZ
& mat
)
18 for (int i
= 0; i
< mat
.NumRows(); ++i
) {
20 for (int j
= i
+1; j
< mat
.NumRows(); ++j
)
21 if (lex_cmp(mat
[j
], mat
[m
]) < 0)