code: public static double sumDoublematrixColumns( int coolIndex, double[][] matrixToSum, double[][] resultMatrix,
              int firstRowIndex, int lastRowIndex, IHMProgressMonitor pm ) {
  
          double maximum;
  
          maximum = 0;
  
          if (matrixToSum.length != resultMatrix.length) {
              pm.errorMessage(msg.message("trentoP.error.matrix")); //$NON-NLS-1$
              throw new ArithmeticException(msg.message("trentoP.error.matrix")); //$NON-NLS-1$
          }
          if (firstRowIndex < 0 || lastRowIndex < firstRowIndex) {
              pm.errorMessage(msg.message("trentoP.error.nCol")); //$NON-NLS-1$
              throw new ArithmeticException(msg.message("trentoP.error.nCol")); //$NON-NLS-1$
          }
          for( int i = 0; i < matrixToSum.length; ++i ) {
              resultMatrix[i][coolIndex] = 0; /* Initializes element */
  
              for( int j = firstRowIndex; j <= lastRowIndex; ++j ) {
                  resultMatrix[i][coolIndex] += matrixToSum[i][j];
              }
  
              if (resultMatrix[i][coolIndex] >= maximum) /* Saves maximum value */
              {
                  maximum = resultMatrix[i][coolIndex];
              }
          }
  
          return maximum;
  
      }
docs: Sum columns.
  
  <p>
  Store in a matrix (at index coulumn), the sum of the column of another
  matrix. It's necessary to specify the initial and final index of the
  coluns to sum.
  </p>
  
  
  @param coolIndex index of the matrix2 where to put the result.
  @param matrixToSum contains the value to sum.
  @param resultMatrix where to put the result.
  @param firstRowIndex initial index of the colum to sum.
  @param lastRowIndex final index of the colum to sum.
  @return maximum value of the colum index of the matrix2.