Following C++ sorting and keeping track of indexes : This is how to get the argsort of vector v
argsort
vector v