get1dFrom2d function

2D-indexing to 1D-indexing