American Citizen on Mon, 12 May 2025 05:39:44 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

question on compare functions for the vecsort command


Hello:

Suppose we have a small vector composed of 4 component vectors, say

V = [ [1,7,5,2], [3,7,1,4], [2,0,6,9], [8,0,5,1], etc...]

What is the compare function for vecsort(V, compare_function, flag) so that I can

1. sort the 2nd column by ascending size, then sort the 3rd column by descending size?

2. add the 3rd column to the 4th column, if the 2nd column > 1st column?

I am trying to better understand how to compose the compare functions for this command.

Randall