code: public static DMatrixRMaj sumCols(DMatrixRMaj input , DMatrixRMaj output ) {
          if( output == null ) {
              output = new DMatrixRMaj(1,input.numCols);
          } else {
              output.reshape(1,input.numCols);
          }
  
          for( int cols = 0; cols < input.numCols; cols++ ) {
              double total = 0;
  
              int index = cols;
              int end = index + input.numCols*input.numRows;
              for( ; index < end; index += input.numCols ) {
                  total += input.data[index];
              }
  
              output.set(cols, total);
          }
          return output;
      }
docs: <p>
  Computes the sum of each column in the input matrix and returns the results in a vector:<br>
  <br>
  b<sub>j</sub> = min(i=1:m ; a<sub>ij</sub>)
  </p>
  
  @param input Input matrix
  @param output Optional storage for output. Reshaped into a row vector. Modified.
  @return Vector containing the sum of each column