Le dimanche 30 novembre 2014 à 01:44 -0800, Adriaan van Niekerk a écrit : > Thanks Mauro > > > That clears things up. Would you care making a pull request on GitHub to improve the documentation for sortcols? I don't find it very explicit either. And the race to become contributor #300 is still open!
The file in question is here: https://github.com/JuliaLang/julia/edit/master/doc/stdlib/sort.rst Regards > On Sunday, 30 November 2014 11:27:26 UTC+2, Mauro wrote: > sortcols takes the whole colums and reorders them > lexicographically > (whereas sort(A,2) sorts each row separately). Thus sortcols > will > mostly sort according to the first row and only if entries are > equal > there will it take the next row into account. > > On Sun, 2014-11-30 at 08:49, Adriaan van Niekerk > <[email protected]> wrote: > > Hi > > > > When I apply sortcols to a matrix (A) it only sorts the > first row. When I > > use sort(A,2) it works fine. > > > > Below is the printout from IJulia and the same thing happens > when I run > > Julia in the terminal: > > > > In [51]: A = rand(3,3) > > > > Out [51]: 3x3 Array{Float64,2}: > > 0.305663 0.810061 0.32777 > > 0.697199 0.592799 0.977908 > > 0.492569 0.486371 0.7781 > > > > In [52]: sort(A,2) > > > > Out [52]: 3x3 Array{Float64,2}: > > 0.305663 0.32777 0.810061 > > 0.592799 0.697199 0.977908 > > 0.486371 0.492569 0.7781 > > > > In [53]: sortcols(A) > > > > Out [53]: 3x3 Array{Float64,2}: > > 0.305663 0.32777 0.810061 > > 0.697199 0.977908 0.592799 > > 0.492569 0.7781 0.486371 > > > > Is there something else I should know about sortcols? > > > > Thanks >
