On Friday, May 29, 2015 at 7:06:09 AM UTC-7, Scott Jones wrote:
>
> Great!  Thanks!  That also sounds like it will help with something that 
> just came up today, somebody else wanted to know how to do just that also 
> (I'm proselytizing here in Belgium, getting everybody into Julia!)
>
>
Another way that I recently discovered is to use sortperm(): basically, 
given an unsorted vector of sortable values (like frequencies), sortperm 
will return a vector of integers representing the indices of the original 
vector in sorted order. That is,

sortperm([1.1, 5.5, 4.4, 2.2]) will return [1,4,3,2].

It's also very fast (I used it to replace 5 lines of code in LightGraphs 
and sped up betweenness centrality by over 60%).

Reply via email to