pro buildSequentialIndices,array,currentColumn=currentColumn, numRows=numRows, $ numCols=numCols ;builds a sequential array of indices. The first column of the array must ;first be initialized to the fastest changing index. See test program ;testBuildSequentialIndices.pro for an example sz = size(array,/dimen) maxVal = max(array) currentVal = 0L interval = numRows^currentColumn for i=0L,sz[1]-1 do begin leftVal = array[currentColumn-1,i] if i eq 0 then continue if ( i mod interval) eq 0 then currentVal= (currentVal+1) mod numRows array[currentColumn,i] = currentVal endfor if currentColumn lt (numCols-1) then $ buildSequentialIndices,array,currentColumn=currentColumn+1,numRows=numRows, $ numCols=numCols return end