code: public static double[] colMax(double[][] data) {
          double[] x = new double[data[0].length];
          for (int i = 0; i < x.length; i++) {
              x[i] = Double.NEGATIVE_INFINITY;
          }
  
          for (int i = 0; i < data.length; i++) {
              for (int j = 0; j < x.length; j++) {
                  if (x[j] < data[i][j]) {
                      x[j] = data[i][j];
                  }
              }
          }
  
          return x;
      }
docs: Returns the column maximum for a matrix.