sort2 does not work on a column vector

Q&Asort2 does not work on a column vector
sdonn asked 2 years ago

When the argument to sort2 is a column vector (i.e. the size is Nx1), the returned indices array is all-zeroes.
Passing the transposed version of the column to the function results in the correct indices.

1 Answers
bgoossen Staff answered 2 years ago

Actually, this is by design. By “convention” `sort2` sorts alongs the rows, so that you can sort multiple rows in parallel (gives a significant speedup when you need to sort multiple rows). I will update the docs to make this a bit more clear.