code: public static void byColumn(Matrix m) {
          for (int i = 0; i < m.columns(); ++i) {
              double colSum = 0;
              for (int j = 0; j < m.rows(); ++j)
                  colSum += m.get(j,i);
  
              // Skip columns whose sume is zero.
              if (colSum == 0) 
                  continue;
              for (int j = 0; j < m.rows(); ++j)
                  m.set(j,i, m.get(j,i) / colSum);
          }
      }
docs: Normalize the values of each column in the {@code Matrix} to be
  normalized by the length of each column.
  
  @param m The matrix to normalize.