Generating 2D matrix of circularly shifted elements
k = 0 ; NEW_LINE d = 0 ; NEW_LINE for i in range ( maxSize ) : NEW_LINE INDENT curIndex = k - d ; NEW_LINE for j in range ( maxSize ) : NEW_LINE INDENT circular_shift_mat [ j ] [ i ] = row_vec [ curIndex % maxSize ] ; NEW_LINE curIndex += 1 ; NEW_LINE DEDENT k = maxSize ; NEW_LINE d += 1 ; NEW_LINE DEDENT