Created
May 4, 2011 16:26
-
-
Save cmcbride/955519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* for use with Array. Easy way to create an index, and then sort the index *) | |
let index a = Array.init ( Array.length a) (fun i -> i) | |
let sort_index a idx = | |
let cmpi i j = compare a.(i) a.(j) in | |
Array.fast_sort cmpi idx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment