public float[][] invert(float[][] matrix) {
      float[][] result = new float[rows][cols];
      for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
          result[rowInverse[i]][colInverse[j]] = matrix[i][j];
        }
      }
      return result;
    }
Copy a given matrix into a new matrix, transforming each row index and each column index
according to the inverse of the randomization scheme that was created at construction time.
@param matrix the cost matrix to be inverted
@return a new matrix with row and column indices inverted
hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java