I have a 3D array where I keep 3 columns of numeric data. I want to sort this Nx3 matrix in ascending order, by first column, then for the cases where the values are the same on this column, I want them to be sorted according to second column.
For example: If there are multiple of min elements in column 1, I want so sort them furthermore by second column, again in ascending order. So it would look like this:
[1, 2, 3]
[1, 3, 1]
[2, 4, 2]
[3, 5, 6]
etc.
Since there were multiple of min element "1" in column 1, furthermore sorting is carried out for these min values of column 1, according to column 2 values.
I know this was possible in Pandas of Python but is there any convenient way to do this in C++?