Rank Transform of a Matrix — CaffeCode