Reduce_by_Keys performance using linear_index_to_rows_index?

I have been checking the code from rows_sum.cu from thrust example and I could not understand what is exactly happening in linear_index_to_rows_index.

Can someone please explain me with some example what does convert a linear index to row index mean?

Thanks

Reference: https://github.com/thrust/thrust/blob/master/examples/sum_rows.cu