code: public static DMatrixRMaj sumCols(DMatrixSparseCSC input , @Nullable DMatrixRMaj output ) {
          if( output == null ) {
              output = new DMatrixRMaj(1,input.numCols);
          } else {
              output.reshape(1,input.numCols);
          }
  
          for (int col = 0; col < input.numCols; col++) {
              int idx0 = input.col_idx[col];
              int idx1 = input.col_idx[col + 1];
  
              double sum = 0;
              for (int i = idx0; i < idx1; i++) {
                  sum += input.nz_values[i];
              }
              output.data[col] = sum;
  
          }
  
          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> = sum(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