void ForAllInt(int[] arr, DealInt func, int threadID = -1) { int begI = (threadID < 0)? 0 : threadID * width / ThreadNumber; int endI = (threadID < 0)? width : (threadID + 1) * width / ThreadNumber; for (int i = begI; i < endI; ++i) { for (int j = 0; j < height; ++j) { int pos = ij2index(i, j); arr[pos] = func(arr[pos], i, j); } } }
void ForAllInt(int[] arr , DealInt func , int threadID = -1) { int begI = (threadID < 0 )? 0 : threadID * width / ThreadNumber; int endI = (threadID < 0 )? width : ( threadID + 1 ) * width / ThreadNumber; for( int i = begI ; i < endI ; ++ i ) for( int j = 0 ; j < height ; ++ j ) { int pos = ij2index( i , j ); arr[pos] = func(arr[pos] , i , j ); } }