Does a nim library contain an argsort implementation or wrapper? -


i looking version of argsort, such as exists in numpy or in fortran there implementation of argsort in nim ... or accessible nim in library? seems bit surprising missing.

update

the following seems work argsort:

proc argsort[t](a : t) : seq[int] =   result = toseq(0..a.len - 1)   sort(result, proc (i, j: int): int = cmp(a[i], a[j])) 

presumably, though, more efficient written natively , avoiding function pointer....


Comments

Popular posts from this blog

javascript - Feed FileReader from server side files -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -