Skip to main content

argsort_numpy

Function argsort_numpy 

Source
pub fn argsort_numpy(a: &[f64]) -> Vec<u64>
Expand description

NumPy 2.4.5-bit-identical np.argsort(a) for f64 on an AVX2 (x86-64) build.

Reproduces x86simdsortStatic::argsort (the AVX2 path numpy 2.4.5 actually dispatches to for double on AVX2 CPUs), including exact tie order.

Guarantees:

  • No-NaN inputs: bit-identical to np.argsort(a, kind='quicksort').
  • NaN inputs: bit-identical to numpy, reproduced via the libstdc++ std::sort introsort with numpy’s NaN-last comparator (the path numpy takes for NaN-containing float arrays). NaN indices sort to the end.