Ok, that’s much cleaner than my SVector variant. Forget my code and use this if you can live with the transposed memory layout.
But could I use multiple keys with that method?
You can use the by
or lt
options to specify the sorting criteria, e.g.
sort(Atup; alg=QuickSort, by=x->(x[3],x[1],x[2]))
will sort by the 3rd column, the 1st column, then the 2nd column (since tuples are compared by lexicographic order of the elements)
2 Likes
I’ve used that format for the sortrows function but it doesn’t seem to work with the sort function.
what format? It worked using @sdanisch’s example.
1 Like
Ok yeah you’re right, it works. Sorry!