height_offset = floor(((int)max_loc) / nCol);
width_offset = (int)max_loc - nCol*height_offset;
if (height_offset > 0.5*nRow)
height_offset = height_offset - nRow;
if (width_offset > 0.5*nCol)
width_offset = width_offset - nCol;
delete[] cross_real;
cross_real = NULL;