Shouldn't the first argument of argsort be a const pointer since the data is not modified? That would make the interface more clear.