sortperm
for a vector gives me a permutation that sorts an array
x = rand(1:10, 5)
p = sortperm(x)
x[p] # is sorted
How can i generate a permutation q
from p
such that
x[p][q] == x
?
Maybe [Base.invperm
] (https://docs.julialang.org/en/v1/base/arrays/#Base.invperm)?
TY! Didn't find it in docs :)
Last updated: Dec 28 2024 at 04:38 UTC